mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-17 21:34:48 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - An agent gets environment variables from its execution environment, its own configuration, its project, and its routine. Secrets are resolved for each run. > - A plugin environment can run the agent as a native Runner task on its own host, through the environment task contract. > - That contract has no field for the agent's variables. Runs on a plugin environment get only the variables that the plugin sets itself. > - This pull request adds a versioned contract field for the values, sends them on a session handoff, lets Codex commands inherit the variables in an external sandbox, and lets a plugin protect the variables that it sets itself. > - The benefit is that plain and secret variables work on plugin environments in the same way as on local environments. ## Linked Issues or Issue Description Refs #21233. That pull request by @lucktastic finds the same gap and proposes the same capability and field names (`configuredEnvironmentVersion: 1`, `configuredEnvironment`). This pull request uses the same names, so providers implement one contract. It differs in these places: - Codex commands get the variables through an external-sandbox denylist, not through key names sent at `prepare`. A retained Runner does not need a new preparation when a key is added or removed. - A session handoff `resume` gets the values, because it starts a new Runner on another computer. Value changes on the same computer need no new field: Core's process reuse key includes the values, so Core starts a new task. - A driver can declare `protectedEnvironmentKeys`. Paperclip rejects or warns when one is saved. - The run log names skipped variables only for an older provider. Thank you to @lucktastic for the diagnosis and the contract shape. **What happened?** An agent has environment variables, plain and secret. Its runs on a plugin task environment do not get them. `PAPERCLIP_CONFIGURED_ENV_KEYS` in the run lists only the variables that the plugin sets. **Expected behavior** Each run gets the agent's configured variables. **Steps to reproduce** 1. Set a plain and a secret environment variable on an agent. 2. Assign the agent to a plugin environment that provides Runner tasks. 3. Start a run. Read the names in `PAPERCLIP_CONFIGURED_ENV_KEYS` in a command that the agent runs. 4. The agent's names are not in the list. ## What Changed - **SDK contract** (`packages/plugins/sdk/src/environment-tasks.ts`): - A provider advertises `configuredEnvironmentVersion: 1` on `describe`. - `submit` gets `configuredEnvironment`. `resume` gets it only for a session handoff. - Names, count, and sizes have the same limits as the Runner projection. - **Server**: - `createRunnerdBackendWithinSessionClaim` gives the run's configured projection to the plugin task owner. The projection has no provider credentials and no generated runtime keys. - `createPluginRunnerTaskOwner` sends the fields only to a provider with the capability. An older provider gets no new field, and the run log names the variables that were not set. The log never prints values. - **Codex** (`codex-security-config.ts`): - An externally sandboxed launch uses `inherit="all"`, `ignore_default_excludes=true`, and an `exclude` list of Codex's own credentials, instead of an `include_only` list fixed at preparation time. - A test reads the Runner's Codex environment keys, and fails if a new key is not classified. - Host launches keep the bounded allowlist. - **runnerd** (`codex_provider.rs`): `runtime_notification_codex_args` still grants the notification files to read-only profiles when no allowlist is present. Plan mode in an external sandbox needs these grants. - **Protected keys**: - An environment driver can declare `protectedEnvironmentKeys` in its manifest. - Paperclip rejects a protected key on an agent or environment that uses the driver. The 422 has code `protected_environment_variable`. - On a project, a routine, or another agent, Paperclip saves the key. The response has a `configurationWarnings` notice that names the environments. The project and routine pages show the notice as a toast. The agent pages already show configuration warnings. - **Docs**: `doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md` describes the provider obligations. - `tests/runner-e2e/source-sdk-public-inputs.json`: refresh the reviewed SDK source pin. ## Verification - `packages/plugins/sdk`: `vitest run tests/environment-tasks.test.ts` (38 pass). Accepts bounded values. Rejects bad names, NUL bytes, too many variables, and oversized values. - `server`: `vitest run src/services/native-runtime/plugin-runner-task.test.ts` (95 pass). Values go only to a provider with the capability, never in `prepare`. `resume` sends values only for a handoff. - `server`: `vitest run src/services/protected-environment-keys.test.ts src/__tests__/project-routes-env.test.ts` (10 pass). Rejection, notices, and the project route response. - `server`: all route suites that import the project, routine, environment, or agent routes (45 files, 1689 pass). - `packages/shared`: `vitest run src/validators/plugin.test.ts` (64 pass). - `packages/paperclip-runner`: `vitest run src/drivers/codex src/configured-environment.test.ts src/live/runner-provider-launch.test.ts` (444 pass). - `packages/paperclip-runner/runner`: `cargo test -p paperclip-runner-core --lib runtime_notification` (9 pass, 2 ignored as before). - `pnpm typecheck` in `packages/shared`, `packages/plugins/sdk`, `packages/paperclip-runner`, `server`, and `ui`. - Not run locally: `pnpm verify --full` and browser suites. Required CI covers the final revision. ## Risks - **Existing providers:** low risk. Core sends no new field to a provider without the capability. Their runs behave as before, with one added log line when variables were skipped. - **Codex in an external sandbox:** commands now see every variable in the Runner environment except Codex's own credentials. The execution environment builds that environment from an allowlist. If the Runner gives Codex a new credential, the drift test fails until the key is classified. - **Saving env:** new rejections happen only when an installed driver declares `protectedEnvironmentKeys`. No driver declares them today. - **Providers:** they must keep the values transient and never save or log them. The doc lists these obligations. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, in Claude Code with tool use and code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
499 lines
17 KiB
TypeScript
499 lines
17 KiB
TypeScript
/**
|
|
* `@paperclipai/plugin-sdk` — Paperclip plugin worker-side SDK.
|
|
*
|
|
* This is the main entrypoint for plugin worker code. For plugin UI bundles,
|
|
* import from `@paperclipai/plugin-sdk/ui` instead.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* // Plugin worker entrypoint (dist/worker.ts)
|
|
* import { definePlugin, runWorker, z } from "@paperclipai/plugin-sdk";
|
|
*
|
|
* const plugin = definePlugin({
|
|
* async setup(ctx) {
|
|
* ctx.logger.info("Plugin starting up");
|
|
*
|
|
* ctx.events.on("issue.created", async (event) => {
|
|
* ctx.logger.info("Issue created", { issueId: event.entityId });
|
|
* });
|
|
*
|
|
* ctx.jobs.register("full-sync", async (job) => {
|
|
* ctx.logger.info("Starting full sync", { runId: job.runId });
|
|
* // ... sync implementation
|
|
* });
|
|
*
|
|
* ctx.data.register("sync-health", async ({ companyId }) => {
|
|
* const state = await ctx.state.get({
|
|
* scopeKind: "company",
|
|
* scopeId: String(companyId),
|
|
* stateKey: "last-sync-at",
|
|
* });
|
|
* return { lastSync: state };
|
|
* });
|
|
* },
|
|
*
|
|
* async onHealth() {
|
|
* return { status: "ok" };
|
|
* },
|
|
* });
|
|
*
|
|
* export default plugin;
|
|
* runWorker(plugin, import.meta.url);
|
|
* ```
|
|
*
|
|
* @see PLUGIN_SPEC.md §14 — SDK Surface
|
|
* @see PLUGIN_SPEC.md §29.2 — SDK Versioning
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Main factory
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export { definePlugin } from "./define-plugin.js";
|
|
export { createTestHarness, createEnvironmentTestHarness, createFakeEnvironmentDriver, filterEnvironmentEvents, assertEnvironmentEventOrder, assertLeaseLifecycle, assertWorkspaceRealizationLifecycle, assertExecutionLifecycle, assertEnvironmentError } from "./testing.js";
|
|
export { createPluginBundlerPresets } from "./bundlers.js";
|
|
export { startPluginDevServer, getUiBuildSnapshot } from "./dev-server.js";
|
|
export { startWorkerRpcHost, runWorker } from "./worker-rpc-host.js";
|
|
export {
|
|
createHostClientHandlers,
|
|
getRequiredCapability,
|
|
CapabilityDeniedError,
|
|
InvocationScopeDeniedError,
|
|
} from "./host-client-factory.js";
|
|
|
|
// JSON-RPC protocol helpers and constants
|
|
export {
|
|
JSONRPC_VERSION,
|
|
JSONRPC_ERROR_CODES,
|
|
PLUGIN_RPC_ERROR_CODES,
|
|
HOST_TO_WORKER_REQUIRED_METHODS,
|
|
HOST_TO_WORKER_OPTIONAL_METHODS,
|
|
MESSAGE_DELIMITER,
|
|
createRequest,
|
|
createSuccessResponse,
|
|
createErrorResponse,
|
|
createNotification,
|
|
isJsonRpcRequest,
|
|
isJsonRpcNotification,
|
|
isJsonRpcResponse,
|
|
isJsonRpcSuccessResponse,
|
|
isJsonRpcErrorResponse,
|
|
serializeMessage,
|
|
parseMessage,
|
|
JsonRpcParseError,
|
|
JsonRpcCallError,
|
|
LOGIN_PTY_OUTPUT_NOTIFICATION,
|
|
LOGIN_PTY_EXIT_NOTIFICATION,
|
|
DUPLEX_CHANNEL_DATA_NOTIFICATION,
|
|
DUPLEX_CHANNEL_EXIT_NOTIFICATION,
|
|
encodeChannelBytes,
|
|
decodeChannelBytes,
|
|
_resetIdCounter,
|
|
} from "./protocol.js";
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Type exports
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// Plugin definition and lifecycle types
|
|
export type {
|
|
PluginDefinition,
|
|
PaperclipPlugin,
|
|
PluginHealthDiagnostics,
|
|
PluginConfigChangeContext,
|
|
PluginConfigValidationResult,
|
|
PluginWebhookInput,
|
|
PluginApiRequestInput,
|
|
PluginApiResponse,
|
|
} from "./define-plugin.js";
|
|
export type {
|
|
TestHarness,
|
|
TestHarnessOptions,
|
|
TestHarnessLogEntry,
|
|
EnvironmentTestHarness,
|
|
EnvironmentTestHarnessOptions,
|
|
EnvironmentEventRecord,
|
|
FakeEnvironmentDriverOptions,
|
|
} from "./testing.js";
|
|
export type {
|
|
PluginBundlerPresetInput,
|
|
PluginBundlerPresets,
|
|
EsbuildLikeOptions,
|
|
RollupLikeConfig,
|
|
} from "./bundlers.js";
|
|
export type { PluginDevServer, PluginDevServerOptions } from "./dev-server.js";
|
|
export type {
|
|
WorkerRpcHostOptions,
|
|
WorkerRpcHost,
|
|
RunWorkerOptions,
|
|
} from "./worker-rpc-host.js";
|
|
export type {
|
|
HostServices,
|
|
HostClientFactoryOptions,
|
|
HostClientHandlers,
|
|
} from "./host-client-factory.js";
|
|
|
|
// JSON-RPC protocol types
|
|
export type {
|
|
JsonRpcId,
|
|
JsonRpcInvocationScope,
|
|
JsonRpcInvocationContext,
|
|
JsonRpcRequest,
|
|
JsonRpcSuccessResponse,
|
|
JsonRpcError,
|
|
JsonRpcErrorResponse,
|
|
JsonRpcResponse,
|
|
JsonRpcNotification,
|
|
JsonRpcMessage,
|
|
JsonRpcErrorCode,
|
|
PluginRpcErrorCode,
|
|
PluginInvocationScope,
|
|
PluginInvocationContext,
|
|
WorkerHostCallContext,
|
|
InitializeParams,
|
|
InitializeResult,
|
|
ConfigChangedParams,
|
|
ValidateConfigParams,
|
|
OnEventParams,
|
|
RunJobParams,
|
|
GetDataParams,
|
|
PerformActionParams,
|
|
PluginPerformActionActorType,
|
|
PluginPerformActionActorContext,
|
|
PluginPerformActionContext,
|
|
ExecuteToolParams,
|
|
PluginExternalObjectUrlCandidate,
|
|
PluginExternalObjectSourceContext,
|
|
DetectExternalObjectsParams,
|
|
PluginExternalObjectDetection,
|
|
DetectExternalObjectsResult,
|
|
PluginExternalObjectRecordSnapshot,
|
|
ResolveExternalObjectParams,
|
|
PluginExternalObjectResolvedSnapshot,
|
|
PluginExternalObjectResolveResult,
|
|
RefreshExternalObjectsParams,
|
|
RefreshExternalObjectsResult,
|
|
PluginEnvironmentDiagnostic,
|
|
PluginEnvironmentDriverBaseParams,
|
|
PluginEnvironmentValidateConfigParams,
|
|
PluginEnvironmentValidationResult,
|
|
PluginEnvironmentProbeParams,
|
|
PluginEnvironmentProbeResult,
|
|
PluginEnvironmentLease,
|
|
PluginEnvironmentWorkspaceAllocationFiles,
|
|
PluginEnvironmentAcquireLeaseParams,
|
|
PluginEnvironmentResumeLeaseParams,
|
|
PluginEnvironmentReleaseLeaseParams,
|
|
PluginEnvironmentTerminationReceipt,
|
|
PluginEnvironmentDestroyLeaseParams,
|
|
PluginEnvironmentInspectLeaseParams,
|
|
PluginEnvironmentLeaseObservation,
|
|
PluginEnvironmentRealizeWorkspaceParams,
|
|
PluginEnvironmentRealizeWorkspaceResult,
|
|
PluginEnvironmentExecuteParams,
|
|
PluginEnvironmentExecuteResult,
|
|
PluginEnvironmentRunnerIngressEndpointParams,
|
|
PluginEnvironmentRunnerIngressEndpoint,
|
|
PluginSyncFileMapping,
|
|
PluginPostUploadCommand,
|
|
PluginSyncOperation,
|
|
PluginEnvironmentSyncInParams,
|
|
PluginEnvironmentSyncOutParams,
|
|
PluginEnvironmentSyncResult,
|
|
PluginEnvironmentInteractiveSetupStatus,
|
|
PluginEnvironmentInteractiveSetupConnectionType,
|
|
PluginEnvironmentTemplateRefKind,
|
|
PluginEnvironmentInteractiveSetupConnectionSummary,
|
|
PluginEnvironmentInteractiveSetupConnectionPayload,
|
|
PluginEnvironmentInteractiveSetupSession,
|
|
PluginEnvironmentStartInteractiveSetupParams,
|
|
PluginEnvironmentGetInteractiveSetupParams,
|
|
PluginEnvironmentCaptureTemplateParams,
|
|
PluginEnvironmentCaptureTemplateResult,
|
|
PluginEnvironmentCancelInteractiveSetupParams,
|
|
PluginEnvironmentCancelInteractiveSetupResult,
|
|
PluginEnvironmentDeleteTemplateParams,
|
|
PluginEnvironmentDeleteTemplateResult,
|
|
PluginLoginCommandKey,
|
|
PluginLoginPtyOpenParams,
|
|
PluginLoginPtyOpenResult,
|
|
PluginLoginPtyInputParams,
|
|
PluginLoginPtyReadCredentialParams,
|
|
PluginLoginPtyReadCredentialResult,
|
|
PluginLoginPtyStopParams,
|
|
PluginLoginPtyCloseParams,
|
|
PluginLoginPtyCloseResult,
|
|
PluginModalBoundsRequest,
|
|
PluginRenderCloseEvent,
|
|
PluginLauncherRenderContextSnapshot,
|
|
HostToWorkerMethods,
|
|
HostToWorkerMethodName,
|
|
WorkerToHostMethods,
|
|
WorkerToHostMethodName,
|
|
HostToWorkerRequest,
|
|
HostToWorkerResponse,
|
|
WorkerToHostRequest,
|
|
WorkerToHostResponse,
|
|
WorkerToHostNotifications,
|
|
WorkerToHostNotificationName,
|
|
} from "./protocol.js";
|
|
|
|
// Plugin context and all client interfaces
|
|
export type {
|
|
PluginContext,
|
|
PluginConfigClient,
|
|
PluginLocalFolderProblem,
|
|
PluginLocalFolderStatus,
|
|
PluginLocalFolderConfigureInput,
|
|
PluginLocalFolderListOptions,
|
|
PluginLocalFolderEntry,
|
|
PluginLocalFolderListing,
|
|
PluginLocalFoldersClient,
|
|
PluginEventsClient,
|
|
ResourceLifecycleEvent,
|
|
ResourceLifecycleResult,
|
|
PluginJobsClient,
|
|
PluginLaunchersClient,
|
|
PluginHttpClient,
|
|
PluginSecretsClient,
|
|
PluginActivityClient,
|
|
PluginActivityLogEntry,
|
|
PluginStateClient,
|
|
PluginEntitiesClient,
|
|
PluginProjectsClient,
|
|
PluginExecutionWorkspacesClient,
|
|
PluginSkillsClient,
|
|
PluginCompaniesClient,
|
|
PluginIssuesClient,
|
|
PluginIssueMutationActor,
|
|
PluginIssueRelationsClient,
|
|
PluginIssueRelationSummary,
|
|
PluginIssueCheckoutOwnership,
|
|
PluginIssueWakeupResult,
|
|
PluginIssueWakeupBatchResult,
|
|
PluginIssueRunSummary,
|
|
PluginIssueApprovalSummary,
|
|
PluginIssueCostSummary,
|
|
PluginBudgetIncidentSummary,
|
|
PluginIssueInvocationBlockSummary,
|
|
PluginIssueOrchestrationSummary,
|
|
PluginIssueSubtreeOptions,
|
|
PluginIssueAssigneeSummary,
|
|
PluginIssueSubtree,
|
|
PluginIssueSummariesClient,
|
|
PluginAgentsClient,
|
|
PluginAgentRuntimeState,
|
|
PluginAgentRuntimeIdentity,
|
|
PluginAgentConnectionAssignments,
|
|
PluginAgentRuntimeSkill,
|
|
PluginAccessClient,
|
|
PluginAccessMembersClient,
|
|
PluginAccessInvitesClient,
|
|
PluginAccessMember,
|
|
PluginAccessInvite,
|
|
PluginAuthorizationClient,
|
|
PluginAuthorizationPolicySummary,
|
|
PluginAuthorizationPolicyRecord,
|
|
PluginAssignmentPreviewInput,
|
|
PluginAuthorizationDecisionResult,
|
|
PluginAuthorizationAuditEntry,
|
|
PluginAgentSessionsClient,
|
|
AgentSession,
|
|
AgentSessionEvent,
|
|
AgentSessionSendResult,
|
|
PluginGoalsClient,
|
|
PluginDataClient,
|
|
PluginActionsClient,
|
|
PluginStreamsClient,
|
|
PluginToolsClient,
|
|
PluginMetricsClient,
|
|
PluginTelemetryClient,
|
|
PluginLogger,
|
|
PluginTracer,
|
|
PluginSpan,
|
|
} from "./types.js";
|
|
|
|
// Tracer no-op default (a value, so it re-exports here, not in the type block).
|
|
export { NOOP_PLUGIN_TRACER, NOOP_PLUGIN_SPAN } from "./types.js";
|
|
|
|
// Supporting types for context clients
|
|
export type {
|
|
ScopeKey,
|
|
EventFilter,
|
|
PluginEvent,
|
|
PluginJobContext,
|
|
PluginLauncherRegistration,
|
|
ToolRunContext,
|
|
ToolResult,
|
|
PluginEntityUpsert,
|
|
PluginEntityRecord,
|
|
PluginEntityQuery,
|
|
PluginWorkspace,
|
|
PluginProjectSnapshot,
|
|
PluginExecutionWorkspaceMetadata,
|
|
Company,
|
|
Project,
|
|
Issue,
|
|
IssueComment,
|
|
IssueDocumentSummary,
|
|
Agent,
|
|
Goal,
|
|
PermissionKey,
|
|
PrincipalPermissionGrant,
|
|
PrincipalType,
|
|
PluginDatabaseClient,
|
|
HumanCompanyMembershipRole,
|
|
MembershipStatus,
|
|
EnvSecretRefBinding,
|
|
} from "./types.js";
|
|
|
|
// Manifest and constant types re-exported from @paperclipai/shared
|
|
// Plugin authors import manifest types from here so they have a single
|
|
// dependency (@paperclipai/plugin-sdk) for all plugin authoring needs.
|
|
export type {
|
|
PaperclipPluginManifestV1,
|
|
PluginJobDeclaration,
|
|
PluginWebhookDeclaration,
|
|
PluginToolDeclaration,
|
|
PluginEnvironmentDriverDeclaration,
|
|
PluginEnvironmentTemplateConfigBinding,
|
|
PluginManagedAgentDeclaration,
|
|
PluginManagedAgentResolution,
|
|
PluginManagedProjectDeclaration,
|
|
PluginManagedProjectResolution,
|
|
PluginManagedRoutineDeclaration,
|
|
PluginManagedRoutineResolution,
|
|
PluginManagedSkillDeclaration,
|
|
PluginManagedSkillFileDeclaration,
|
|
PluginManagedSkillResolution,
|
|
CompanySkill,
|
|
PluginManagedResourceKind,
|
|
PluginManagedResourceRef,
|
|
PluginUiSlotDeclaration,
|
|
PluginUiDeclaration,
|
|
PluginLauncherActionDeclaration,
|
|
PluginLauncherRenderDeclaration,
|
|
PluginLauncherDeclaration,
|
|
PluginMinimumHostVersion,
|
|
PluginDatabaseDeclaration,
|
|
PluginApiRouteCompanyResolution,
|
|
PluginApiRouteDeclaration,
|
|
PluginLocalFolderDeclaration,
|
|
PluginCompanySettings,
|
|
PluginObjectReferenceRefreshPolicy,
|
|
PluginObjectReferenceProviderDeclaration,
|
|
PluginRecord,
|
|
PluginDatabaseNamespaceRecord,
|
|
PluginMigrationRecord,
|
|
PluginConfig,
|
|
JsonSchema,
|
|
PluginStatus,
|
|
PluginCategory,
|
|
PluginCapability,
|
|
PluginUiSlotType,
|
|
PluginUiSlotEntityType,
|
|
PluginLauncherPlacementZone,
|
|
PluginLauncherAction,
|
|
PluginLauncherBounds,
|
|
PluginLauncherRenderEnvironment,
|
|
PluginStateScopeKind,
|
|
PluginJobStatus,
|
|
PluginJobRunStatus,
|
|
PluginJobRunTrigger,
|
|
PluginWebhookDeliveryStatus,
|
|
PluginDatabaseCoreReadTable,
|
|
PluginDatabaseMigrationStatus,
|
|
PluginDatabaseNamespaceMode,
|
|
PluginDatabaseNamespaceStatus,
|
|
PluginApiRouteAuthMode,
|
|
PluginApiRouteCheckoutPolicy,
|
|
PluginApiRouteMethod,
|
|
PluginEventType,
|
|
PluginBridgeErrorCode,
|
|
ConnectionIntentInteraction,
|
|
ConnectionIntentPayload,
|
|
ConnectionIntentResult,
|
|
ConnectionIntentSetupOptions,
|
|
ConnectionRequestResult,
|
|
ConnectionsSearchResult,
|
|
} from "./types.js";
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Zod re-export
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/**
|
|
* Zod is re-exported for plugin authors to use when defining their
|
|
* `instanceConfigSchema` and tool `parametersSchema`.
|
|
*
|
|
* Plugin authors do not need to add a separate `zod` dependency.
|
|
*
|
|
* @see PLUGIN_SPEC.md §14.1 — Example SDK Shape
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* import { z } from "@paperclipai/plugin-sdk";
|
|
*
|
|
* const configSchema = z.object({
|
|
* apiKey: z.string().describe("Your API key"),
|
|
* workspace: z.string().optional(),
|
|
* });
|
|
* ```
|
|
*/
|
|
export { z } from "zod";
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Constants re-exports (for plugin code that needs to check values at runtime)
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export {
|
|
PLUGIN_API_VERSION,
|
|
PLUGIN_STATUSES,
|
|
PLUGIN_CATEGORIES,
|
|
PLUGIN_CAPABILITIES,
|
|
PLUGIN_UI_SLOT_TYPES,
|
|
PLUGIN_UI_SLOT_ENTITY_TYPES,
|
|
PLUGIN_RESERVED_COMPANY_SETTINGS_ROUTE_SEGMENTS,
|
|
PLUGIN_STATE_SCOPE_KINDS,
|
|
PLUGIN_JOB_STATUSES,
|
|
PLUGIN_JOB_RUN_STATUSES,
|
|
PLUGIN_JOB_RUN_TRIGGERS,
|
|
PLUGIN_WEBHOOK_DELIVERY_STATUSES,
|
|
PLUGIN_EVENT_TYPES,
|
|
PLUGIN_BRIDGE_ERROR_CODES,
|
|
PERMISSION_KEYS,
|
|
HUMAN_COMPANY_MEMBERSHIP_ROLES,
|
|
HUMAN_COMPANY_MEMBERSHIP_ROLE_LABELS,
|
|
MEMBERSHIP_STATUSES,
|
|
PRINCIPAL_TYPES,
|
|
} from "@paperclipai/shared";
|
|
|
|
export { PluginEnvironmentCreationCleanupError, environmentCreationCleanupErrorData, readEnvironmentCreationCleanupError, readEnvironmentAcquisitionDiagnostic, ENVIRONMENT_ACQUISITION_PROVIDER_STATES } from "./environment-creation-cleanup.js";
|
|
export type { PluginEnvironmentCreationCleanup, PluginEnvironmentAcquisitionDiagnostic, PluginEnvironmentAcquisitionProviderState } from "./environment-creation-cleanup.js";
|
|
export { preserveEnvironmentSyncErrorDiagnostic, environmentSyncErrorData, readEnvironmentSyncErrorDiagnostic, withEnvironmentSyncErrorCapture, withEnvironmentSyncTransferStep, recordEnvironmentSyncError } from "./environment-sync-error.js";
|
|
export type { PluginEnvironmentSyncErrorDiagnostic } from "./environment-sync-error.js";
|
|
export { PluginEnvironmentRunnerIngressError, environmentRunnerIngressErrorData, readEnvironmentRunnerIngressFailure } from "./environment-runner-ingress-error.js";
|
|
export type { PluginEnvironmentRunnerIngressFailure } from "./environment-runner-ingress-error.js";
|
|
export { ENVIRONMENT_TASK_ERROR_CODES, PluginEnvironmentTaskError, environmentTaskErrorCodeData, readEnvironmentTaskErrorCode } from "./environment-task-error.js";
|
|
export type { PluginEnvironmentTaskErrorCode } from "./environment-task-error.js";
|
|
export { WORKSPACE_OPERATION_FAILURE_REASONS, PluginWorkspaceOperationError, workspaceOperationErrorData, readWorkspaceOperationFailureReason } from "./workspace-operation-error.js";
|
|
export type { PluginWorkspaceOperationFailureReason } from "./workspace-operation-error.js";
|
|
export { PluginEnvironmentStopError, environmentStopErrorData, readEnvironmentStopFailure } from "./environment-stop-error.js";
|
|
export type { PluginEnvironmentStopFailure, PluginEnvironmentStopFailureReason } from "./environment-stop-error.js";
|
|
export { environmentResumeErrorData, readEnvironmentResumeErrorDiagnostic } from "./environment-resume-error.js";
|
|
export type { PluginEnvironmentResumeErrorDiagnostic } from "./environment-resume-error.js";
|
|
export { environmentAcquireErrorData, readEnvironmentAcquireErrorDiagnostic } from "./environment-acquire-error.js";
|
|
export type { PluginEnvironmentAcquireErrorDiagnostic } from "./environment-acquire-error.js";
|
|
export { environmentTaskErrorData, readEnvironmentTaskErrorDiagnostic } from "./environment-task-error.js";
|
|
export type { PluginEnvironmentTaskErrorDiagnostic } from "./environment-task-error.js";
|
|
|
|
export type { AiConnectionPool, AiConnectionPoolConfig, AiConnectionPoolMember, AiConnectionRouterRequest, AiConnectionRouterResult, AiConnectionRouterSelection } from "@paperclipai/shared";
|
|
|
|
export { MAX_ENVIRONMENT_TASK_FILE_BYTES, environmentRunnerLaunchRequirementsSchema, environmentTaskOperationSchema, environmentTaskResultSchema, environmentTaskCredentialSchema, environmentTaskConfiguredEnvironmentSchema, MAX_CONFIGURED_ENVIRONMENT_KEYS, MAX_CONFIGURED_ENVIRONMENT_ENTRY_BYTES, MAX_CONFIGURED_ENVIRONMENT_BYTES, parseEnvironmentTaskResult } from "./environment-tasks.js";
|
|
export type { PluginEnvironmentTaskOperation, PluginEnvironmentTaskParams, PluginEnvironmentTaskResult, PluginEnvironmentTaskCredential, PluginEnvironmentTaskConfiguredEnvironment, PluginEnvironmentTaskExecutionContext } from "./environment-tasks.js";
|
|
export type { AgentLifecycleRequest, AgentLifecycleResult } from "@paperclipai/shared";
|
|
|
|
export type { PluginEnvironmentRunnerLaunchRequirements, PluginEnvironmentPreparedLaunch } from "./environment-tasks.js";
|
|
|
|
export * from "./workspace-provider.js";
|