@skaile/workspaces 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.
Files changed (94) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/dist/{asset-feeds-W6JNAGNQ.js → asset-feeds-NOHUJ4XZ.js} +24 -6
  3. package/dist/asset-feeds-NOHUJ4XZ.js.map +1 -0
  4. package/dist/asset-manager/index.js +1 -1
  5. package/dist/{chunk-LJIE3PGF.js → chunk-22Q5R7SM.js} +2 -2
  6. package/dist/{chunk-LJIE3PGF.js.map → chunk-22Q5R7SM.js.map} +1 -1
  7. package/dist/{chunk-CMZWYMGD.js → chunk-3P7HBSSD.js} +3 -3
  8. package/dist/{chunk-CMZWYMGD.js.map → chunk-3P7HBSSD.js.map} +1 -1
  9. package/dist/{chunk-6LW7Q53Z.js → chunk-6BEGKO2Q.js} +3 -3
  10. package/dist/{chunk-6LW7Q53Z.js.map → chunk-6BEGKO2Q.js.map} +1 -1
  11. package/dist/{chunk-WVWX76IB.js → chunk-B5LHVPE2.js} +2 -2
  12. package/dist/{chunk-WVWX76IB.js.map → chunk-B5LHVPE2.js.map} +1 -1
  13. package/dist/{chunk-FZL6QOM7.js → chunk-BGVQKQCP.js} +3 -3
  14. package/dist/{chunk-FZL6QOM7.js.map → chunk-BGVQKQCP.js.map} +1 -1
  15. package/dist/{chunk-P7CIT445.js → chunk-C5UK3JK7.js} +21 -14
  16. package/dist/chunk-C5UK3JK7.js.map +1 -0
  17. package/dist/{chunk-ZDKJHQY2.js → chunk-JXT46QFC.js} +2 -2
  18. package/dist/{chunk-ZDKJHQY2.js.map → chunk-JXT46QFC.js.map} +1 -1
  19. package/dist/{chunk-UAYAK7N4.js → chunk-O66LT7UI.js} +49 -3
  20. package/dist/chunk-O66LT7UI.js.map +1 -0
  21. package/dist/{chunk-W23HDR6W.js → chunk-RM2KAMGD.js} +210 -59
  22. package/dist/chunk-RM2KAMGD.js.map +1 -0
  23. package/dist/{chunk-O4PANZI2.js → chunk-XNMABEHH.js} +3 -3
  24. package/dist/{chunk-O4PANZI2.js.map → chunk-XNMABEHH.js.map} +1 -1
  25. package/dist/{chunk-6KKNROBU.js → chunk-XZNPKJXU.js} +4 -4
  26. package/dist/{chunk-6KKNROBU.js.map → chunk-XZNPKJXU.js.map} +1 -1
  27. package/dist/cli/index.js +30 -26
  28. package/dist/cli/index.js.map +1 -1
  29. package/dist/cli/src/asset-feeds.d.ts +8 -5
  30. package/dist/cli/src/asset-feeds.d.ts.map +1 -1
  31. package/dist/cli/src/commands/manage.d.ts +6 -5
  32. package/dist/cli/src/commands/manage.d.ts.map +1 -1
  33. package/dist/cli/src/commands/source.d.ts +8 -0
  34. package/dist/cli/src/commands/source.d.ts.map +1 -1
  35. package/dist/connectors/index.js +2 -2
  36. package/dist/connectors/rclone.js +1 -1
  37. package/dist/connectors/src/rclone-process-manager.d.ts +9 -0
  38. package/dist/connectors/src/rclone-process-manager.d.ts.map +1 -1
  39. package/dist/discovery/index.js +2 -2
  40. package/dist/{ensure-sources-AGORTKJC.js → ensure-sources-XITKRBLU.js} +5 -5
  41. package/dist/{ensure-sources-AGORTKJC.js.map → ensure-sources-XITKRBLU.js.map} +1 -1
  42. package/dist/factory-assets/connectors/deploy.js +2 -2
  43. package/dist/factory-assets/connectors/devserver.js +2 -2
  44. package/dist/factory-assets/connectors/flow/adapter.js +2 -2
  45. package/dist/factory-assets/connectors/flow/run-flow.js +3 -3
  46. package/dist/factory-assets/connectors/flow.js +2 -2
  47. package/dist/factory-assets/connectors/git.js +2 -2
  48. package/dist/factory-assets/connectors/gmail.js +2 -2
  49. package/dist/factory-assets/connectors/googledrive.js +2 -2
  50. package/dist/factory-assets/connectors/local.js +2 -2
  51. package/dist/factory-assets/connectors/mattermost.js +2 -2
  52. package/dist/factory-assets/connectors/memory.js +2 -2
  53. package/dist/factory-assets/connectors/minio.js +2 -2
  54. package/dist/factory-assets/connectors/postgres.js +2 -2
  55. package/dist/factory-assets/connectors/s3.js +2 -2
  56. package/dist/factory-assets/connectors/sharepoint.js +2 -2
  57. package/dist/factory-assets/connectors/sqlite.js +2 -2
  58. package/dist/factory-assets/connectors/static-server.js +2 -2
  59. package/dist/factory-assets/connectors/tunnel.js +2 -2
  60. package/dist/factory-assets/connectors/webdav.js +2 -2
  61. package/dist/factory-assets/connectors/xstate-store.js +2 -2
  62. package/dist/factory-assets/connectors/xstate.js +2 -2
  63. package/dist/library/index.js +3 -3
  64. package/dist/library/src/remote/remote-catalog-source.d.ts +11 -1
  65. package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
  66. package/dist/{open-library-WTN7QLN7.js → open-library-5KJOZHG7.js} +6 -6
  67. package/dist/{open-library-WTN7QLN7.js.map → open-library-5KJOZHG7.js.map} +1 -1
  68. package/dist/plugins/index.js +1 -1
  69. package/dist/plugins/src/catalog-source.d.ts +52 -0
  70. package/dist/plugins/src/catalog-source.d.ts.map +1 -1
  71. package/dist/plugins/src/index.d.ts +1 -1
  72. package/dist/plugins/src/index.d.ts.map +1 -1
  73. package/dist/runner/index.js +4 -4
  74. package/dist/runner/src/ai-credential-refresh.d.ts +55 -23
  75. package/dist/runner/src/ai-credential-refresh.d.ts.map +1 -1
  76. package/dist/runner/src/ai-credential-retry.d.ts +79 -0
  77. package/dist/runner/src/ai-credential-retry.d.ts.map +1 -0
  78. package/dist/runner/src/credential-rotated.d.ts +33 -0
  79. package/dist/runner/src/credential-rotated.d.ts.map +1 -0
  80. package/dist/runner/src/resource-handler.d.ts.map +1 -1
  81. package/dist/runner/src/serve-credentials.d.ts +14 -0
  82. package/dist/runner/src/serve-credentials.d.ts.map +1 -1
  83. package/dist/runner/src/serve.d.ts.map +1 -1
  84. package/dist/sdk/asset-manager.js +1 -1
  85. package/dist/sdk/index.js +4 -4
  86. package/dist/sdk/runner.js +4 -4
  87. package/dist/secrets/index.js +2 -2
  88. package/dist/tui/index.js +4 -4
  89. package/dist/workspace-plugin/index.js +1 -1
  90. package/package.json +1 -1
  91. package/dist/asset-feeds-W6JNAGNQ.js.map +0 -1
  92. package/dist/chunk-P7CIT445.js.map +0 -1
  93. package/dist/chunk-UAYAK7N4.js.map +0 -1
  94. package/dist/chunk-W23HDR6W.js.map +0 -1
