@paperclipai/plugin-sdk 2026.1023.0 → 2026.1024.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -0
- package/dist/.paperclip-build-complete +1 -1
- package/dist/define-plugin.d.ts +22 -2
- package/dist/define-plugin.d.ts.map +1 -1
- package/dist/define-plugin.js.map +1 -1
- package/dist/environment-tasks.d.ts +359 -0
- package/dist/environment-tasks.d.ts.map +1 -0
- package/dist/environment-tasks.js +149 -0
- package/dist/environment-tasks.js.map +1 -0
- package/dist/host-client-factory.d.ts +3 -0
- package/dist/host-client-factory.d.ts.map +1 -1
- package/dist/host-client-factory.js +17 -0
- package/dist/host-client-factory.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts +47 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +4 -0
- package/dist/protocol.js.map +1 -1
- package/dist/testing.d.ts +43 -2
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +32 -0
- package/dist/testing.js.map +1 -1
- package/dist/types.d.ts +63 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/worker-rpc-host.d.ts.map +1 -1
- package/dist/worker-rpc-host.js +49 -35
- package/dist/worker-rpc-host.js.map +1 -1
- package/dist/workspace-provider.d.ts +234 -0
- package/dist/workspace-provider.d.ts.map +1 -0
- package/dist/workspace-provider.js +135 -0
- package/dist/workspace-provider.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1305,3 +1305,130 @@ An `appShellOverlay` slot uses `ui.action.register` and the standard
|
|
|
1305
1305
|
`PluginWidgetProps` context. It survives navigation and unmounts on account or
|
|
1306
1306
|
company changes, sign-out and onboarding. Plugins own panel accessibility and
|
|
1307
1307
|
request cleanup. See [the distribution and lifecycle contract](../../../doc/plugins/DISTRIBUTION-PLUGINS.md).
|
|
1308
|
+
|
|
1309
|
+
## Project storage and task workspaces
|
|
1310
|
+
|
|
1311
|
+
A storage provider declares `workspaceProvider: { modes: ["isolated_workspace"],
|
|
1312
|
+
strategies: ["git_worktree"] }`, `workspaces.manage`, and
|
|
1313
|
+
`resourceLifecycle: ["project"]` (with `events.subscribe`). The same plugin must
|
|
1314
|
+
implement `onResourceLifecycle` and `onWorkspaceOperation`. Project lifecycle
|
|
1315
|
+
creates and retains the storage; workspace operations manage task checkouts in
|
|
1316
|
+
that storage. Execution remains a separate environment driver contract.
|
|
1317
|
+
|
|
1318
|
+
Set `project.executionWorkspacePolicy.storageProviderPluginId` to an installed
|
|
1319
|
+
plugin's UUID for an explicit selection, or `null` for explicit Core/local storage.
|
|
1320
|
+
Omit the field to inherit the installed company-enabled default. A provider claims
|
|
1321
|
+
that default by declaring, for example:
|
|
1322
|
+
|
|
1323
|
+
```ts
|
|
1324
|
+
workspaceProvider: {
|
|
1325
|
+
modes: ["isolated_workspace", "operator_branch"],
|
|
1326
|
+
strategies: ["git_worktree"],
|
|
1327
|
+
defaultForProjects: { mode: "isolated_workspace", strategy: "git_worktree" },
|
|
1328
|
+
}
|
|
1329
|
+
```
|
|
1330
|
+
|
|
1331
|
+
The declared defaults must be supported by the provider. Core applies missing mode
|
|
1332
|
+
and strategy settings to Git projects, including existing unconfigured projects,
|
|
1333
|
+
without writing their policy. Explicit settings remain intact; incompatible
|
|
1334
|
+
settings fail with a configuration error. Multiple enabled default claims require
|
|
1335
|
+
an explicit project choice or disabling a conflicting provider. Worker health does
|
|
1336
|
+
not change the selected default: unavailable providers fail without local fallback.
|
|
1337
|
+
No company settings row means enabled, matching the normal plugin contract.
|
|
1338
|
+
|
|
1339
|
+
New and imported tasks leave an unspecified project mode inherited. Provider-owned
|
|
1340
|
+
workspaces retain explicit project and task strategies in shared and operator-branch
|
|
1341
|
+
modes. If neither supplies a strategy, those modes use `project_primary`; an agent's
|
|
1342
|
+
Git strategy remains a fallback only for isolated mode.
|
|
1343
|
+
|
|
1344
|
+
Project responses keep the stored `executionWorkspacePolicy` and expose the
|
|
1345
|
+
separate `workspaceProvider` configuration, including its source, effective policy,
|
|
1346
|
+
provider choices and configuration error. The project configuration UI supports
|
|
1347
|
+
inheritance, explicit plugins and Core/local storage. Conflicts remain readable so
|
|
1348
|
+
operators can resolve them through this flow.
|
|
1349
|
+
|
|
1350
|
+
Core reserves an execution-workspace row and binds the task before calling
|
|
1351
|
+
`onWorkspaceOperation`. Source-free task directories do not prepare project storage. The resolved provider
|
|
1352
|
+
choice, including Core/local, stays fixed through source resolution and preparation.
|
|
1353
|
+
Existing workspaces, including local workspaces, retain their original owner. Changing defaults never migrates, resets or recreates them;
|
|
1354
|
+
normal retirement and cleanup gates still apply on disable/uninstall.
|
|
1355
|
+
|
|
1356
|
+
The hook receives a company, project, source revision, execution-workspace ID,
|
|
1357
|
+
lifecycle generation, deadline, and stable operation ID. Run and agent IDs are
|
|
1358
|
+
optional context. A storage hook must work without an environment lease, a live
|
|
1359
|
+
agent, or a filesystem mount on Core. It must reconcile ambiguous retries before
|
|
1360
|
+
repeating side effects. Use the workspace ID and generation to fence provider
|
|
1361
|
+
operations; the operation ID identifies a retry of the same request.
|
|
1362
|
+
Fresh inspections get a new operation ID so provider result caches cannot reuse
|
|
1363
|
+
an earlier checkout status. Prepare and removal retries retain their IDs.
|
|
1364
|
+
|
|
1365
|
+
- `prepare` creates or restores the checkout. It returns an opaque, durable
|
|
1366
|
+
`WorkspaceProviderBinding`, a branch, and the starting commit. `branchMode:
|
|
1367
|
+
"existing"` must use an existing logical branch and must never reset its history.
|
|
1368
|
+
A provider may materialize a local ref from a confirmed existing remote branch. Retried preparation must keep
|
|
1369
|
+
local work. Providers may reject modes or strategies they do not support.
|
|
1370
|
+
- `inspect` reports tracked, untracked, and ignored/local-only changes, the
|
|
1371
|
+
current commit, merge state, and whether remote storage can recover it. Use
|
|
1372
|
+
`null` when a remote recovery or merge check is unknown.
|
|
1373
|
+
- `remove` checks the expected commit again and confirms removal. Busy, failed,
|
|
1374
|
+
unsafe, and uncertain removal must throw. Core requires a clean checkout and
|
|
1375
|
+
affirmative remote recovery or merge evidence before requesting removal.
|
|
1376
|
+
|
|
1377
|
+
References contain the installed plugin ID, project/source/workspace IDs, source
|
|
1378
|
+
revision, and opaque provider coordinates. They must not contain secrets. Core
|
|
1379
|
+
stores no local `cwd` for managed rows. `/workspaces/<id>` is a logical path in
|
|
1380
|
+
Core's existing run metadata; Core must not use it for filesystem access.
|
|
1381
|
+
|
|
1382
|
+
For the initial execution integration, select a task-capable environment driver
|
|
1383
|
+
from the same plugin. Core validates declared modes and strategies before it
|
|
1384
|
+
reserves a workspace. Core pins the binding on the environment lease and supplies
|
|
1385
|
+
it as `PluginEnvironmentTaskParams.workspace`. The execution hook resolves the
|
|
1386
|
+
provider reference to guest mounts and the actual working directory. Core rejects
|
|
1387
|
+
an execution driver from a different plugin. Native execution also requires the
|
|
1388
|
+
plugin Runner task bridge; Core refuses to fall back to a host Runner when that
|
|
1389
|
+
bridge is unavailable. This does not require merging the
|
|
1390
|
+
storage and execution interfaces.
|
|
1391
|
+
|
|
1392
|
+
Core's existing archive, reopen, and terminal cleanup fences also cover provider
|
|
1393
|
+
workspaces. The plugin must prevent project storage retirement while its task
|
|
1394
|
+
workspaces still contain local data. Repository source and storage owner changes
|
|
1395
|
+
are blocked while live managed workspaces depend on them. An authorized storage
|
|
1396
|
+
owner or source edit retires closed workspaces whose provider removal is confirmed;
|
|
1397
|
+
retired records cannot reopen. Inspection reconciles a pending restoration with
|
|
1398
|
+
its recorded request, advances its generation, and keeps the Core row closed.
|
|
1399
|
+
Cleanup must then inspect that generation afresh; it cannot reuse an earlier
|
|
1400
|
+
removal receipt. Direct removal refuses unresolved restoration intent.
|
|
1401
|
+
Core commits storage intent and recovery results with cleanup notifications so
|
|
1402
|
+
incremental terminal-workspace sweeps revisit changed records.
|
|
1403
|
+
Pending deletion is replayed before inspection, including after a lost removal
|
|
1404
|
+
result. File browsing and
|
|
1405
|
+
other Core-host filesystem operations are unavailable for managed storage.
|
|
1406
|
+
|
|
1407
|
+
Use `createWorkspaceProviderHarness` from `@paperclipai/plugin-sdk/testing` to
|
|
1408
|
+
validate hook inputs and outputs without allocating an execution environment.
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
### Private project instance credentials
|
|
1412
|
+
|
|
1413
|
+
Project lifecycle plugins can opt into `projects.instance-secrets` alongside
|
|
1414
|
+
`events.subscribe` and `resourceLifecycle: ["project"]`. Automatic project
|
|
1415
|
+
callbacks receive `event.instanceSecrets`; return an `instanceSecrets` patch
|
|
1416
|
+
with an acknowledged result. Core stores the patch in the existing native
|
|
1417
|
+
instance-secret system and acknowledges the event in one transaction. A null
|
|
1418
|
+
value removes a key. Retry and deferred results do not store patches.
|
|
1419
|
+
|
|
1420
|
+
Each company/project/installed-plugin owns its credentials. Up to 16 lowercase
|
|
1421
|
+
snake_case keys may change per result; nonempty string values are limited to
|
|
1422
|
+
128 KiB each. Core rejects replies if configuration, project sources, lifecycle
|
|
1423
|
+
state, or secret versions changed during the callback. A duplicate response to
|
|
1424
|
+
an acknowledged event cannot overwrite credentials. Deleted projects allow
|
|
1425
|
+
removal only; their secrets are also deleted by the native owner foreign key.
|
|
1426
|
+
|
|
1427
|
+
Trusted worker code can use
|
|
1428
|
+
`ctx.projects.getInstanceSecrets(projectId, companyId)` during a company-scoped
|
|
1429
|
+
invocation to read its credentials without an external service call. Archived
|
|
1430
|
+
or missing projects cannot be read this way. Values never appear in ordinary
|
|
1431
|
+
lifecycle inbox listings or the company secret catalog. Do not expose values
|
|
1432
|
+
through plugin entities, state, data handlers, UI, or logs. Agent instance
|
|
1433
|
+
secrets retain their existing lifecycle contract. Back up the tenant's existing
|
|
1434
|
+
local secrets master key together with its database.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"sources":"
|
|
1
|
+
{"sources":"b07c91b046158531ba50d83aeaa639b4bf476e79cd7d35bb72396c49db11afb1","outputs":"8c8aca4fb1b4fcbd082ca032684cb951df526cd966a3fc924e000da1d009d5ff"}
|
package/dist/define-plugin.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { PluginWorkspaceParams, PluginWorkspaceResult } from "./workspace-provider.js";
|
|
2
|
+
import type { PluginEnvironmentTaskParams, PluginEnvironmentTaskResult } from "./environment-tasks.js";
|
|
1
3
|
import type { AgentLifecycleRequest, AgentLifecycleResult } from "@paperclipai/shared";
|
|
2
4
|
import type { AiConnectionRouterRequest, AiConnectionRouterResult } from "@paperclipai/shared";
|
|
3
5
|
/**
|
|
@@ -50,8 +52,8 @@ import type { AiConnectionRouterRequest, AiConnectionRouterResult } from "@paper
|
|
|
50
52
|
* });
|
|
51
53
|
* ```
|
|
52
54
|
*/
|
|
53
|
-
import type { PluginContext } from "./types.js";
|
|
54
|
-
import type { PluginEnvironmentAcquireLeaseParams, PluginEnvironmentDestroyLeaseParams, PluginEnvironmentExecuteParams, PluginEnvironmentExecuteResult, PluginEnvironmentRunnerIngressEndpointParams, PluginEnvironmentRunnerIngressEndpoint, PluginEnvironmentSyncInParams, PluginEnvironmentSyncOutParams, PluginEnvironmentSyncResult, PluginEnvironmentStartInteractiveSetupParams, PluginEnvironmentInteractiveSetupSession, PluginEnvironmentGetInteractiveSetupParams, PluginEnvironmentCaptureTemplateParams, PluginEnvironmentCaptureTemplateResult, PluginEnvironmentCancelInteractiveSetupParams, PluginEnvironmentCancelInteractiveSetupResult, PluginEnvironmentDeleteTemplateParams, PluginEnvironmentDeleteTemplateResult, PluginEnvironmentLease, PluginEnvironmentProbeParams, PluginEnvironmentProbeResult, PluginEnvironmentRealizeWorkspaceParams, PluginEnvironmentRealizeWorkspaceResult, PluginEnvironmentReleaseLeaseParams, PluginEnvironmentTerminationReceipt, PluginEnvironmentResumeLeaseParams, PluginEnvironmentValidateConfigParams, PluginEnvironmentValidationResult, DetectExternalObjectsParams, DetectExternalObjectsResult, ResolveExternalObjectParams, PluginExternalObjectResolveResult, RefreshExternalObjectsParams, RefreshExternalObjectsResult, PluginLoginPtyOpenParams, PluginLoginPtyOpenResult, PluginLoginPtyInputParams, PluginLoginPtyStopParams, PluginLoginPtyCloseParams, PluginLoginPtyCloseResult, PluginDuplexChannelOpenParams, PluginDuplexChannelOpenResult, PluginDuplexChannelWriteParams, PluginDuplexChannelStopParams, PluginDuplexChannelCloseParams, PluginDuplexChannelCloseResult } from "./protocol.js";
|
|
55
|
+
import type { PluginContext, ResourceLifecycleEvent, ResourceLifecycleResult } from "./types.js";
|
|
56
|
+
import type { PluginEnvironmentAcquireLeaseParams, PluginEnvironmentDestroyLeaseParams, PluginEnvironmentInspectLeaseParams, PluginEnvironmentLeaseObservation, PluginEnvironmentExecuteParams, PluginEnvironmentExecuteResult, PluginEnvironmentRunnerIngressEndpointParams, PluginEnvironmentRunnerIngressEndpoint, PluginEnvironmentSyncInParams, PluginEnvironmentSyncOutParams, PluginEnvironmentSyncResult, PluginEnvironmentStartInteractiveSetupParams, PluginEnvironmentInteractiveSetupSession, PluginEnvironmentGetInteractiveSetupParams, PluginEnvironmentCaptureTemplateParams, PluginEnvironmentCaptureTemplateResult, PluginEnvironmentCancelInteractiveSetupParams, PluginEnvironmentCancelInteractiveSetupResult, PluginEnvironmentDeleteTemplateParams, PluginEnvironmentDeleteTemplateResult, PluginEnvironmentLease, PluginEnvironmentProbeParams, PluginEnvironmentProbeResult, PluginEnvironmentRealizeWorkspaceParams, PluginEnvironmentRealizeWorkspaceResult, PluginEnvironmentReleaseLeaseParams, PluginEnvironmentTerminationReceipt, PluginEnvironmentResumeLeaseParams, PluginEnvironmentValidateConfigParams, PluginEnvironmentValidationResult, DetectExternalObjectsParams, DetectExternalObjectsResult, ResolveExternalObjectParams, PluginExternalObjectResolveResult, RefreshExternalObjectsParams, RefreshExternalObjectsResult, PluginLoginPtyOpenParams, PluginLoginPtyOpenResult, PluginLoginPtyInputParams, PluginLoginPtyStopParams, PluginLoginPtyCloseParams, PluginLoginPtyCloseResult, PluginDuplexChannelOpenParams, PluginDuplexChannelOpenResult, PluginDuplexChannelWriteParams, PluginDuplexChannelStopParams, PluginDuplexChannelCloseParams, PluginDuplexChannelCloseResult } from "./protocol.js";
|
|
55
57
|
/**
|
|
56
58
|
* Optional plugin-reported diagnostics returned from the `health()` RPC method.
|
|
57
59
|
*
|
|
@@ -113,6 +115,11 @@ export interface PluginApiRequestInput {
|
|
|
113
115
|
headers: Record<string, string>;
|
|
114
116
|
}
|
|
115
117
|
export interface PluginApiResponse {
|
|
118
|
+
/** Server-only upstream for a declared WebSocket route. Never returned as JSON. */
|
|
119
|
+
websocket?: {
|
|
120
|
+
url: string;
|
|
121
|
+
headers?: Record<string, string>;
|
|
122
|
+
};
|
|
116
123
|
status?: number;
|
|
117
124
|
headers?: Record<string, string>;
|
|
118
125
|
body?: unknown;
|
|
@@ -269,6 +276,13 @@ export interface PluginDefinition {
|
|
|
269
276
|
* Calls can repeat. Fence older versions and make external effects idempotent.
|
|
270
277
|
*/
|
|
271
278
|
onAgentLifecycle?(params: AgentLifecycleRequest): Promise<AgentLifecycleResult>;
|
|
279
|
+
/**
|
|
280
|
+
* Reconcile a committed resource event. Requires manifest resourceLifecycle and events.subscribe.
|
|
281
|
+
* The host acknowledges successful results and replays interrupted/unfinished work.
|
|
282
|
+
* Calls are at least once, in order per resource. Re-read current state and use
|
|
283
|
+
* idempotent external operations; deletion events remain available after the row is gone.
|
|
284
|
+
*/
|
|
285
|
+
onResourceLifecycle?(event: ResourceLifecycleEvent): Promise<ResourceLifecycleResult>;
|
|
272
286
|
/** Propose a member from host-authorized candidates. Requires ai.connections.route. */
|
|
273
287
|
onRouteAiConnection?(params: AiConnectionRouterRequest): Promise<AiConnectionRouterResult>;
|
|
274
288
|
/**
|
|
@@ -290,6 +304,10 @@ export interface PluginDefinition {
|
|
|
290
304
|
* environment driver.
|
|
291
305
|
*/
|
|
292
306
|
onEnvironmentValidateConfig?(params: PluginEnvironmentValidateConfigParams): Promise<PluginEnvironmentValidationResult>;
|
|
307
|
+
/** Required with manifest.workspaceProvider, together with project resource lifecycle. */
|
|
308
|
+
onWorkspaceOperation?(params: PluginWorkspaceParams): Promise<PluginWorkspaceResult>;
|
|
309
|
+
/** Provide Runner execution: prepare resources, start Runner, connect via PRP, and manage task lifecycle. */
|
|
310
|
+
onEnvironmentTask?(params: PluginEnvironmentTaskParams): Promise<PluginEnvironmentTaskResult>;
|
|
293
311
|
/** Called to test reachability or readiness of a plugin-hosted environment. */
|
|
294
312
|
onEnvironmentProbe?(params: PluginEnvironmentProbeParams): Promise<PluginEnvironmentProbeResult>;
|
|
295
313
|
/** Called before a run starts to acquire a provider lease. */
|
|
@@ -304,6 +322,8 @@ export interface PluginDefinition {
|
|
|
304
322
|
onEnvironmentStopLease?(params: PluginEnvironmentReleaseLeaseParams): Promise<PluginEnvironmentTerminationReceipt>;
|
|
305
323
|
/** Called when the host needs to force-destroy provider state. */
|
|
306
324
|
onEnvironmentDestroyLease?(params: PluginEnvironmentDestroyLeaseParams): Promise<PluginEnvironmentTerminationReceipt | void>;
|
|
325
|
+
/** Read provider state only. This must not start or reconnect a sandbox. */
|
|
326
|
+
onEnvironmentInspectLease?(params: PluginEnvironmentInspectLeaseParams): Promise<PluginEnvironmentLeaseObservation>;
|
|
307
327
|
/** Called to materialize the run workspace inside the provider lease. */
|
|
308
328
|
onEnvironmentRealizeWorkspace?(params: PluginEnvironmentRealizeWorkspaceParams): Promise<PluginEnvironmentRealizeWorkspaceResult>;
|
|
309
329
|
/** Called to execute a command inside the provider lease. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-plugin.d.ts","sourceRoot":"","sources":["../src/define-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/F;;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,CAAC,6BAA6B,CAAC,CAAC;IAE1C,mGAAmG;IACnG,oBAAoB,CAAC,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E,2FAA2F;IAC3F,mBAAmB,CAAC,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E;;;;OAIG;IACH,oBAAoB,CAAC,CACnB,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC5C;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;CACvC;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,gBAAgB,GAAG,eAAe,CAE1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-plugin.js","sourceRoot":"","sources":["../src/define-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"define-plugin.js","sourceRoot":"","sources":["../src/define-plugin.ts"],"names":[],"mappings":"AAwkBA,8EAA8E;AAC9E,mCAAmC;AACnC,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,YAAY,CAAC,UAA4B;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PluginEnvironmentDriverBaseParams, PluginEnvironmentLease } from "./protocol.js";
|
|
3
|
+
export declare const MAX_ENVIRONMENT_TASK_FILE_BYTES: number;
|
|
4
|
+
/** Only provider authentication is transferred. Paths and executable settings remain provider-owned. */
|
|
5
|
+
export declare const environmentTaskCredentialSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"codex-auth-json">;
|
|
7
|
+
authJson: z.ZodString;
|
|
8
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"claude-env">;
|
|
10
|
+
environment: z.ZodObject<{
|
|
11
|
+
CLAUDE_CODE_OAUTH_TOKEN: z.ZodOptional<z.ZodString>;
|
|
12
|
+
ANTHROPIC_API_KEY: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
}, z.core.$strict>], "type">;
|
|
15
|
+
export type PluginEnvironmentTaskCredential = z.infer<typeof environmentTaskCredentialSchema>;
|
|
16
|
+
/** Runner owns this versioned data contract. The plugin resolves its execution-host locations. */
|
|
17
|
+
export declare const environmentRunnerLaunchRequirementsSchema: z.ZodObject<{
|
|
18
|
+
schema: z.ZodLiteral<"paperclip.runner.launch-requirements.v1">;
|
|
19
|
+
identity: z.ZodObject<{
|
|
20
|
+
runnerInstanceId: z.ZodString;
|
|
21
|
+
environmentLeaseId: z.ZodString;
|
|
22
|
+
runId: z.ZodString;
|
|
23
|
+
normalizedSessionId: z.ZodString;
|
|
24
|
+
turnId: z.ZodString;
|
|
25
|
+
itemId: z.ZodString;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
provider: z.ZodEnum<{
|
|
28
|
+
acpx: "acpx";
|
|
29
|
+
aws_agentcore: "aws_agentcore";
|
|
30
|
+
claude_managed: "claude_managed";
|
|
31
|
+
codex: "codex";
|
|
32
|
+
opencode: "opencode";
|
|
33
|
+
}>;
|
|
34
|
+
model: z.ZodNullable<z.ZodString>;
|
|
35
|
+
instructions: z.ZodString;
|
|
36
|
+
runtimeContext: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
37
|
+
settings: z.ZodObject<{
|
|
38
|
+
acpxAgent: z.ZodOptional<z.ZodString>;
|
|
39
|
+
acpxMode: z.ZodOptional<z.ZodString>;
|
|
40
|
+
acpxPermissionMode: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
"approve-all": "approve-all";
|
|
42
|
+
"approve-paperclip": "approve-paperclip";
|
|
43
|
+
"approve-reads": "approve-reads";
|
|
44
|
+
"deny-all": "deny-all";
|
|
45
|
+
}>>;
|
|
46
|
+
acpxPermissionModePinned: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
piThinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
high: "high";
|
|
49
|
+
low: "low";
|
|
50
|
+
max: "max";
|
|
51
|
+
off: "off";
|
|
52
|
+
}>>;
|
|
53
|
+
claudeEffort: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
high: "high";
|
|
55
|
+
low: "low";
|
|
56
|
+
max: "max";
|
|
57
|
+
medium: "medium";
|
|
58
|
+
xhigh: "xhigh";
|
|
59
|
+
}>>;
|
|
60
|
+
opencodePermissionMode: z.ZodOptional<z.ZodEnum<{
|
|
61
|
+
allow: "allow";
|
|
62
|
+
ask: "ask";
|
|
63
|
+
deny: "deny";
|
|
64
|
+
}>>;
|
|
65
|
+
managedProfile: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
66
|
+
agentCoreProfile: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
approvalPolicy: z.ZodEnum<{
|
|
69
|
+
never: "never";
|
|
70
|
+
"on-request": "on-request";
|
|
71
|
+
untrusted: "untrusted";
|
|
72
|
+
}>;
|
|
73
|
+
readOnly: z.ZodBoolean;
|
|
74
|
+
preparedConversation: z.ZodBoolean;
|
|
75
|
+
includeCollaborationModeInstructions: z.ZodBoolean;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
declare const preparedLaunch: z.ZodObject<{
|
|
78
|
+
configurationId: z.ZodString;
|
|
79
|
+
requirementsDigest: z.ZodString;
|
|
80
|
+
provider: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
/** One plugin-provided Runner execution attempt with a PRP connection. Secrets are transient RPC input. */
|
|
83
|
+
export declare const environmentTaskOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
84
|
+
kind: z.ZodLiteral<"describe">;
|
|
85
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
86
|
+
kind: z.ZodLiteral<"copilot_metadata">;
|
|
87
|
+
token: z.ZodString;
|
|
88
|
+
model: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"prepare">;
|
|
91
|
+
requirements: z.ZodObject<{
|
|
92
|
+
schema: z.ZodLiteral<"paperclip.runner.launch-requirements.v1">;
|
|
93
|
+
identity: z.ZodObject<{
|
|
94
|
+
runnerInstanceId: z.ZodString;
|
|
95
|
+
environmentLeaseId: z.ZodString;
|
|
96
|
+
runId: z.ZodString;
|
|
97
|
+
normalizedSessionId: z.ZodString;
|
|
98
|
+
turnId: z.ZodString;
|
|
99
|
+
itemId: z.ZodString;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
provider: z.ZodEnum<{
|
|
102
|
+
acpx: "acpx";
|
|
103
|
+
aws_agentcore: "aws_agentcore";
|
|
104
|
+
claude_managed: "claude_managed";
|
|
105
|
+
codex: "codex";
|
|
106
|
+
opencode: "opencode";
|
|
107
|
+
}>;
|
|
108
|
+
model: z.ZodNullable<z.ZodString>;
|
|
109
|
+
instructions: z.ZodString;
|
|
110
|
+
runtimeContext: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
111
|
+
settings: z.ZodObject<{
|
|
112
|
+
acpxAgent: z.ZodOptional<z.ZodString>;
|
|
113
|
+
acpxMode: z.ZodOptional<z.ZodString>;
|
|
114
|
+
acpxPermissionMode: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
"approve-all": "approve-all";
|
|
116
|
+
"approve-paperclip": "approve-paperclip";
|
|
117
|
+
"approve-reads": "approve-reads";
|
|
118
|
+
"deny-all": "deny-all";
|
|
119
|
+
}>>;
|
|
120
|
+
acpxPermissionModePinned: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
+
piThinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
122
|
+
high: "high";
|
|
123
|
+
low: "low";
|
|
124
|
+
max: "max";
|
|
125
|
+
off: "off";
|
|
126
|
+
}>>;
|
|
127
|
+
claudeEffort: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
high: "high";
|
|
129
|
+
low: "low";
|
|
130
|
+
max: "max";
|
|
131
|
+
medium: "medium";
|
|
132
|
+
xhigh: "xhigh";
|
|
133
|
+
}>>;
|
|
134
|
+
opencodePermissionMode: z.ZodOptional<z.ZodEnum<{
|
|
135
|
+
allow: "allow";
|
|
136
|
+
ask: "ask";
|
|
137
|
+
deny: "deny";
|
|
138
|
+
}>>;
|
|
139
|
+
managedProfile: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
140
|
+
agentCoreProfile: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
approvalPolicy: z.ZodEnum<{
|
|
143
|
+
never: "never";
|
|
144
|
+
"on-request": "on-request";
|
|
145
|
+
untrusted: "untrusted";
|
|
146
|
+
}>;
|
|
147
|
+
readOnly: z.ZodBoolean;
|
|
148
|
+
preparedConversation: z.ZodBoolean;
|
|
149
|
+
includeCollaborationModeInstructions: z.ZodBoolean;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
recovery: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
configurationId: z.ZodString;
|
|
153
|
+
requirementsDigest: z.ZodString;
|
|
154
|
+
provider: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
155
|
+
}, z.core.$strict>>;
|
|
156
|
+
resumeFrom: z.ZodOptional<z.ZodString>;
|
|
157
|
+
projectIds: z.ZodArray<z.ZodString>;
|
|
158
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
159
|
+
kind: z.ZodLiteral<"submit">;
|
|
160
|
+
projectIds: z.ZodArray<z.ZodString>;
|
|
161
|
+
runner: z.ZodObject<{
|
|
162
|
+
protocolMin: z.ZodNumber;
|
|
163
|
+
protocolMax: z.ZodNumber;
|
|
164
|
+
harness: z.ZodString;
|
|
165
|
+
runnerId: z.ZodString;
|
|
166
|
+
leaseId: z.ZodString;
|
|
167
|
+
runId: z.ZodString;
|
|
168
|
+
sessionId: z.ZodString;
|
|
169
|
+
turnId: z.ZodString;
|
|
170
|
+
itemId: z.ZodString;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
bootstrapTicket: z.ZodString;
|
|
173
|
+
resumeFrom: z.ZodOptional<z.ZodString>;
|
|
174
|
+
preparedLaunchId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
credentialIdentity: z.ZodOptional<z.ZodString>;
|
|
176
|
+
accountIdentity: z.ZodOptional<z.ZodString>;
|
|
177
|
+
credential: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
178
|
+
type: z.ZodLiteral<"codex-auth-json">;
|
|
179
|
+
authJson: z.ZodString;
|
|
180
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
181
|
+
type: z.ZodLiteral<"claude-env">;
|
|
182
|
+
environment: z.ZodObject<{
|
|
183
|
+
CLAUDE_CODE_OAUTH_TOKEN: z.ZodOptional<z.ZodString>;
|
|
184
|
+
ANTHROPIC_API_KEY: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strict>;
|
|
186
|
+
}, z.core.$strict>], "type">>;
|
|
187
|
+
launch: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
runnerVersion: z.ZodString;
|
|
189
|
+
runnerDigest: z.ZodString;
|
|
190
|
+
maxOutboxBytes: z.ZodNumber;
|
|
191
|
+
p0ReserveBytes: z.ZodNumber;
|
|
192
|
+
maxRuntimeMs: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
maxLifetimeMs: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
reconnectGraceMs: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
lifecyclePolicy: z.ZodObject<{
|
|
196
|
+
mode: z.ZodLiteral<"per_turn">;
|
|
197
|
+
idleTimeoutMs: z.ZodNull;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
}, z.core.$strict>>;
|
|
200
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
201
|
+
kind: z.ZodLiteral<"check_project_auth">;
|
|
202
|
+
configurationId: z.ZodString;
|
|
203
|
+
provider: z.ZodString;
|
|
204
|
+
projectIds: z.ZodArray<z.ZodString>;
|
|
205
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
206
|
+
kind: z.ZodLiteral<"read_file">;
|
|
207
|
+
identity: z.ZodObject<{
|
|
208
|
+
runnerInstanceId: z.ZodString;
|
|
209
|
+
environmentLeaseId: z.ZodString;
|
|
210
|
+
runId: z.ZodString;
|
|
211
|
+
normalizedSessionId: z.ZodString;
|
|
212
|
+
turnId: z.ZodString;
|
|
213
|
+
itemId: z.ZodString;
|
|
214
|
+
}, z.core.$strict>;
|
|
215
|
+
path: z.ZodString;
|
|
216
|
+
maxBytes: z.ZodNumber;
|
|
217
|
+
projectIds: z.ZodArray<z.ZodString>;
|
|
218
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
219
|
+
kind: z.ZodLiteral<"read_state">;
|
|
220
|
+
identity: z.ZodObject<{
|
|
221
|
+
runnerInstanceId: z.ZodString;
|
|
222
|
+
environmentLeaseId: z.ZodString;
|
|
223
|
+
runId: z.ZodString;
|
|
224
|
+
normalizedSessionId: z.ZodString;
|
|
225
|
+
turnId: z.ZodString;
|
|
226
|
+
itemId: z.ZodString;
|
|
227
|
+
}, z.core.$strict>;
|
|
228
|
+
resumeFrom: z.ZodOptional<z.ZodString>;
|
|
229
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
230
|
+
kind: z.ZodLiteral<"archive_state">;
|
|
231
|
+
priorIdentity: z.ZodObject<{
|
|
232
|
+
runnerInstanceId: z.ZodString;
|
|
233
|
+
environmentLeaseId: z.ZodString;
|
|
234
|
+
runId: z.ZodString;
|
|
235
|
+
normalizedSessionId: z.ZodString;
|
|
236
|
+
turnId: z.ZodString;
|
|
237
|
+
itemId: z.ZodString;
|
|
238
|
+
}, z.core.$strict>;
|
|
239
|
+
archiveKey: z.ZodString;
|
|
240
|
+
resumeFrom: z.ZodString;
|
|
241
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
242
|
+
kind: z.ZodLiteral<"credentials">;
|
|
243
|
+
accountIdentity: z.ZodString;
|
|
244
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
245
|
+
kind: z.ZodLiteral<"status">;
|
|
246
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
247
|
+
kind: z.ZodLiteral<"connection">;
|
|
248
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
249
|
+
kind: z.ZodLiteral<"complete">;
|
|
250
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
251
|
+
kind: z.ZodLiteral<"stop">;
|
|
252
|
+
}, z.core.$strict>], "kind">;
|
|
253
|
+
export declare const environmentTaskResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
254
|
+
kind: z.ZodLiteral<"accepted">;
|
|
255
|
+
taskId: z.ZodString;
|
|
256
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
257
|
+
kind: z.ZodLiteral<"copilot_metadata">;
|
|
258
|
+
taskId: z.ZodString;
|
|
259
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
260
|
+
executionStopped: z.ZodLiteral<true>;
|
|
261
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
262
|
+
kind: z.ZodLiteral<"project_auth">;
|
|
263
|
+
taskId: z.ZodString;
|
|
264
|
+
configurationId: z.ZodString;
|
|
265
|
+
provider: z.ZodString;
|
|
266
|
+
allowed: z.ZodBoolean;
|
|
267
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
268
|
+
kind: z.ZodLiteral<"file">;
|
|
269
|
+
taskId: z.ZodString;
|
|
270
|
+
base64: z.ZodString;
|
|
271
|
+
byteSize: z.ZodNumber;
|
|
272
|
+
sha256: z.ZodString;
|
|
273
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
274
|
+
kind: z.ZodLiteral<"state">;
|
|
275
|
+
taskId: z.ZodString;
|
|
276
|
+
state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
277
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
278
|
+
kind: z.ZodLiteral<"prepared">;
|
|
279
|
+
taskId: z.ZodString;
|
|
280
|
+
launch: z.ZodObject<{
|
|
281
|
+
configurationId: z.ZodString;
|
|
282
|
+
requirementsDigest: z.ZodString;
|
|
283
|
+
provider: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
projectAuthCheckAtSubmit: z.ZodOptional<z.ZodLiteral<true>>;
|
|
286
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
287
|
+
kind: z.ZodLiteral<"credentials">;
|
|
288
|
+
taskId: z.ZodString;
|
|
289
|
+
credential: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
290
|
+
type: z.ZodLiteral<"codex-auth-json">;
|
|
291
|
+
authJson: z.ZodString;
|
|
292
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
293
|
+
type: z.ZodLiteral<"claude-env">;
|
|
294
|
+
environment: z.ZodObject<{
|
|
295
|
+
CLAUDE_CODE_OAUTH_TOKEN: z.ZodOptional<z.ZodString>;
|
|
296
|
+
ANTHROPIC_API_KEY: z.ZodOptional<z.ZodString>;
|
|
297
|
+
}, z.core.$strict>;
|
|
298
|
+
}, z.core.$strict>], "type">>;
|
|
299
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
300
|
+
kind: z.ZodLiteral<"description">;
|
|
301
|
+
taskId: z.ZodString;
|
|
302
|
+
runner: z.ZodObject<{
|
|
303
|
+
version: z.ZodString;
|
|
304
|
+
digest: z.ZodString;
|
|
305
|
+
}, z.core.$strict>;
|
|
306
|
+
launchPreparationVersion: z.ZodOptional<z.ZodLiteral<1>>;
|
|
307
|
+
freshWorkspaceVersion: z.ZodOptional<z.ZodLiteral<1>>;
|
|
308
|
+
projectAuthCheckVersion: z.ZodOptional<z.ZodLiteral<1>>;
|
|
309
|
+
workspaceFileReadVersion: z.ZodOptional<z.ZodLiteral<1>>;
|
|
310
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
311
|
+
kind: z.ZodLiteral<"status">;
|
|
312
|
+
taskId: z.ZodString;
|
|
313
|
+
phase: z.ZodEnum<{
|
|
314
|
+
cancelled: "cancelled";
|
|
315
|
+
completed: "completed";
|
|
316
|
+
failed: "failed";
|
|
317
|
+
interrupted: "interrupted";
|
|
318
|
+
preparing: "preparing";
|
|
319
|
+
running: "running";
|
|
320
|
+
}>;
|
|
321
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
322
|
+
executionStopped: z.ZodOptional<z.ZodBoolean>;
|
|
323
|
+
sessionStateAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
324
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
325
|
+
kind: z.ZodLiteral<"connection">;
|
|
326
|
+
taskId: z.ZodString;
|
|
327
|
+
endpoint: z.ZodObject<{
|
|
328
|
+
kind: z.ZodLiteral<"authenticated_websocket">;
|
|
329
|
+
websocketUrl: z.ZodString;
|
|
330
|
+
generation: z.ZodString;
|
|
331
|
+
secretHeaders: z.ZodArray<z.ZodObject<{
|
|
332
|
+
name: z.ZodString;
|
|
333
|
+
value: z.ZodString;
|
|
334
|
+
}, z.core.$strict>>;
|
|
335
|
+
}, z.core.$strict>;
|
|
336
|
+
}, z.core.$strict>], "kind">;
|
|
337
|
+
export type PluginEnvironmentRunnerLaunchRequirements = z.infer<typeof environmentRunnerLaunchRequirementsSchema>;
|
|
338
|
+
export type PluginEnvironmentPreparedLaunch = z.infer<typeof preparedLaunch>;
|
|
339
|
+
export type PluginEnvironmentTaskOperation = z.infer<typeof environmentTaskOperationSchema>;
|
|
340
|
+
export type PluginEnvironmentTaskResult = z.infer<typeof environmentTaskResultSchema>;
|
|
341
|
+
export interface PluginEnvironmentTaskParams extends Omit<PluginEnvironmentDriverBaseParams, "environmentId"> {
|
|
342
|
+
/** Null during cleanup after the environment is deleted. */
|
|
343
|
+
environmentId: string | null;
|
|
344
|
+
lease: PluginEnvironmentLease;
|
|
345
|
+
/** Provider-issued task identifier persisted in the lease, stable across ambiguous submission retries. */
|
|
346
|
+
taskId: string;
|
|
347
|
+
/** Null during cleanup after the associated run is deleted. */
|
|
348
|
+
runId: string | null;
|
|
349
|
+
agentId: string | null;
|
|
350
|
+
/** Company-validated projects to prepare on submit; empty during cleanup. */
|
|
351
|
+
projectIds: string[];
|
|
352
|
+
workspace?: import("@paperclipai/shared").WorkspaceProviderBinding;
|
|
353
|
+
fresh?: import("./workspace-provider.js").PluginFreshWorkspace;
|
|
354
|
+
operation: PluginEnvironmentTaskOperation;
|
|
355
|
+
}
|
|
356
|
+
/** An accepted stop is not proof of process termination. */
|
|
357
|
+
export declare function parseEnvironmentTaskResult(operation: PluginEnvironmentTaskOperation, taskId: string, value: unknown): PluginEnvironmentTaskResult;
|
|
358
|
+
export {};
|
|
359
|
+
//# sourceMappingURL=environment-tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-tasks.d.ts","sourceRoot":"","sources":["../src/environment-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iCAAiC,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE/F,eAAO,MAAM,+BAA+B,QAAmB,CAAC;AAiBhE,wGAAwG;AACxG,eAAO,MAAM,+BAA+B;;;;;;;;;4BAK1C,CAAC;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