@cotal-ai/connector-jcode 0.35.0 → 0.37.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.
@@ -1,8 +1,33 @@
1
+ /** Ensure one directory through a pinned parent fd. `beforeEnsure` runs after the parent is
2
+ * pinned and the leaf is classified, before unlink/mkdir, so the smoke can swap that parent. */
3
+ export declare function ensurePinnedPrivateDirectory(path: string, { replaceSymlink, requireOwner, beforeEnsure }?: {
4
+ replaceSymlink?: boolean;
5
+ requireOwner?: boolean;
6
+ beforeEnsure?: () => void;
7
+ }): void;
8
+ /** Remove only one exact connector-owned mirror destination. Each parent is opened with
9
+ * O_NOFOLLOW|O_DIRECTORY through the previous fd, then the leaf is unlinked through that pinned
10
+ * parent. A parent swapped for a symlink after it was walked cannot redirect the unlink. Optional
11
+ * `beforeUnlink` exists so the smoke can swap a parent between pin and unlink; production callers
12
+ * omit it. */
13
+ export declare function removeCredentialMirror(home: string, destinationRelative: string, beforeUnlink?: () => void): boolean;
14
+ /** Copy one allowlisted credential through the same pinned-parent walk as removal. Optional
15
+ * `beforeCopy` exists so the smoke can swap a parent between pin and copy; production callers omit it. */
16
+ export declare function copyCredentialFile(home: string, source: string, destinationRelative: string, beforeCopy?: () => void): boolean;
1
17
  export interface CredentialSources {
2
18
  jcodeHome: string;
3
19
  appConfigDir: string;
4
20
  externalHome: string;
5
21
  }
22
+ export interface CredentialMirrorEntry {
23
+ family: "jcode-home" | "app-config" | "external-static" | "external-agent";
24
+ source: string;
25
+ destinationRelative: string;
26
+ }
27
+ /** The complete allowlisted credential mirror inventory for one reconciliation pass. Dynamic
28
+ * families include both current source names and prior managed destinations, so removed names remain
29
+ * addressable for exact cleanup. */
30
+ export declare function jcodeCredentialMirrorInventory(home: string, sources: CredentialSources): CredentialMirrorEntry[];
6
31
  /** Copy the SDK-recognized provider material for this launch. The SDK's default inheritance links
7
32
  * rotating auth files; current jcode rejects those links in its external mirror, so the connector
8
33
  * owns a fresh, owner-only copy instead. */
@@ -1 +1 @@
1
- {"version":3,"file":"private-state.d.ts","sourceRoot":"","sources":["../src/private-state.ts"],"names":[],"mappings":"AAiIA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;4CAE4C;AAC5C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,oBAAsB,GAAG,IAAI,CAoBxF;AAED,MAAM,WAAW,eAAe;IAC9B,gHAAgH;IAChH,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAqC7D"}
1
+ {"version":3,"file":"private-state.d.ts","sourceRoot":"","sources":["../src/private-state.ts"],"names":[],"mappings":"AAgFA;gGACgG;AAChG,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,EAAE,cAAsB,EAAE,YAAoB,EAAE,YAAY,EAAE,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;CAAO,GACnJ,IAAI,CA6BN;AAsID;;;;cAIc;AACd,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAyCpH;AAED;0GAC0G;AAC1G,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAiD9H;AAWD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,GAAG,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAMD;;oCAEoC;AACpC,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,qBAAqB,EAAE,CA6BhH;AAED;;4CAE4C;AAC5C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,oBAAsB,GAAG,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;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAqC7D"}
@@ -1,3 +1,13 @@
1
+ export type JcodeConnectorFailureCode = "model_prefix_rejected" | "model_refused" | "model_mismatch";
2
+ /** A bounded connector-owned startup refusal. Only its allow-listed code is rendered publicly. */
3
+ export declare class JcodeConnectorError extends Error {
4
+ readonly code: JcodeConnectorFailureCode;
5
+ constructor(code: JcodeConnectorFailureCode, message: string, options?: ErrorOptions);
6
+ }
7
+ /** Start the per-seat connector diagnostic log before any private Jcode process is launched. */
8
+ export declare function installJcodeDiagnosticLog(home: string): string;
9
+ /** Write one connector-owned diagnostic to the terminal and the seat's private connector log. */
10
+ export declare function writeJcodeDiagnostic(message: string): void;
1
11
  /** A bounded, connector-owned account of a provider refusal during the mandatory readiness turn.
2
12
  * It deliberately contains only a provider error code and a model/effort value the connector could
3
13
  * classify; the original Harness API message may include private configuration or child output. */
@@ -20,6 +30,14 @@ export declare class JcodeEffortRefusal extends Error {
20
30
  /** Compose a bounded effort-refusal diagnostic. `invalid_request` is intentionally fixed: Jcode
21
31
  * rejected this API operation, while provider-supplied codes and text are untrusted. */
22
32
  export declare function jcodeEffortRefusal(error: unknown, requestedTier: string, effectiveModel: string): JcodeEffortRefusal;
33
+ /**
34
+ * The model an effort-refusal diagnostic may name.
35
+ *
36
+ * Prefer the operator pin. RuntimeInfo can still report the session default after `setModel`
37
+ * (measured: a CLI spawn that died on a variant-tier refusal recorded deepseek-v4-pro despite
38
+ * `--model grok-4.6`). Fall back to RuntimeInfo only when no pin was requested.
39
+ */
40
+ export declare function effortRefusalModel(requested: string | undefined, runtime: string | undefined): string;
23
41
  /**
24
42
  * Classify only the Jcode SDK's invalid-request response and only when both fields are safely
25
43
  * extractable. Everything else retains the existing scrubbed startup diagnostic.
@@ -1 +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;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,kB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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.35.0",
4
+ "version": "0.37.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/connector-core": "0.35.0",
32
+ "@cotal-ai/connector-core": "0.37.0",
33
33
  "@cotal-ai/smoke-kit": "0.0.0",
34
- "@cotal-ai/core": "0.35.0"
34
+ "@cotal-ai/core": "0.37.0"
35
35
  },
36
36
  "files": [
37
37
  "dist"