@@ -53,6 +53,47 @@ export interface CatalogAssetFilter {
53
53
  /** Prefix match on the full `<publisher>/<name>` ref. */
54
54
  prefix?: string;
55
55
  }
56
+ /**
57
+ * How the members of a navigational domain relate. Display-only hint — never an
58
+ * install-all bundle. Mirrors the discovery library's `DomainRelation`.
59
+ */
60
+ export type DomainRelation = "additions" | "alternatives" | "sequence";
61
+ /**
62
+ * Display-only metadata for a navigational domain (from a sidecar `DOMAIN.md`,
63
+ * surfaced by the store's `catalog.listDomains`). Joined to assets via
64
+ * {@link CatalogAsset.domainSlug}. A domain groups assets for co-discovery; it
65
+ * is never part of asset identity and never bulk-installs.
66
+ *
67
+ * Defined inline (structurally compatible with `core`'s `CatalogDomain`) to keep
68
+ * `plugins` a zero-dependency leaf package.
69
+ */
70
+ export interface CatalogDomain {
71
+ /** Stable slug — the join key to {@link CatalogAsset.domainSlug}. */
72
+ slug: string;
73
+ /** Human-readable title (may change without breaking the slug join). */
74
+ title: string;
75
+ /** Free-text description from the `DOMAIN.md` body. */
76
+ description?: string;
77
+ /** How members relate — drives sort + per-asset glyph, not installs. */
78
+ relation?: DomainRelation;
79
+ /** Display order among a publisher's domains (ascending). */
80
+ order?: number;
81
+ /** `kind:name` ref of the recommended member (alternatives domains). */
82
+ recommendedRef?: string;
83
+ /** Sidecar provenance — `"<org>/<repo>"` the `DOMAIN.md` was authored in. */
84
+ sidecarSource?: string;
85
+ }
86
+ /**
87
+ * Optional filter passed to {@link ICatalogSource.listDomains}.
88
+ *
89
+ * @docLink packages/workspace-plugin/index#plugin-interfaces
90
+ */
91
+ export interface CatalogDomainFilter {
92
+ /** Restrict to domains whose Source has a published asset under this publisher. */
93
+ publisher?: string;
94
+ /** Restrict to a single Source id. */
95
+ source?: string;
96
+ }
56
97
  /**
57
98
  * Descriptor returned by {@link ICatalogSource.listSources}.
58
99
  *
@@ -106,5 +147,16 @@ export interface ICatalogSource {
106
147
  fetchTarball(ref: string, sha256: string): Promise<Uint8Array>;
107
148
  /** List registered sources. */
