@cotal-ai/connector-jcode 0.29.2 → 0.30.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/dist/extension.d.ts.map +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +1278 -761
- package/dist/index.js +19 -12
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +143 -132
- package/dist/private-lifecycle.d.ts +28 -0
- package/dist/private-lifecycle.d.ts.map +1 -0
- package/dist/retry-policy.d.ts +37 -0
- package/dist/retry-policy.d.ts.map +1 -0
- package/dist/startup-diagnostics.d.ts +15 -0
- package/dist/startup-diagnostics.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ProcessIdentity {
|
|
2
|
+
pid: number;
|
|
3
|
+
start: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function launchIdentityEnv(): {
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
/** Immutable identity of one process at capture time; throws when the platform cannot prove it. */
|
|
10
|
+
export declare function captureProcessIdentity(pid: number): ProcessIdentity;
|
|
11
|
+
/** Every PID this seat's private home records. The caller must still prove ownership. */
|
|
12
|
+
export declare function recordedTreePids(jcodeHome: string): number[];
|
|
13
|
+
export interface StopPrivateTreeOptions {
|
|
14
|
+
jcodeHome: string;
|
|
15
|
+
/** Immutable identity of the bridge child spawned by this launch. */
|
|
16
|
+
launch: ProcessIdentity;
|
|
17
|
+
/** Random launch-bound environment identity inherited only by this bridge tree. */
|
|
18
|
+
identityValue: string;
|
|
19
|
+
gracefulWaitMs?: number;
|
|
20
|
+
killWaitMs?: number;
|
|
21
|
+
/** Records must remain absent for this long after the bridge is gone (default 500ms). */
|
|
22
|
+
settleMs?: number;
|
|
23
|
+
}
|
|
24
|
+
/** SIGTERM the launch-owned tree, escalate survivors to SIGKILL, and only return once its records
|
|
25
|
+
* remain quiescent after the bridge is gone. A stale or reused registry PID is skipped, never
|
|
26
|
+
* signalled; an unprovable live process is not converted into ownership by location alone. */
|
|
27
|
+
export declare function stopPrivateTree(options: StopPrivateTreeOptions): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=private-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private-lifecycle.d.ts","sourceRoot":"","sources":["../src/private-lifecycle.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAiCD,wBAAgB,iBAAiB,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAElE;AAED,mGAAmG;AACnG,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAMnE;AAiDD,yFAAyF;AACzF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAqB5D;AA0DD,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,MAAM,EAAE,eAAe,CAAC;IACxB,mFAAmF;IACnF,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;8FAE8F;AAC9F,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuEpF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pacing for a failed turn.
|
|
3
|
+
*
|
|
4
|
+
* A jcode turn acks its batch only on success, so a failure leaves `pendingWake()` positive and the
|
|
5
|
+
* naive `finally` re-drive fires instantly with the SAME batch. One deterministic failure therefore
|
|
6
|
+
* became a hot loop that re-paid the full injection to the provider on every pass - measured at 62
|
|
7
|
+
* resends off a single stalled turn (#790). The codex host already solved this with an exponential
|
|
8
|
+
* `scheduleErrorRetry`; this is the same rule, extracted so it can be graded directly rather than
|
|
9
|
+
* only through a live seat.
|
|
10
|
+
*/
|
|
11
|
+
/** First delay after a failure. Short, because most failures are transient. */
|
|
12
|
+
export declare const ERROR_RETRY_INITIAL_MS = 1000;
|
|
13
|
+
/** Ceiling on the delay. Past this, waiting longer buys nothing. */
|
|
14
|
+
export declare const ERROR_RETRY_MAX_MS = 60000;
|
|
15
|
+
/** Consecutive failures after which the seat stops re-driving entirely. */
|
|
16
|
+
export declare const ERROR_RETRY_GIVE_UP = 8;
|
|
17
|
+
/** The next delay, doubling from `current` and clamped at the ceiling. */
|
|
18
|
+
export declare function nextRetryDelay(current: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Whether a failed turn should be retried at all.
|
|
21
|
+
*
|
|
22
|
+
* Refuses when shutting down (a retry would re-drive a batch into a child being torn down), when a
|
|
23
|
+
* timer is already pending (one in flight at a time, never a fan-out), when there is nothing left to
|
|
24
|
+
* retry, and once the consecutive-failure budget is spent - at which point the batch stays un-acked
|
|
25
|
+
* and redelivers rather than being burned against a provider that is not answering.
|
|
26
|
+
*/
|
|
27
|
+
export declare function shouldRetry(state: {
|
|
28
|
+
stopping: boolean;
|
|
29
|
+
timerPending: boolean;
|
|
30
|
+
consecutiveFailures: number;
|
|
31
|
+
pendingWake: number;
|
|
32
|
+
wakeQueued: boolean;
|
|
33
|
+
}): {
|
|
34
|
+
retry: boolean;
|
|
35
|
+
reason: "ok" | "stopping" | "timer-pending" | "nothing-pending" | "gave-up";
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=retry-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry-policy.d.ts","sourceRoot":"","sources":["../src/retry-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,OAAQ,CAAC;AAC5C,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,UAAU,GAAG,eAAe,GAAG,iBAAiB,GAAG,SAAS,CAAA;CAAE,CAMlG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** A bounded, connector-owned account of a provider refusal during the mandatory readiness turn.
|
|
2
|
+
* It deliberately contains only a provider error code and a model/effort value the connector could
|
|
3
|
+
* classify; the original Harness API message may include private configuration or child output. */
|
|
4
|
+
export declare class JcodeReadinessProviderRefusal extends Error {
|
|
5
|
+
readonly providerCode: string;
|
|
6
|
+
readonly parameter: "model" | "reasoning effort";
|
|
7
|
+
readonly value: string;
|
|
8
|
+
constructor(providerCode: string, parameter: "model" | "reasoning effort", value: string);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Classify only the Jcode SDK's invalid-request response and only when both fields are safely
|
|
12
|
+
* extractable. Everything else retains the existing scrubbed startup diagnostic.
|
|
13
|
+
*/
|
|
14
|
+
export declare function classifyReadinessProviderRefusal(error: unknown): JcodeReadinessProviderRefusal | undefined;
|
|
15
|
+
//# sourceMappingURL=startup-diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startup-diagnostics.d.ts","sourceRoot":"","sources":["../src/startup-diagnostics.ts"],"names":[],"mappings":"AAEA;;mGAEmG;AACnG,qBAAa,6BAA8B,SAAQ,KAAK;IAEpD,QAAQ,CAAC,YAAY,EAAE,MAAM;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,kBAAkB;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM;gBAFb,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,OAAO,GAAG,kBAAkB,EACvC,KAAK,EAAE,MAAM;CAIzB;AAuCD;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,GAAG,6BAA6B,GAAG,SAAS,CAM1G"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/connector-jcode",
|
|
3
3
|
"description": "Cotal connector for Jcode: a host-mode mesh peer driven through Jcode's Harness API bridge.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"esbuild": "^0.28.0",
|
|
29
29
|
"tsx": "^4.22.4",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@cotal-ai/core": "0.
|
|
32
|
-
"@cotal-ai/
|
|
33
|
-
"@cotal-ai/
|
|
31
|
+
"@cotal-ai/core": "0.30.1",
|
|
32
|
+
"@cotal-ai/smoke-kit": "0.0.0",
|
|
33
|
+
"@cotal-ai/connector-core": "0.30.1"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist"
|