@cotal-ai/connector-jcode 0.57.0 → 0.59.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.
@@ -0,0 +1,61 @@
1
+ /** The seat's private Jcode home under `root` (the launch's COTAL_JCODE_HOME), keyed by space and
2
+ * name. host.ts claims it; buildLaunch reads it to see whether the seat already owns its fork. */
3
+ export declare function jcodeSeatHome(root: string, space: string, name: string): string;
4
+ /** The seat's record of its fork (source, fork, title, transcript hash), which the manager reads
5
+ * as the fork's provenance. */
6
+ export declare function jcodeForkRecordPath(seatHome: string): string;
7
+ export interface JcodeForkSource {
8
+ sessionId: string;
9
+ title?: string;
10
+ /** sha256 over the source snapshot bytes followed by its journal bytes, as read. */
11
+ transcriptSha256: string;
12
+ messages: unknown[];
13
+ compaction?: unknown;
14
+ systemPrompt?: unknown;
15
+ model?: unknown;
16
+ }
17
+ /**
18
+ * Read the named session from `sourceHome`, folding its journal the way Jcode's loader does. Every
19
+ * failure is a named refusal, so `buildLaunch` can call this to refuse before anything launches.
20
+ *
21
+ * The source may be live. Jcode checkpoints by writing the folded snapshot and then unlinking the
22
+ * journal, so two reads can straddle it and lose the journal's messages or count them twice, and a
23
+ * pair read between the two steps holds a journal the snapshot already folded. Every Jcode save
24
+ * stamps `updated_at`, so such a journal is one whose lines are no newer than the snapshot. The pair
25
+ * is therefore read until two consecutive reads agree and every journal line is newer than the
26
+ * snapshot and adds no message it already holds, and refused as unstable when that does not happen.
27
+ */
28
+ export declare function readJcodeForkSource(sourceHome: string, sessionId: string): JcodeForkSource;
29
+ export interface JcodeFork {
30
+ forkId: string;
31
+ title?: string;
32
+ transcriptSha256: string;
33
+ /** False when this seat home already holds the fork of the same source from an earlier launch. */
34
+ created: boolean;
35
+ /** Whether a launch has appended the seat's briefing to the fork. A first launch that failed
36
+ * before its briefing leaves this false, so the retry still briefs the seat. */
37
+ briefed: boolean;
38
+ }
39
+ export interface ForkMarker {
40
+ source: string;
41
+ fork: string;
42
+ title?: string;
43
+ transcriptSha256: string;
44
+ briefed: boolean;
45
+ }
46
+ /** The seat's fork of `sessionId` when it already owns one, else undefined. A marker that names
47
+ * another source, or that cannot be parsed, is a named refusal rather than a silent re-fork. */
48
+ export declare function ownedJcodeFork(seatHome: string, sessionId: string): ForkMarker | undefined;
49
+ /** Record that the seat's briefing is now in its fork, so a later relaunch does not repeat it. */
50
+ export declare function markJcodeForkBriefed(seatHome: string, sessionId: string): void;
51
+ /**
52
+ * Give the seat its fork of `sessionId`. A seat home that already forked the same source keeps that
53
+ * fork, the same way a restarted seat continues its own session rather than starting over (#789).
54
+ */
55
+ export declare function forkJcodeSession(opts: {
56
+ sourceHome: string;
57
+ sessionId: string;
58
+ seatHome: string;
59
+ cwd: string;
60
+ }): JcodeFork;
61
+ //# sourceMappingURL=session-fork.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-fork.d.ts","sourceRoot":"","sources":["../src/session-fork.ts"],"names":[],"mappings":"AAsBA;mGACmG;AACnG,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/E;AAED;gCACgC;AAChC,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA+FD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,eAAe,CA2B1F;AA+ED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,kGAAkG;IAClG,OAAO,EAAE,OAAO,CAAC;IACjB;qFACiF;IACjF,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB;AAUD;iGACiG;AACjG,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAqB1F;AAED,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAI9E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAkC1H"}
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.57.0",
4
+ "version": "0.59.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -26,12 +26,12 @@
26
26
  "smol-toml": "^1.8.0"
27
27
  },
28
28
  "devDependencies": {
29
+ "@cotal-ai/connector-core": "0.59.0",
30
+ "@cotal-ai/core": "0.59.0",
31
+ "@cotal-ai/smoke-kit": "0.0.0",
29
32
  "esbuild": "^0.28.0",
30
33
  "tsx": "^4.22.4",
31
- "zod": "^4.4.3",
32
- "@cotal-ai/smoke-kit": "0.0.0",
33
- "@cotal-ai/connector-core": "0.57.0",
34
- "@cotal-ai/core": "0.57.0"
34
+ "zod": "^4.4.3"
35
35
  },
36
36
  "files": [
37
37
  "dist"