108
149
  listSources(): Promise<CatalogSourceInfo[]>;
150
+ /**
151
+ * List navigational domains (display-only groupings from sidecar `DOMAIN.md`),
152
+ * optionally narrowed by publisher and/or source id.
153
+ *
154
+ * **Optional** — sources that don't model domains (local libraries, older
155
+ * stores, REST framings without the endpoint) omit it; consumers treat its
156
+ * absence (or `[]`) identically as "no domains". Display-only, so an
157
+ * implementation should degrade to `[]` on transport error rather than throw,
158
+ * to never jeopardize the asset feed it accompanies.
159
+ */
160
+ listDomains?(filter?: CatalogDomainFilter): Promise<CatalogDomain[]>;
109
161
  }
110
162
  //# sourceMappingURL=catalog-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-source.d.ts","sourceRoot":"","sources":["../../../plugins/src/catalog-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAk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,cAAc;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,gFAAgF;IAChF,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAEnD,+CAA+C;IAC/C,UAAU,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAEjE;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE7C;;;;;;;OAOG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE/D,+BAA+B;IAC/B,WAAW,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAE5C;;;;;;;;;OASG;IACH,WAAW,CAAC,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CACtE"}
@@ -2,7 +2,7 @@ export declare const VERSION = "0.0.0";
2
2
  export type { AssetKindFileFilter, AssetKindRequiresEdge, IAssetKindProvider, } from "./asset-kind-provider.js";
3
3
  export type { IAssetKindRegistry } from "./asset-kind-registry.js";
4
4
  export { AssetKindConflictError, AssetKindPathAmbiguityError, AssetKindPatternConflictError, AssetKindRegistryFrozenError, } from "./asset-kind-registry.js";
5
- export type { CatalogAsset, CatalogAssetFilter, CatalogSourceInfo, ICatalogSource, } from "./catalog-source.js";
5
+ export type { CatalogAsset, CatalogAssetFilter, CatalogDomain, CatalogDomainFilter, CatalogSourceInfo, DomainRelation, ICatalogSource, } from "./catalog-source.js";
6
6
  export type { ISecretsProvider, ListFilter, ProviderCapabilities, SecretMetadata, SetSecretOptions, } from "./secrets-provider.js";
7
7
  export { ProviderUnavailableError, SecretAccessDeniedError, SecretExpiredError, SecretNotFoundError, SecretsError, } from "./secrets-provider.js";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../plugins/src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../plugins/src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,uBAAuB,CAAC"}
@@ -1,5 +1,5 @@
1
- export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, stripStaleHtmlTail, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-W23HDR6W.js';
2
- import '../chunk-LJIE3PGF.js';
1
+ export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, stripStaleHtmlTail, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-RM2KAMGD.js';
2
+ import '../chunk-22Q5R7SM.js';
3
3
  import '../chunk-X5YPJV4N.js';
4
4
  import '../chunk-O7SG5PC2.js';
5
5
  import '../chunk-7QBNJTTQ.js';
@@ -14,10 +14,10 @@ import '../chunk-BMQKMOQY.js';
14
14
  import '../chunk-GAH4YRCI.js';
15
15
  import '../chunk-KM6DCR7A.js';
16
16
  import '../chunk-LV2HPH3C.js';
17
- import '../chunk-CMZWYMGD.js';
17
+ import '../chunk-3P7HBSSD.js';
18
18
  import '../chunk-OVRSNIKJ.js';
19
19
  import '../chunk-WLWHOA3S.js';
20
- import '../chunk-P7CIT445.js';
20
+ import '../chunk-C5UK3JK7.js';
21
21
  import '../chunk-6E6PKKAD.js';
22
22
  import '../chunk-X46FY45B.js';
23
23
  import '../chunk-DEYYRFQU.js';
