@cotal-ai/connector-jcode 0.27.0 → 0.28.0-hack-20260823204333

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,51 @@
1
+ /**
2
+ * Say which provider is actually carrying a seat's model.
3
+ *
4
+ * The connector already refuses to join under a model label it did not receive, and that guarantee
5
+ * stopped at the model. A seat could be truthfully labelled with the model an operator asked for
6
+ * while its traffic was carried by a component nobody named: one seat was requested as a given
7
+ * model, logged every line under a different provider's name, and died inside a third component's
8
+ * plugin. Nothing in the roster, the spawn confirmation, or the manager's exit line named the route,
9
+ * so establishing it meant reading the seat's private log by hand (#785).
10
+ *
11
+ * `RuntimeInfo` carries `provider` and `routes` in the same response the model check already reads,
12
+ * so this is a reporting gap, not a discovery problem.
13
+ */
14
+ /** The route fields this description reads; a subset of the SDK's `ModelRouteInfo`. */
15
+ export interface RouteInfo {
16
+ model: string;
17
+ provider: string;
18
+ api_method?: string;
19
+ available?: boolean;
20
+ }
21
+ /** The subset of the SDK's `RuntimeInfo` needed to describe a route. */
22
+ export interface RuntimeIdentity {
23
+ provider?: string;
24
+ model?: string;
25
+ providers?: string[];
26
+ routes?: RouteInfo[];
27
+ }
28
+ /**
29
+ * One line naming the effective route for `model`.
30
+ *
31
+ * The route matching the requested model wins, because `runtime.provider` is the session default and
32
+ * can differ from the provider actually serving this model. When neither is known the line says so
33
+ * explicitly rather than guessing or going quiet: an unknown route is itself worth reporting, since
34
+ * silence is what made this expensive to diagnose.
35
+ */
36
+ export declare function describeRoute(runtime: RuntimeIdentity | undefined, model: string): string;
37
+ /**
38
+ * Reject a `provider/model` specifier at the boundary instead of forwarding it.
39
+ *
40
+ * An operator passing `--model <provider>/<model>` had it sent verbatim to an endpoint that wants a
41
+ * bare id, and the resulting `model_not_found` named neither the connector nor the prefix as the
42
+ * cause. Returns the accepted form so the caller can say what to use instead.
43
+ */
44
+ export declare function bareModelId(model: string): {
45
+ ok: true;
46
+ } | {
47
+ ok: false;
48
+ bare: string;
49
+ prefix: string;
50
+ };
51
+ //# sourceMappingURL=route-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-identity.d.ts","sourceRoot":"","sources":["../src/route-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uFAAuF;AACvF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAOzF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAIrG"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Which stored session, if any, a restarting seat should come back to.
3
+ *
4
+ * Kept apart from the host so the rule can be graded directly. The rule is deliberately
5
+ * conservative: resuming the WRONG session is worse than starting clean, because a seat that
6
+ * silently inherits another lane's context will act on it with full confidence.
7
+ */
8
+ /** The subset of the SDK's `SessionInfo` this decision actually reads. */
9
+ export interface ResumeCandidate {
10
+ session_id: string;
11
+ working_dir?: string;
12
+ status?: string;
13
+ transcript_bytes?: number;
14
+ archived?: boolean;
15
+ }
16
+ /**
17
+ * Pick the session to attach, or `undefined` to create a fresh one.
18
+ *
19
+ * A candidate must prove it is ours before it can be resumed:
20
+ * - it declares a `working_dir`, and that dir is this seat's cwd (an undeclared dir cannot be
21
+ * proven, so it is refused rather than assumed);
22
+ * - it is not archived (archiving is an operator's explicit "retire this");
23
+ * - it carries a transcript with actual bytes, since resuming an empty session buys nothing and
24
+ * an unknown size is not assumed to be rich.
25
+ *
26
+ * Among survivors the largest transcript wins: that is the one holding the memory a restart would
27
+ * otherwise throw away, and it is what distinguishes the real session from the stub a previous
28
+ * buggy restart may have left behind.
29
+ */
30
+ export declare function chooseSessionToResume(candidates: readonly ResumeCandidate[] | undefined, cwd: string): ResumeCandidate | undefined;
31
+ //# sourceMappingURL=session-resume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-resume.d.ts","sourceRoot":"","sources":["../src/session-resume.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EAClD,GAAG,EAAE,MAAM,GACV,eAAe,GAAG,SAAS,CAkB7B"}
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.27.0",
4
+ "version": "0.28.0-hack-20260823204333",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "peerDependencies": {
21
- "@cotal-ai/core": ">=0.1.0"
21
+ "@cotal-ai/core": "0.28.0-hack-20260823204333"
22
22
  },
23
23
  "dependencies": {
24
24
  "@1jehuang/jcode-sdk": "^1.1.0",
@@ -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/connector-core": "0.27.0",
32
- "@cotal-ai/core": "0.27.0",
33
- "@cotal-ai/smoke-kit": "0.0.0"
31
+ "@cotal-ai/smoke-kit": "0.0.0",
32
+ "@cotal-ai/connector-core": "0.28.0-hack-20260823204333",
33
+ "@cotal-ai/core": "0.28.0-hack-20260823204333"
34
34
  },
35
35
  "files": [
36
36
  "dist"