@cotal-ai/connector-jcode 0.39.0 → 0.40.0
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/host.d.ts.map +1 -1
- package/dist/host.js +74 -17
- package/dist/index.js +4 -4
- package/dist/mcp.js +4 -4
- package/dist/private-lifecycle.d.ts +38 -0
- package/dist/private-lifecycle.d.ts.map +1 -1
- package/dist/private-state.d.ts.map +1 -1
- package/dist/startup-diagnostics.d.ts +1 -1
- package/dist/startup-diagnostics.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -15,6 +15,44 @@ interface ProcessIdentityProbe {
|
|
|
15
15
|
export declare const processHasLaunchIdentityForTest: (pid: number, identityValue: string, probe: ProcessIdentityProbe) => boolean;
|
|
16
16
|
/** Every PID this seat's private home records. The caller must still prove ownership. */
|
|
17
17
|
export declare function recordedTreePids(jcodeHome: string): number[];
|
|
18
|
+
export interface LaunchRecord {
|
|
19
|
+
/** The launch-bound environment identity only this launch's Jcode descendants carry. */
|
|
20
|
+
identity: string;
|
|
21
|
+
/** Immutable identity of the connector host that owns those descendants. */
|
|
22
|
+
host: ProcessIdentity;
|
|
23
|
+
}
|
|
24
|
+
/** Name this launch's tree in the seat home, so the seat's NEXT launch can tell a tree an already
|
|
25
|
+
* dead lifecycle left behind from one a live seat still legitimately holds. */
|
|
26
|
+
export declare function recordLaunch(home: string, record: LaunchRecord): void;
|
|
27
|
+
export declare function readLaunchRecord(home: string): LaunchRecord | undefined;
|
|
28
|
+
export interface StopOrphanedTreeOptions {
|
|
29
|
+
home: string;
|
|
30
|
+
gracefulWaitMs?: number;
|
|
31
|
+
killWaitMs?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Stop the Jcode tree a previous lifecycle of this seat home left running, and return its PIDs.
|
|
35
|
+
*
|
|
36
|
+
* A seat that dies without its connector's teardown — a manager restart, a SIGKILL past the grace
|
|
37
|
+
* window — leaves its Jcode server alive. The server setsids into a group of its own and carries no
|
|
38
|
+
* `COTAL_NAME`, so neither the manager's signal nor a name-keyed reap reaches it, and it holds the
|
|
39
|
+
* seat home's runtime dir until its own five-minute idle timer (#1211).
|
|
40
|
+
*
|
|
41
|
+
* The recorded host PID is what keeps this from stopping a seat that is still serving, and it only
|
|
42
|
+
* releases the nonce once that host is provably GONE. A PID that is still alive at the recorded
|
|
43
|
+
* slot is ambiguous: it is either the connector that owns this home, or an unrelated process that
|
|
44
|
+
* reused the number, and nothing on a live PID distinguishes them reliably. This mechanism's whole
|
|
45
|
+
* claim is that it never signals a live seat's tree, so the ambiguous case resolves toward doing
|
|
46
|
+
* nothing. Pairing liveness with the captured start token instead would resolve it toward killing:
|
|
47
|
+
* a live host whose recorded token does not match would have its tree signalled while the host
|
|
48
|
+
* itself was left running, which is the two-seats-under-one-name failure this exists to avoid.
|
|
49
|
+
*
|
|
50
|
+
* The conservative branch costs one missed reap, after which Jcode's own runtime-dir lock gives its
|
|
51
|
+
* honest refusal and the next launch tries again. The permissive branch costs a seat that is still
|
|
52
|
+
* serving. Only a PID that is gone releases the record's launch nonce, and one nonce is inherited
|
|
53
|
+
* by one launch's descendants alone.
|
|
54
|
+
*/
|
|
55
|
+
export declare function stopOrphanedTree(options: StopOrphanedTreeOptions): Promise<number[]>;
|
|
18
56
|
export interface StopPrivateTreeOptions {
|
|
19
57
|
jcodeHome: string;
|
|
20
58
|
/** Immutable identity of the bridge child spawned by this launch. */
|
|
@@ -1 +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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AAG,IAAI,CAIxF;AAED,MAAM,WAAW,eAAe;IAC9B,gHAAgH;IAChH,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,IAAI,IAAI,CAAC;CACjB;AAwBD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CA+B7D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type JcodeConnectorFailureCode = "model_prefix_rejected" | "model_refused" | "model_mismatch";
|
|
1
|
+
export type JcodeConnectorFailureCode = "model_prefix_rejected" | "model_refused" | "model_mismatch" | "private_state";
|
|
2
2
|
/** A bounded connector-owned startup refusal. Only its allow-listed code is rendered publicly. */
|
|
3
3
|
export declare class JcodeConnectorError extends Error {
|
|
4
4
|
readonly code: JcodeConnectorFailureCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-diagnostics.d.ts","sourceRoot":"","sources":["../src/startup-diagnostics.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,yBAAyB,GAAG,uBAAuB,GAAG,eAAe,GAAG,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"startup-diagnostics.d.ts","sourceRoot":"","sources":["../src/startup-diagnostics.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,yBAAyB,GAAG,uBAAuB,GAAG,eAAe,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEvH,kGAAkG;AAClG,qBAAa,mBAAoB,SAAQ,KAAK;IAChC,QAAQ,CAAC,IAAI,EAAE,yBAAyB;gBAA/B,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAG9F;AAID,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoB9D;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAG1D;AAED;;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;AAED;;4CAE4C;AAC5C,qBAAa,kBAAmB,SAAQ,KAAK;IAIzC,QAAQ,CAAC,aAAa,EAAE,MAAM;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC/B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE;IAL5C,QAAQ,CAAC,YAAY,qBAAqB;gBAG/B,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,SAAS,MAAM,EAAE;CAI7C;AAsDD;wFACwF;AACxF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,kBAAkB,CAEpH;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAErG;AAED;;;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.40.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"esbuild": "^0.28.0",
|
|
30
30
|
"tsx": "^4.22.4",
|
|
31
31
|
"zod": "^4.4.3",
|
|
32
|
-
"@cotal-ai/
|
|
32
|
+
"@cotal-ai/core": "0.40.0",
|
|
33
33
|
"@cotal-ai/smoke-kit": "0.0.0",
|
|
34
|
-
"@cotal-ai/core": "0.
|
|
34
|
+
"@cotal-ai/connector-core": "0.40.0"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist"
|