@@ -1,20 +1,10 @@
1
1
  /**
2
- * Proactive AI-credential refresh scheduler.
3
- *
4
- * Holds a single `setTimeout` that fires `PROACTIVE_AI_REFRESH_MARGIN_MS`
5
- * before the current access token expires, asks the platform mediator for
6
- * a fresh credential via the caller-supplied `refresh` callback, and
7
- * re-arms itself against the new expiry. Pure logic does not invoke
8
- * `host.refresh_credential` itself; the caller threads that side-effect
9
- * through `refresh`.
10
- *
11
- * Pairs with the bridge-side `failTurn` deferral that suppresses
12
- * downstream auth-error events when a self-heal is about to run: the
13
- * proactive timer is the primary prevention of in-container 401s, the
14
- * reactive 401 path is the safety net.
15
- *
16
- * Spec: `_devlog/specs/2026-05-07-unified-credential-mediation.md`
17
- * § "Proactive refresh" (added 2026-05-20).
2
+ * Proactive AI-credential refresh scheduler. Holds a single timer that fires
3
+ * `PROACTIVE_AI_REFRESH_MARGIN_MS` before the token expires and re-arms against
4
+ * the new expiry via the caller-supplied `refresh`. Pure logic — the caller
5
+ * threads the `host.refresh_credential` side-effect. Resilience model
6
+ * (transient bounded-retry, terminal stop, stale-guard, non-amplification on a
7
+ * shared seat) is documented in `runner/CLAUDE.md` § AI Credential Mediation.
18
8
  *
19
9
  * @docLink packages/runner/dev-guide#ai-credential-mediation
20
10
  */
@@ -25,21 +15,52 @@
25
15
  * skew of a few seconds does not push the fire-time past expiry.
26
16
  */
27
17
  export declare const PROACTIVE_AI_REFRESH_MARGIN_MS: number;
18
+ /**
19
+ * Stale-schedule guard window. After the bounded transient retries are
20
+ * exhausted the scheduler arms a single long timer this far out so a blip
21
+ * during a proactive fire cannot leave refresh idle indefinitely — the
22
+ * worst case becomes one degraded window, after which a fresh refresh is
23
+ * attempted. Also the threshold {@link AiCredentialRefreshScheduler.ensureArmed}
24
+ * uses to decide a previously-armed scheduler has gone stale.
25
+ */
26
+ export declare const STALE_REARM_MS: number;
27
+ /**
28
+ * Outcome of a proactive refresh attempt, returned by the caller-supplied
29
+ * {@link AiCredentialRefreshDeps.refresh}:
30
+ *
31
+ * - `ok` — a fresh credential was minted; `expiresAt` is its ISO expiry, or
32
+ * `null` for a static token (no further refresh needed).
33
+ * - `transient` — a mediator/transport blip; the scheduler re-arms a bounded
34
+ * retry and ultimately a stale-schedule guard.
35
+ * - `terminal` — the credential/account is genuinely unusable; the scheduler
36
+ * stops re-arming and leaves the reactive 401 path as the safety net.
37
+ */
38
+ export type AiRefreshOutcome = {
39
+ status: "ok";
40
+ expiresAt: string | null;
41
+ } | {
42
+ status: "transient";
43
+ } | {
44
+ status: "terminal";
45
+ };
28
46
  /**
29
47
  * Caller-supplied side effects the scheduler invokes.
30
48
  *
31
- * - `refresh()` runs the actual mint round-trip; returns the new ISO
32
- * expiry on success (or `null` for static tokens) and `undefined` on
33
- * failure (the scheduler stays idle until the next external arming).
34
- * - `log()` receives operator-facing single-line strings.
49
+ * - `refresh()` runs the actual mint round-trip and classifies the result
50
+ * into an {@link AiRefreshOutcome}.
51
+ * - `log()` receives operator-facing single-line strings (info level).
52
+ * - `logError()` receives failure strings that MUST surface at error level
53
+ * (visible in `skaile session logs` and the debug panel). Defaults to
54
+ * `log` when omitted.
35
55
  * - `now()` is dependency-injected for deterministic timer tests; defaults
36
56
  * to `Date.now`.
37
57
  * - `setTimeoutImpl` / `clearTimeoutImpl` are injected for fake-timer
38
58
  * tests; default to the host's `setTimeout` / `clearTimeout`.
39
59
  */
40
60
  export interface AiCredentialRefreshDeps {
41
- refresh: () => Promise<string | null | undefined>;
61
+ refresh: () => Promise<AiRefreshOutcome>;
42
62
  log: (line: string) => void;
63
+ logError?: (line: string) => void;
43
64
  now?: () => number;
44
65
  setTimeoutImpl?: (handler: () => void, ms: number) => {
45
66
  unref?: () => void;
@@ -53,10 +74,21 @@ export interface AiCredentialRefreshScheduler {
53
74
  /**
54
75
  * Arm the timer for `expiresAtIso - marginMs`. Cancels any prior pending
55
76
  * fire. `null` / `undefined` cancels without re-arming (static PAT
56
- * semantics). If the fire-time has already passed, runs `refresh()` on
57
- * the next tick.
77
+ * semantics) and marks the credential static. If the fire-time has
78
+ * already passed, runs `refresh()` on the next tick. Records the
79
+ * credential as healthy (resets the transient-retry counter and the
80
+ * stale clock).
58
81
  */
59
82
  schedule(expiresAtIso: string | null | undefined): void;
83
+ /**
84
+ * Re-arm hook for the configure/wake path. Kicks a fresh refresh on the next
85
+ * tick when the scheduler is idle (prior terminal failure), stale (no
86
+ * successful fire in {@link STALE_REARM_MS}), or currently parked on the long
87
+ * stale-schedule guard — so a container waking during a degraded window
88
+ * recovers eagerly instead of waiting out the guard. No-op when a healthy
89
+ * refresh timer is already pending or the credential is a static PAT.
90
+ */
91
+ ensureArmed(): void;
60
92
  /** Cancel any pending fire. Idempotent. */
61
93
  cancel(): void;
62
94
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ai-credential-refresh.d.ts","sourceRoot":"","sources":["../../../runner/src/ai-credential-refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,QAAgB,CAAC;AAE5D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAClD,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK;QAAE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IAC7E,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IACxD,2CAA2C;IAC3C,MAAM,IAAI,IAAI,CAAC;IACf;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,IAAI,EAAE,uBAAuB,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2C;IAC3C,MAAM,IAAI,IAAI,CAAC;IACf;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,IAAI,EAAE,uBAAuB,GAC5B,4BAA4B,CAgJ9B"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Shared classification + bounded-retry policy for AI-credential mint failures.
3
+ * The single place that decides transient (`backend-error`) vs terminal
4
+ * (`revoked` / `not-configured` / `provider-error`), consumed by both the
5
+ * reactive 401 path and the proactive scheduler so they never drift. Rationale
6
+ * (shared-seat non-amplification) in `runner/CLAUDE.md` § AI Credential Mediation.
7
+ *
8
+ * @docLink packages/runner/dev-guide#ai-credential-mediation
9
+ */
10
+ import type { CredentialMint } from "@skaile/workspaces/types";
11
+ /** The discriminated failure codes a {@link CredentialMint} can carry. */
12
+ export type MintFailureCode = Extract<CredentialMint, {
13
+ ok: false;
14
+ }>["code"];
15
+ /**
16
+ * Maximum total mint attempts (initial try + retries) on the transient path.
17
+ * Three attempts spanning the backoff below ride out a ~7s backend redeploy.
18
+ */
19
+ export declare const MINT_RETRY_MAX_ATTEMPTS = 3;
20
+ /**
21
+ * Whether a failed mint should be retried. Only `backend-error` (internal
22
+ * mediator outage) is transient; `not-configured`, `revoked`, and
23
+ * `provider-error` are terminal credential/account states where a retry
24
+ * cannot help.
25
+ */
26
+ export declare function isTransientMintFailure(code: MintFailureCode): boolean;
27
+ /**
28
+ * Backoff before the Nth retry (`retryNumber = 1` is the delay before the 2nd
29
+ * attempt). Exponential from a 2s base, capped at 5s, so three attempts span
30
+ * roughly 6s — enough to ride a backend redeploy without unbounded waiting.
31
+ */
32
+ export declare function mintRetryDelayMs(retryNumber: number): number;
33
+ /**
34
+ * Run `attempt` up to {@link MINT_RETRY_MAX_ATTEMPTS} times, sleeping
35
+ * {@link mintRetryDelayMs} between tries, stopping early on success or a
36
+ * terminal failure. Returns the final mint: ok, a terminal failure, or the
37
+ * last transient failure once the cap is reached. `sleep` is injected so tests
38
+ * stay deterministic.
39
+ */
40
+ export declare function retryTransientMint(attempt: () => Promise<CredentialMint>, deps: {
41
+ sleep: (ms: number) => Promise<void>;
42
+ maxAttempts?: number;
43
+ onRetry?: (info: {
44
+ attempt: number;
45
+ nextDelayMs: number;
46
+ code: MintFailureCode;
47
+ }) => void;
48
+ }): Promise<CredentialMint>;
49
+ /**
50
+ * Truncated SHA-256 of the just-rejected access token. Sent as the OPTIONAL
51
+ * `rejectedFingerprint` on a retry-401 `host.refresh_credential` so the platform
52
+ * can coalesce concurrent rotations of the same dead token (single-flight). It
53
+ * is non-reversible and carries no secret material (16 hex chars = 64 bits,
54
+ * collision-safe for coalescing). Returns `undefined` for an empty/missing
55
+ * token so the field is simply omitted.
56
+ */
57
+ export declare function computeRejectedFingerprint(accessToken: string | null | undefined): string | undefined;
58
+ /** The wire input for a `host.refresh_credential` invocation (ai-credentials). */
59
+ export interface RefreshCredentialInput {
60
+ kind: "ai-credentials";
61
+ id: string;
62
+ reason: "refresh" | "retry-401";
63
+ /** Truncated fingerprint of the just-rejected token; only on retry-401. */
64
+ rejectedFingerprint?: string;
65
+ }
66
+ /**
67
+ * Build the `host.refresh_credential` input. The optional
68
+ * `rejectedFingerprint` is attached ONLY on a `retry-401` (where a token was
69
+ * just rejected) and ONLY when a current token is on disk to fingerprint — on a
70
+ * proactive `refresh` there is no rejected token, so the field is omitted.
71
+ * Today's platform ignores the unknown field; the single-flight mediator uses
72
+ * it to coalesce concurrent rotations of the same dead token.
73
+ */
74
+ export declare function buildRefreshCredentialInput(args: {
75
+ configId: string;
76
+ reason: "refresh" | "retry-401";
77
+ rejectedToken?: string | null;
78
+ }): RefreshCredentialInput;
79
+ //# sourceMappingURL=ai-credential-retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-credential-retry.d.ts","sourceRoot":"","sources":["../../../runner/src/ai-credential-retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EA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AAE,SAAS,GAAG,WAAW,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,GAAG,sBAAsB,CASzB"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Inbound `credentialRotated` broadcast handler — the runner's receive side of
3
+ * the platform single-flight mediator's rotation broadcast (re-pull instead of
4
+ * each container force-refreshing). Dormant until the platform ships it. Wire
5
+ * shape + delivery-channel contract in root `MIGRATION.md`.
6
+ * @docLink packages/runner/dev-guide#ai-credential-mediation
7
+ */
8
+ import type { CredentialMint } from "@skaile/workspaces/types";
9
+ /** `LogSource.subkind` the platform tags its credential-rotation broadcast with. */
10
+ export declare const AI_PROVIDER_CREDENTIAL_SUBKIND = "ai-provider-credential";
11
+ /**
12
+ * Whether an inbound message is the platform's credential-rotation broadcast.
13
+ * Pure predicate — tolerant of unknown shapes so a malformed message is simply
14
+ * not matched rather than throwing on the command ingress path.
15
+ */
16
+ export declare function isCredentialRotatedSignal(msg: unknown): boolean;
17
+ /**
18
+ * Handle a credential-rotation broadcast: re-pull the fresh token through the
19
+ * supplied `repull` (a `host.refresh_credential { reason: 'refresh' }` round
20
+ * trip that rewrites `.credentials.json`). Idempotent and best-effort — a
21
+ * failed re-pull is logged at error level and the reactive 401 path remains the
22
+ * safety net; it never throws to the caller.
23
+ *
24
+ * The serve.ts wiring passes `mintAndPersistAiCredential` as `repull`, whose
25
+ * success path also re-arms the proactive refresh scheduler against the fresh
26
+ * expiry — so a re-pull both rewrites the file and re-schedules in one step.
27
+ */
28
+ export declare function handleCredentialRotatedSignal(deps: {
29
+ repull: () => Promise<CredentialMint>;
30
+ log: (line: string) => void;
31
+ logError: (line: string) => void;
32
+ }): Promise<void>;
33
+ //# sourceMappingURL=credential-rotated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-rotated.d.ts","sourceRoot":"","sources":["../../../runner/src/credential-rotated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,oFAAoF;AACpF,eAAO,MAAM,8BAA8B,2BAA2B,CAAC;AAEvE;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAa/D;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,6BAA6B,CAAC,IAAI,EAAE;IACxD,MAAM,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;IACtC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,GAAG,OAAO,CAAC,IAAI,CAAC,CAchB"}
@@ -1 +1 @@
1
- {"version":3,"file":"resource-handler.d.ts","sourceRoot":"","sources":["../../../runner/src/resource-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EACV,UAAU,EAEV,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAOlC;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAyCf;AAcD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAI/E;AAuBD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAChC,IAAI,CAiGN"}
1
+ {"version":3,"file":"resource-handler.d.ts","sourceRoot":"","sources":["../../../runner/src/resource-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAeH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EACV,UAAU,EAEV,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAOlC;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAyCf;AAcD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAI/E;AAuBD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAChC,IAAI,CAiHN"}
@@ -68,4 +68,18 @@ export declare function mergeAndRewriteCredentialsFile(home: string, accessToken
68
68
  * @docLink packages/runner/dev-guide#ai-credential-mediation
69
69
  */
70
70
  export declare function extractClaudeAiOauthExpiresAt(json: string): string | null;
71
+ /**
72
+ * Read the current access token from the on-disk credentials file at
73
+ * `<home>/.claude/.credentials.json`. Supports both the nested
74
+ * `claudeAiOauth.accessToken` shape the platform writes and the flat
75
+ * top-level `accessToken` some SDK builds use.
76
+ *
77
+ * Used by the 401-mediation path to fingerprint the just-rejected token (the
78
+ * one currently on disk) before asking the platform to rotate it, so the
79
+ * platform can coalesce concurrent rotations of the same dead token. Returns
80
+ * `null` when the file is absent, unreadable, or carries no token.
81
+ *
82
+ * @docLink packages/runner/dev-guide#ai-credential-mediation
83
+ */
84
+ export declare function readCurrentClaudeAccessToken(home: string): string | null;
71
85
  //# sourceMappingURL=serve-credentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serve-credentials.d.ts","sourceRoot":"","sources":["../../../runner/src/serve-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,iCAAiC,CAAC;AAE1E;;;;;;;;;;GAUG;AACH,wBAAsB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQhG;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBzE"}
1
+ {"version":3,"file":"serve-credentials.d.ts","sourceRoot":"","sources":["../../../runner/src/serve-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,iCAAiC,CAAC;AAE1E;;;;;;;;;;GAUG;AACH,wBAAsB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQhG;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBzE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAaxE"}
@@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C5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAs8ExE"}
@@ -1,4 +1,4 @@
1
- export { AssetManager, parseCanonicalLockKey } from '../chunk-WVWX76IB.js';
1
+ export { AssetManager, parseCanonicalLockKey } from '../chunk-B5LHVPE2.js';
2
2
  export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-4A2LAEX6.js';
3
3
  import '../chunk-FBIQ4QPF.js';
4
4
  import '../chunk-CFCSDZYF.js';
package/dist/sdk/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AgentClient } from '../chunk-SZ3SIVZQ.js';
2
- import { startAgentServer } from '../chunk-W23HDR6W.js';
3
- import '../chunk-LJIE3PGF.js';
2
+ import { startAgentServer } from '../chunk-RM2KAMGD.js';
3
+ import '../chunk-22Q5R7SM.js';
4
4
  import '../chunk-X5YPJV4N.js';
5
5
  import '../chunk-O7SG5PC2.js';
6
6
  import '../chunk-7QBNJTTQ.js';
@@ -15,10 +15,10 @@ import '../chunk-BMQKMOQY.js';
15
15
  import '../chunk-GAH4YRCI.js';
16
16
  import '../chunk-KM6DCR7A.js';
17
17
  import '../chunk-LV2HPH3C.js';
18
- import '../chunk-CMZWYMGD.js';
18
+ import '../chunk-3P7HBSSD.js';
19
19
  import '../chunk-OVRSNIKJ.js';
20
20
  import '../chunk-WLWHOA3S.js';
21
- import '../chunk-P7CIT445.js';
21
+ import '../chunk-C5UK3JK7.js';
22
22
  import '../chunk-6E6PKKAD.js';
23
23
  import '../chunk-X46FY45B.js';
24
24
  import '../chunk-DEYYRFQU.js';
@@ -1,5 +1,5 @@
1
- export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, stripStaleHtmlTail, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-W23HDR6W.js';
2
- import '../chunk-LJIE3PGF.js';
1
+ export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, stripStaleHtmlTail, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-RM2KAMGD.js';
2
+ import '../chunk-22Q5R7SM.js';
3
3
  import '../chunk-X5YPJV4N.js';
4
4
  import '../chunk-O7SG5PC2.js';
5
5
  import '../chunk-7QBNJTTQ.js';
@@ -14,10 +14,10 @@ import '../chunk-BMQKMOQY.js';
14
14
  import '../chunk-GAH4YRCI.js';
15
15
  import '../chunk-KM6DCR7A.js';
16
16
  import '../chunk-LV2HPH3C.js';
17
- import '../chunk-CMZWYMGD.js';
17
+ import '../chunk-3P7HBSSD.js';
18
18
  import '../chunk-OVRSNIKJ.js';
19
19
  import '../chunk-WLWHOA3S.js';
20
- import '../chunk-P7CIT445.js';
20
+ import '../chunk-C5UK3JK7.js';
21
21
  import '../chunk-6E6PKKAD.js';
22
22
  import '../chunk-X46FY45B.js';
23
23
  import '../chunk-DEYYRFQU.js';
@@ -1,5 +1,5 @@
1
- export { CredentialLifecycleService, EnvSecretsProvider, LocalSecretsProvider, SecretsRouter, VERSION } from '../chunk-6LW7Q53Z.js';
2
- export { ProviderUnavailableError, SecretAccessDeniedError, SecretExpiredError, SecretNotFoundError, SecretsError } from '../chunk-ZDKJHQY2.js';
1
+ export { CredentialLifecycleService, EnvSecretsProvider, LocalSecretsProvider, SecretsRouter, VERSION } from '../chunk-6BEGKO2Q.js';
2
+ export { ProviderUnavailableError, SecretAccessDeniedError, SecretExpiredError, SecretNotFoundError, SecretsError } from '../chunk-JXT46QFC.js';
3
3
  import '../chunk-NSBPE2FW.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map
package/dist/tui/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createAgentSession } from '../chunk-W23HDR6W.js';
2
- import '../chunk-LJIE3PGF.js';
1
+ import { createAgentSession } from '../chunk-RM2KAMGD.js';
2
+ import '../chunk-22Q5R7SM.js';
3
3
  import '../chunk-X5YPJV4N.js';
4
4
  import '../chunk-O7SG5PC2.js';
5
5
  import '../chunk-7QBNJTTQ.js';
@@ -14,10 +14,10 @@ import '../chunk-BMQKMOQY.js';
14
14
  import '../chunk-GAH4YRCI.js';
15
15
  import '../chunk-KM6DCR7A.js';
16
16
  import '../chunk-LV2HPH3C.js';
17
- import '../chunk-CMZWYMGD.js';
17
+ import '../chunk-3P7HBSSD.js';
18
18
  import '../chunk-OVRSNIKJ.js';
19
19
  import { loadConnectorDeclarations } from '../chunk-WLWHOA3S.js';
20
- import '../chunk-P7CIT445.js';
20
+ import '../chunk-C5UK3JK7.js';
21
21
  import '../chunk-6E6PKKAD.js';
22
22
  import '../chunk-X46FY45B.js';
23
23
  import '../chunk-DEYYRFQU.js';
@@ -1,4 +1,4 @@
1
- export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-LJIE3PGF.js';
1
+ export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-22Q5R7SM.js';
2
2
  export { err, ok, okJson } from '../chunk-X5YPJV4N.js';
3
3
  import '../chunk-JB35MVBN.js';
4
4
  import '../chunk-NSBPE2FW.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skaile/workspaces",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "description": "Skaile workspaces runtime — types, core, bridge, runner, store, connectors, and supporting layers as one publishable package",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.9",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA+DA,eAAe,aAAA,GAAyE;AACtF,EAAA,MAAM,QAAoB,EAAC;AAC3B,EAAA,IAAI;AACF,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feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Three feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex` (filesystem\n * scan of each library's `path`).\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport { existsSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogDomain,\n type CatalogEntry,\n scanRepo,\n} from \"@skaile/workspaces/core\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n /**\n * Display-only domain metadata, keyed (by the consumer) on `slug`. Populated\n * from the store's `catalog.listDomains` when the connected catalog source\n * exposes it; empty otherwise. The manage TUI joins `entry.domainSlug` → a\n * domain for grouping headers, descriptions, and relation badges.\n */\n domains: CatalogDomain[];\n notes: FeedNote[];\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/sources/` cache). Each\n * library's `path` is scanned with `scanRepo` and tagged with\n * `repository = \"library:<name>\"` so the manage TUI groups them into their\n * own headers.\n */\nasync function libraryAssets(): Promise<{ entries: CatalogEntry[]; notes: FeedNote[] }> {\n const notes: FeedNote[] = [];\n try {\n const [{ openLibraryManager }, { skaileHomeDir }] = await Promise.all([\n import(\"./open-library.ts\"),\n import(\"@skaile/workspaces/library\"),\n ]);\n const { manager, close } = await openLibraryManager();\n try {\n const sourcesDir = path.join(skaileHomeDir(), \"sources\");\n const libs = (await manager.listLibraries()).filter((l) => !l.path.startsWith(sourcesDir));\n const entries: CatalogEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n for (const e of scanRepo(lib.path, `library:${lib.name}`)) {\n entries.push(e);\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n const assets = await source.listAssets();\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n domainSlug: a.domainSlug,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n // Domains are optional on the catalog source — only the store backend\n // (post Part 4 `catalog.listDomains`) exposes them. Duck-type the call so\n // older sources and the local catalog degrade to no domains, not an error.\n const domains = await loadDomains(source);\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], domains: [], notes };\n }\n}\n\n/** Optional `listDomains` capability — returns `[]` when the source lacks it. */\nasync function loadDomains(source: unknown): Promise<CatalogDomain[]> {\n const fn = (source as { listDomains?: () => Promise<CatalogDomain[]> }).listDomains;\n if (typeof fn !== \"function\") return [];\n const domains = await fn.call(source);\n return Array.isArray(domains) ? domains : [];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which now merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Provided as a\n * function rather than an inline call so the caller can supply a fresh\n * `AssetManager` instance.\n */\nfunction sourceAssets(am: { search: () => CatalogEntry[] }): CatalogEntry[] {\n return am.search();\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all three feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk.\n */\nexport async function gatherAssetFeeds(\n am: { search: () => CatalogEntry[] },\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n return {\n entries: [\n ...tag(\"source\", sourceAssets(am)),\n ...tag(\"library\", libs.entries),\n ...tag(\"store\", store.entries),\n ],\n domains: store.domains,\n notes: [...libs.notes, ...store.notes],\n };\n}\n"]}