@skaile/workspaces 0.10.1 → 0.11.1
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/CHANGELOG.md +63 -0
- package/dist/asset-manager/index.js +2 -2
- package/dist/asset-manager/scaffold.js +1 -1
- package/dist/base-assets/connectors/deploy.js +2 -2
- package/dist/base-assets/connectors/devserver.js +2 -2
- package/dist/base-assets/connectors/flow/adapter.js +2 -2
- package/dist/base-assets/connectors/flow/run-flow.js +3 -3
- package/dist/base-assets/connectors/flow.js +2 -2
- package/dist/base-assets/connectors/git.js +2 -2
- package/dist/base-assets/connectors/gmail.js +2 -2
- package/dist/base-assets/connectors/local.js +2 -2
- package/dist/base-assets/connectors/mattermost.js +2 -2
- package/dist/base-assets/connectors/memory.js +2 -2
- package/dist/base-assets/connectors/minio.js +2 -2
- package/dist/base-assets/connectors/postgres.js +2 -2
- package/dist/base-assets/connectors/redis.js +2 -2
- package/dist/base-assets/connectors/s3.js +2 -2
- package/dist/base-assets/connectors/sharepoint/driver.d.ts.map +1 -1
- package/dist/base-assets/connectors/sharepoint.js +2 -2
- package/dist/base-assets/connectors/sqlite.js +2 -2
- package/dist/base-assets/connectors/static-server.js +2 -2
- package/dist/base-assets/connectors/tunnel.js +2 -2
- package/dist/base-assets/connectors/webdav/driver.d.ts.map +1 -1
- package/dist/base-assets/connectors/webdav.js +2 -2
- package/dist/base-assets/connectors/xstate-store.js +2 -2
- package/dist/base-assets/connectors/xstate.js +2 -2
- package/dist/base-assets/connectors/yjs.js +2 -2
- package/dist/bridge/drivers/claude-sdk.js +42 -1
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +1 -1
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/index.js +2 -2
- package/dist/bridge/src/drivers/claude-sdk.d.ts +22 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/{chunk-OVM36NYF.js → chunk-34333Z5H.js} +199 -85
- package/dist/chunk-34333Z5H.js.map +1 -0
- package/dist/{chunk-EBMFCF4P.js → chunk-6MB7CRME.js} +17 -6
- package/dist/chunk-6MB7CRME.js.map +1 -0
- package/dist/{chunk-UHSC75L7.js → chunk-EAJKY27M.js} +9 -9
- package/dist/chunk-EAJKY27M.js.map +1 -0
- package/dist/{chunk-FEBLE7QX.js → chunk-EARKGKKB.js} +2 -2
- package/dist/{chunk-FEBLE7QX.js.map → chunk-EARKGKKB.js.map} +1 -1
- package/dist/{chunk-OSJH4SPO.js → chunk-VMU2WEN7.js} +3 -3
- package/dist/{chunk-OSJH4SPO.js.map → chunk-VMU2WEN7.js.map} +1 -1
- package/dist/{chunk-IFRUVHOQ.js → chunk-XYEFV7XN.js} +3 -3
- package/dist/{chunk-IFRUVHOQ.js.map → chunk-XYEFV7XN.js.map} +1 -1
- package/dist/{chunk-OQIBHB4F.js → chunk-YHXBQLXX.js} +2 -2
- package/dist/{chunk-OQIBHB4F.js.map → chunk-YHXBQLXX.js.map} +1 -1
- package/dist/{chunk-S7RACIZI.js → chunk-YOFKTALB.js} +2 -2
- package/dist/{chunk-S7RACIZI.js.map → chunk-YOFKTALB.js.map} +1 -1
- package/dist/{chunk-BTKNSMLK.js → chunk-Z5PO7ZVP.js} +2 -2
- package/dist/{chunk-BTKNSMLK.js.map → chunk-Z5PO7ZVP.js.map} +1 -1
- package/dist/cli/index.js +10 -10
- package/dist/connectors/index.js +2 -2
- package/dist/connectors/rclone.js +1 -1
- package/dist/connectors/src/fs-utils.d.ts +33 -0
- package/dist/connectors/src/fs-utils.d.ts.map +1 -0
- package/dist/connectors/src/index.d.ts +1 -0
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors/src/rclone-process-manager.d.ts.map +1 -1
- package/dist/runner/index.js +6 -6
- package/dist/runner/src/ai-credential-refresh.d.ts +74 -0
- package/dist/runner/src/ai-credential-refresh.d.ts.map +1 -0
- package/dist/runner/src/serve-credentials.d.ts +21 -0
- package/dist/runner/src/serve-credentials.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +2 -2
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +2 -2
- package/dist/sdk/bridge.js +2 -2
- package/dist/sdk/index.js +6 -6
- package/dist/sdk/runner.js +6 -6
- package/dist/{setup-QIEPIYH2.js → setup-QAOUBECX.js} +4 -4
- package/dist/{setup-QIEPIYH2.js.map → setup-QAOUBECX.js.map} +1 -1
- package/dist/tui/index.js +6 -6
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-EBMFCF4P.js.map +0 -1
- package/dist/chunk-OVM36NYF.js.map +0 -1
- package/dist/chunk-UHSC75L7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../workspace-plugin/src/adapters/claude-code.ts","../workspace-plugin/src/store.ts","../workspace-plugin/src/plugin.ts","../workspace-plugin/src/utils/project-dir.ts"],"names":["err"],"mappings":";;;;;;AAeA,IAAM,WAAA,GAAc;AAAA,EAClB,IAAA,EAAM,QAAA;AAAA,EACN,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa,yEAAA;AAAA,EACb,MAAA,EAAQ,EAAE,IAAA,EAAM,WAAA,EAAa,KAAK,8BAAA,EAA+B;AAAA,EACjE,UAAA,EAAY,yCAAA;AAAA,EACZ,QAAA,EAAU,CAAC,QAAA,EAAU,YAAA,EAAc,aAAa,WAAW,CAAA;AAAA,EAC3D,KAAA,EAAO,oBAAA;AAAA,EACP,UAAA,EAAY,aAAA;AAAA,EACZ,UAAA,EAAY;AAAA,IACV,gBAAA,EAAkB;AAAA,MAChB,IAAA,EAAM,QAAA;AAAA,MACN,KAAA,EAAO,kBAAA;AAAA,MACP,WAAA,EAAa;AAAA;AACf;AAEJ,CAAA;AAOA,IAAM,UAAA,GAAa;AAAA,EACjB,KAAA,EAAO;AAAA,IACL,YAAA,EAAc,C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AAqC,CAAA;AACnD,IAAA,MAAM,EAAE,iBAAA,EAAkB,GAAI,MAAM,OAAO,oCAAmB,CAAA;AAC9D,IAAA,MAAM,kBAAkB,IAAI,CAAA;AAAA,EAC9B;AAAA,EAEA,MAAM,eAAA,GAAsC;AAC1C,IAAA,MAAM,EAAE,eAAA,EAAgB,GAAI,MAAM,OAAO,oCAAmB,CAAA;AAC5D,IAAA,OAAO,gBAAgB,IAAI,CAAA;AAAA,EAC7B;AAAA,EAEA,MAAM,uBAAA,GAA2C;AAC/C,IAAA,MAAM,EAAE,uBAAA,EAAwB,GAAI,MAAM,OAAO,oCAAmB,CAAA;AACpE,IAAA,OAAO,uBAAA,CAAwB,KAAK,UAAU,CAAA;AAAA,EAChD;AAAA,EAEA,MAAM,kBAAA,CAAmB,KAAA,EAAe,IAAA,EAAiC;AACvE,IAAA,MAAM,EAAE,kBAAA,EAAmB,GAAI,MAAM,OAAO,oCAAmB,CAAA;AAC/D,IAAA,OAAO,kBAAA,CAAmB,IAAA,EAAM,KAAA,EAAO,IAAI,CAAA;AAAA,EAC7C;AACF;;;AC1OO,SAAS,kBAAkB,iBAAA,EAAsC;AACtE,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,kBAAA,EAAoB,OAAO,QAAQ,GAAA,CAAI,kBAAA;AACvD,EAAA,KAAA,MAAW,GAAA,IAAO,iBAAA,IAAqB,EAAC,EAAG;AACzC,IAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,GAAA,CAAI,GAAG,CAAA;AAC3B,IAAA,IAAI,KAAK,OAAO,GAAA;AAAA,EAClB;AACA,EAAA,OAAO,QAAQ,GAAA,EAAI;AACrB","file":"chunk-BTKNSMLK.js","sourcesContent":["// ── Claude Code plugin-directory generator (STATELESS) ──────────────────────\n// Generates the contents of a Claude Code plugin directory\n// (`.claude/plugins/skaile/`) as an in-memory file map. No plugin instance or\n// boot() is required — safe to call from install commands.\n//\n// The previous standalone `@skaile/workspace-plugin-claude` package shipped\n// these as static files plus loose `.mjs` hook scripts; they are now\n// CLI-owned templates. Hooks invoke the `skaile` binary directly\n// (`skaile plugin hook <event>`) and MCP runs via `skaile mcp-server` — no\n// generated script files, no shebang, no runtime assumption.\n\n/**\n * The Claude Code plugin manifest. `name` is `skaile`; `hooks` and\n * `mcpServers` point at sibling files in the generated directory.\n */\nconst PLUGIN_JSON = {\n name: \"skaile\",\n version: \"0.1.0\",\n description: \"Skaile workspace — connectors, mounts, skills, flows, shared state\",\n author: { name: \"skaile-ai\", url: \"https://github.com/skaile-ai\" },\n repository: \"https://github.com/skaile-ai/workspaces\",\n keywords: [\"skaile\", \"connectors\", \"workspace\", \"ai-assets\"],\n hooks: \"./hooks/hooks.json\",\n mcpServers: \"./.mcp.json\",\n userConfig: {\n skaile_yaml_path: {\n type: \"string\",\n title: \"skaile.yaml path\",\n description: \"Override path to skaile.yaml (default: auto-detect from project root)\",\n },\n },\n};\n\n/**\n * Hook wiring. Each lifecycle event invokes the `skaile` binary directly —\n * no loose `.mjs` scripts. `skaile plugin hook <event>` resolves the project\n * directory itself (`CLAUDE_PROJECT_DIR` / cwd) and always exits 0.\n */\nconst HOOKS_JSON = {\n hooks: {\n SessionStart: [{ hooks: [{ type: \"command\", command: \"skaile plugin hook session-start\" }] }],\n SessionEnd: [{ hooks: [{ type: \"command\", command: \"skaile plugin hook session-end\" }] }],\n UserPromptSubmit: [\n { hooks: [{ type: \"command\", command: \"skaile plugin hook user-prompt-submit\" }] },\n ],\n },\n};\n\n/**\n * MCP server wiring. Spawns `skaile mcp-server` — a stdio MCP subprocess that\n * runs on plain Node (no Claude Agent SDK).\n */\nconst MCP_JSON = {\n mcpServers: {\n \"skaile-workspace\": {\n command: \"skaile\",\n args: [\"mcp-server\"],\n env: {},\n },\n },\n};\n\n/**\n * Build the Claude Code plugin directory as an in-memory file map.\n *\n * Returns `{ relativePath: contents }` for every file the installer must\n * write under `<projectDir>/.claude/plugins/skaile/`. The installer is also\n * responsible for populating `skills/` from the project's `.skaile/skills/`.\n *\n * Stateless — no plugin instance, no `boot()`. The generated artifacts carry\n * no project-specific paths: hooks and the MCP server resolve the project\n * directory themselves at runtime.\n *\n * @returns A map of plugin-relative file paths to their string contents.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport function buildClaudePluginFiles(): Record<string, string> {\n return {\n \".claude-plugin/plugin.json\": `${JSON.stringify(PLUGIN_JSON, null, 2)}\\n`,\n \"hooks/hooks.json\": `${JSON.stringify(HOOKS_JSON, null, 2)}\\n`,\n \".mcp.json\": `${JSON.stringify(MCP_JSON, null, 2)}\\n`,\n \"skills/.gitkeep\": \"\",\n };\n}\n","import { readFile, writeFile, mkdir } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\n\ninterface Subscriber {\n regex: RegExp;\n handler: (key: string, value: unknown) => void;\n}\n\n/**\n * Disk-backed reactive key-value store for plugin state.\n *\n * Keeps an in-memory map that can be flushed to / loaded from a JSON file.\n * Supports glob-style subscriptions (`connector:*`, `*`).\n *\n * State is persisted to `<projectDir>/.skaile/plugin-state.json`.\n * The instance is available on {@link WorkspacePlugin} as the public `store`\n * field after `boot()` resolves.\n *\n * @docLink packages/workspace-plugin/concepts#plugin-store\n */\nexport class PluginStore {\n private readonly statePath: string;\n private data: Map<string, unknown> = new Map();\n private subscribers: Subscriber[] = [];\n\n constructor(statePath: string) {\n this.statePath = statePath;\n }\n\n /** Synchronous read from in-memory map. */\n get<T>(key: string): T | undefined {\n return this.data.get(key) as T | undefined;\n }\n\n /** Write to in-memory map and notify matching subscribers. */\n set<T>(key: string, value: T): void {\n this.data.set(key, value);\n this.notify(key, value);\n }\n\n /** Remove key and notify matching subscribers. */\n delete(key: string): void {\n this.data.delete(key);\n this.notify(key, undefined);\n }\n\n /**\n * Subscribe to changes matching a glob-style pattern.\n * `*` matches any sequence of characters.\n * Returns an unsubscribe function.\n */\n subscribe(pattern: string, handler: (key: string, value: unknown) => void): () => void {\n const escaped = pattern.replace(/[.+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const regexStr = `^${escaped.replace(/\\*/g, \".*\")}$`;\n const sub: Subscriber = { regex: new RegExp(regexStr), handler };\n this.subscribers.push(sub);\n\n return () => {\n const idx = this.subscribers.indexOf(sub);\n if (idx !== -1) this.subscribers.splice(idx, 1);\n };\n }\n\n /** Rehydrate from disk JSON. Missing file = empty store (no throw). */\n async load(): Promise<void> {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed = JSON.parse(raw);\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n this.data = new Map(Object.entries(parsed));\n }\n } catch (e: unknown) {\n // Missing file or invalid JSON — start with empty store\n }\n }\n\n /** Write entire store to disk as JSON. Creates parent dirs if needed. */\n async flush(): Promise<void> {\n const obj = Object.fromEntries(this.data);\n const json = JSON.stringify(obj, null, 2);\n await mkdir(dirname(this.statePath), { recursive: true });\n await writeFile(this.statePath, json, \"utf-8\");\n }\n\n private notify(key: string, value: unknown): void {\n for (const sub of this.subscribers) {\n if (sub.regex.test(key)) {\n sub.handler(key, value);\n }\n }\n }\n}\n","import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { ConnectorManager } from \"@skaile/workspaces/connectors\";\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { PluginStore } from \"./store.js\";\n\n/**\n * Construction options for {@link WorkspacePlugin}.\n *\n * At minimum `projectDir` must be supplied. All other fields are optional\n * and are pre-resolved by the caller when available (e.g. the runner already\n * knows `driver`/`provider`/`model` from its own settings resolution).\n *\n * @docLink packages/workspace-plugin/concepts#workspaceplugin-lifecycle\n */\nexport interface WorkspacePluginOpts {\n projectDir: string;\n /**\n * Active connector manager. The unified `ConnectorManager` owns both\n * filesystem-face (mountable) and tool-face connectors.\n */\n connectorManager?: ConnectorManager;\n bootOwned?: boolean;\n onLog?: (msg: string) => void;\n /** Pre-resolved driver type (avoids needing boot() to read settings). */\n driver?: string;\n /** Pre-resolved provider. */\n provider?: string;\n /** Pre-resolved model. */\n model?: string;\n}\n\n/**\n * Shared runtime core for the skaile workspace plugin.\n *\n * Manages the full lifecycle (`boot` → tools available → `shutdown`) and\n * surfaces workspace capabilities — mounts, connectors, flows, skills,\n * sessions, and config validation — through two adapter backends:\n *\n * - **MCP, in-process** (runner): call {@link buildWorkspaceMcpServer} for the\n * Claude Agent SDK server the runner embeds into its `query()` call.\n * - **MCP, stdio** (`skaile mcp-server`): call {@link runMcpServerStdio} for a\n * raw `@modelcontextprotocol/sdk` server — no Claude Agent SDK.\n * - **OMP**: call {@link buildOmpToolSet} for the 13-tool native subset and\n * {@link buildOmpExtensionSource} for the generated extension file.\n *\n * Two boot modes are supported via {@link WorkspacePluginOpts.bootOwned}:\n * - `bootOwned: false` (default) — managers injected externally by the runner.\n * - `bootOwned: true` — plugin owns the full manager lifecycle (standalone MCP\n * subprocess or OMP extension).\n *\n * @docLink packages/workspace-plugin/concepts#workspaceplugin-lifecycle\n */\nexport class WorkspacePlugin {\n readonly projectDir: string;\n connectorManager: ConnectorManager | null;\n readonly store: PluginStore;\n\n private readonly bootOwned: boolean;\n private readonly onLog: (msg: string) => void;\n private readonly log: Logger = createLogger({\n kind: \"mcp\",\n subkind: \"skaile-workspace\",\n });\n driver?: string;\n provider?: string;\n model?: string;\n\n constructor(opts: WorkspacePluginOpts) {\n this.projectDir = opts.projectDir;\n this.connectorManager = opts.connectorManager ?? null;\n this.store = new PluginStore(join(opts.projectDir, \".skaile\", \"plugin-state.json\"));\n this.bootOwned = opts.bootOwned ?? false;\n if (opts.driver) this.driver = opts.driver;\n if (opts.provider) this.provider = opts.provider;\n if (opts.model) this.model = opts.model;\n this.onLog = opts.onLog ?? (() => {});\n this.log.debug(\"plugin constructed\", {\n driver: opts.driver,\n hasConnectors: !!opts.connectorManager,\n provider: opts.provider,\n model: opts.model,\n bootOwned: this.bootOwned,\n });\n }\n\n async boot(): Promise<void> {\n if (!this.bootOwned) {\n // Managers were injected externally — resolve settings only (non-fatal)\n try {\n const { resolveSettings } = await import(\"@skaile/workspaces/core\");\n const settings = await resolveSettings(this.projectDir);\n this.driver = settings.driver ?? \"omp\";\n this.provider = settings.provider;\n this.model = settings.model;\n } catch {\n /* non-fatal */\n }\n await this.store.load();\n return;\n }\n\n // bootOwned: we own the managers lifecycle\n try {\n const { resolveSettings } = await import(\"@skaile/workspaces/core\");\n const settings = await resolveSettings(this.projectDir);\n this.driver = settings.driver ?? \"omp\";\n this.provider = settings.provider;\n this.model = settings.model;\n } catch {\n /* non-fatal */\n }\n\n try {\n const {\n ConnectorManager,\n loadConnectorDeclarations,\n registerBuiltinConnectors,\n createCliSecretProviderChain,\n } = await import(\"@skaile/workspaces/connectors\");\n\n registerBuiltinConnectors();\n\n const secrets = createCliSecretProviderChain();\n\n const connectorDecls = await loadConnectorDeclarations(this.projectDir);\n const cm = new ConnectorManager(this.projectDir, { secrets });\n await cm.connectAll(connectorDecls);\n this.connectorManager = cm;\n\n this.log.info(\"workspace plugin booted\", {\n connectors: connectorDecls.length,\n });\n this.onLog(`WorkspacePlugin booted: ${connectorDecls.length} connectors`);\n } catch (err) {\n this.log.warn(\"workspace plugin boot warning\", {\n error: err instanceof Error ? err.message : String(err),\n });\n this.onLog(`WorkspacePlugin boot warning: ${err}`);\n }\n\n await this.store.load();\n }\n\n async reload(): Promise<void> {\n if (!this.bootOwned) return;\n await this.shutdown();\n await this.boot();\n }\n\n async shutdown(): Promise<void> {\n this.log.info(\"workspace plugin shutdown\");\n await this.store.flush();\n if (!this.bootOwned) return;\n try {\n await (this.connectorManager as any)?.disconnectAll?.();\n } catch {\n /* best-effort */\n }\n this.connectorManager = null;\n }\n\n buildSystemPromptSection(driver?: string): string {\n const d = driver ?? this.driver ?? \"unknown\";\n // The unified ConnectorManager owns both mountable (filesystem-face) and\n // tool-face connectors. Filesystem-face connectors expose a `mountPath`.\n const all = (this.connectorManager as any)?.listConnectors?.() ?? [];\n const mounts = (all as any[]).filter((c) => typeof c.mountPath === \"string\");\n const connectors = (all as any[]).filter((c) => typeof c.mountPath !== \"string\");\n const lines = [\"## Workspace (skaile)\", \"\", `Driver: ${d}`, `Project: ${this.projectDir}`];\n if (mounts.length > 0) {\n lines.push(\"\", \"Mounts:\");\n for (const v of mounts) {\n lines.push(` · ${v.id} (${v.driver}) → ${v.mountPath ?? \"(unmounted)\"}`);\n }\n }\n if (connectors.length > 0) {\n lines.push(\"\", \"Connectors:\");\n for (const c of connectors) {\n lines.push(` · ${c.id} (${c.driver})`);\n }\n }\n lines.push(\"\", \"Use workspace_info for full details. Use workspace_validate to check health.\");\n\n for (const name of [\"SOUL.md\", \"RULES.md\"]) {\n const skaileOverride = join(this.projectDir, \".skaile\", name);\n const rootFile = join(this.projectDir, name);\n for (const candidate of [skaileOverride, rootFile]) {\n try {\n const content = readFileSync(candidate, \"utf-8\").trim();\n if (content) {\n lines.push(\"\", `## ${name.replace(\".md\", \"\")}`, \"\", content);\n break;\n }\n } catch {\n // file not found, try next\n }\n }\n }\n\n return lines.join(\"\\n\");\n }\n\n /**\n * Build the in-process Claude Agent SDK MCP server (runner embedding).\n * Returns `null` when `@anthropic-ai/claude-agent-sdk` is unavailable.\n */\n async buildWorkspaceMcpServer(): Promise<unknown | null> {\n this.log.info(\"building workspace MCP server\");\n try {\n const { buildWorkspaceMcpServer } = await import(\"./adapters/mcp.js\");\n const server = await buildWorkspaceMcpServer(this);\n if (server) this.log.info(\"workspace MCP server ready\");\n else this.log.debug(\"workspace MCP server skipped (no tools)\");\n return server;\n } catch (err) {\n this.log.error(\"workspace MCP server build failed\", err);\n throw err;\n }\n }\n\n /**\n * Build the raw `@modelcontextprotocol/sdk` stdio MCP server — no Claude\n * Agent SDK. Used by the `skaile mcp-server` subprocess. The returned\n * server is not yet connected to a transport.\n */\n async buildWorkspaceMcpStdioServer(): Promise<unknown> {\n this.log.info(\"building workspace stdio MCP server\");\n const { buildWorkspaceMcpStdioServer } = await import(\"./adapters/mcp.js\");\n return buildWorkspaceMcpStdioServer(this);\n }\n\n /**\n * Build and run the stdio MCP server: builds the raw\n * `@modelcontextprotocol/sdk` server and connects a `StdioServerTransport`.\n * Used by the `skaile mcp-server` subprocess.\n */\n async runMcpServerStdio(): Promise<void> {\n this.log.info(\"starting workspace stdio MCP server\");\n const { runMcpServerStdio } = await import(\"./adapters/mcp.js\");\n await runMcpServerStdio(this);\n }\n\n async buildOmpToolSet(): Promise<unknown[]> {\n const { buildOmpToolSet } = await import(\"./adapters/omp.js\");\n return buildOmpToolSet(this);\n }\n\n async buildOmpExtensionSource(): Promise<string> {\n const { buildOmpExtensionSource } = await import(\"./adapters/omp.js\");\n return buildOmpExtensionSource(this.projectDir);\n }\n\n async handleSlashCommand(group: string, args: string[]): Promise<string> {\n const { handleSlashCommand } = await import(\"./adapters/omp.js\");\n return handleSlashCommand(this, group, args);\n }\n}\n","// utils/project-dir.ts\n// Centralised project-directory resolution used by all plugin entry points.\n\n/**\n * Resolve the skaile project directory from environment variables.\n *\n * Resolution order:\n * 1. `SKAILE_PROJECT_DIR` (always checked first)\n * 2. Any additional env var keys supplied by the caller (in order)\n * 3. `process.cwd()` as final fallback\n *\n * @param additionalEnvVars - Optional list of extra environment variable names\n * to check before falling back to `process.cwd()`.\n * @returns Absolute path to the resolved project directory.\n *\n * @example\n * // Claude Code — also checks CLAUDE_PROJECT_DIR\n * const projectDir = resolveProjectDir([\"CLAUDE_PROJECT_DIR\"]);\n *\n * // OMP / standalone — SKAILE_PROJECT_DIR or cwd only\n * const projectDir = resolveProjectDir();\n *\n * @docLink packages/workspace-plugin/concepts#workspaceplugin-lifecycle\n */\nexport function resolveProjectDir(additionalEnvVars?: string[]): string {\n if (process.env.SKAILE_PROJECT_DIR) return process.env.SKAILE_PROJECT_DIR;\n for (const key of additionalEnvVars ?? []) {\n const val = process.env[key];\n if (val) return val;\n }\n return process.cwd();\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../workspace-plugin/src/adapters/claude-code.ts","../workspace-plugin/src/store.ts","../workspace-plugin/src/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,IAAA,OAAO,kBAAA,CAAmB,IAAA,EAAM,KAAA,EAAO,IAAI,CAAA;AAAA,EAC7C;AACF;;;AC1OO,SAAS,kBAAkB,iBAAA,EAAsC;AACtE,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,kBAAA,EAAoB,OAAO,QAAQ,GAAA,CAAI,kBAAA;AACvD,EAAA,KAAA,MAAW,GAAA,IAAO,iBAAA,IAAqB,EAAC,EAAG;AACzC,IAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,GAAA,CAAI,GAAG,CAAA;AAC3B,IAAA,IAAI,KAAK,OAAO,GAAA;AAAA,EAClB;AACA,EAAA,OAAO,QAAQ,GAAA,EAAI;AACrB","file":"chunk-Z5PO7ZVP.js","sourcesContent":["// ── Claude Code plugin-directory generator (STATELESS) ──────────────────────\n// Generates the contents of a Claude Code plugin directory\n// (`.claude/plugins/skaile/`) as an in-memory file map. No plugin instance or\n// boot() is required — safe to call from install commands.\n//\n// The previous standalone `@skaile/workspace-plugin-claude` package shipped\n// these as static files plus loose `.mjs` hook scripts; they are now\n// CLI-owned templates. Hooks invoke the `skaile` binary directly\n// (`skaile plugin hook <event>`) and MCP runs via `skaile mcp-server` — no\n// generated script files, no shebang, no runtime assumption.\n\n/**\n * The Claude Code plugin manifest. `name` is `skaile`; `hooks` and\n * `mcpServers` point at sibling files in the generated directory.\n */\nconst PLUGIN_JSON = {\n name: \"skaile\",\n version: \"0.1.0\",\n description: \"Skaile workspace — connectors, mounts, skills, flows, shared state\",\n author: { name: \"skaile-ai\", url: \"https://github.com/skaile-ai\" },\n repository: \"https://github.com/skaile-ai/workspaces\",\n keywords: [\"skaile\", \"connectors\", \"workspace\", \"ai-assets\"],\n hooks: \"./hooks/hooks.json\",\n mcpServers: \"./.mcp.json\",\n userConfig: {\n skaile_yaml_path: {\n type: \"string\",\n title: \"skaile.yaml path\",\n description: \"Override path to skaile.yaml (default: auto-detect from project root)\",\n },\n },\n};\n\n/**\n * Hook wiring. Each lifecycle event invokes the `skaile` binary directly —\n * no loose `.mjs` scripts. `skaile plugin hook <event>` resolves the project\n * directory itself (`CLAUDE_PROJECT_DIR` / cwd) and always exits 0.\n */\nconst HOOKS_JSON = {\n hooks: {\n SessionStart: [{ hooks: [{ type: \"command\", command: \"skaile plugin hook session-start\" }] }],\n SessionEnd: [{ hooks: [{ type: \"command\", command: \"skaile plugin hook session-end\" }] }],\n UserPromptSubmit: [\n { hooks: [{ type: \"command\", command: \"skaile plugin hook user-prompt-submit\" }] },\n ],\n },\n};\n\n/**\n * MCP server wiring. Spawns `skaile mcp-server` — a stdio MCP subprocess that\n * runs on plain Node (no Claude Agent SDK).\n */\nconst MCP_JSON = {\n mcpServers: {\n \"skaile-workspace\": {\n command: \"skaile\",\n args: [\"mcp-server\"],\n env: {},\n },\n },\n};\n\n/**\n * Build the Claude Code plugin directory as an in-memory file map.\n *\n * Returns `{ relativePath: contents }` for every file the installer must\n * write under `<projectDir>/.claude/plugins/skaile/`. The installer is also\n * responsible for populating `skills/` from the project's `.skaile/skills/`.\n *\n * Stateless — no plugin instance, no `boot()`. The generated artifacts carry\n * no project-specific paths: hooks and the MCP server resolve the project\n * directory themselves at runtime.\n *\n * @returns A map of plugin-relative file paths to their string contents.\n *\n * @docLink packages/workspace-plugin/concepts#adapters\n */\nexport function buildClaudePluginFiles(): Record<string, string> {\n return {\n \".claude-plugin/plugin.json\": `${JSON.stringify(PLUGIN_JSON, null, 2)}\\n`,\n \"hooks/hooks.json\": `${JSON.stringify(HOOKS_JSON, null, 2)}\\n`,\n \".mcp.json\": `${JSON.stringify(MCP_JSON, null, 2)}\\n`,\n \"skills/.gitkeep\": \"\",\n };\n}\n","import { readFile, writeFile, mkdir } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\n\ninterface Subscriber {\n regex: RegExp;\n handler: (key: string, value: unknown) => void;\n}\n\n/**\n * Disk-backed reactive key-value store for plugin state.\n *\n * Keeps an in-memory map that can be flushed to / loaded from a JSON file.\n * Supports glob-style subscriptions (`connector:*`, `*`).\n *\n * State is persisted to `<projectDir>/.skaile/plugin-state.json`.\n * The instance is available on {@link WorkspacePlugin} as the public `store`\n * field after `boot()` resolves.\n *\n * @docLink packages/workspace-plugin/concepts#plugin-store\n */\nexport class PluginStore {\n private readonly statePath: string;\n private data: Map<string, unknown> = new Map();\n private subscribers: Subscriber[] = [];\n\n constructor(statePath: string) {\n this.statePath = statePath;\n }\n\n /** Synchronous read from in-memory map. */\n get<T>(key: string): T | undefined {\n return this.data.get(key) as T | undefined;\n }\n\n /** Write to in-memory map and notify matching subscribers. */\n set<T>(key: string, value: T): void {\n this.data.set(key, value);\n this.notify(key, value);\n }\n\n /** Remove key and notify matching subscribers. */\n delete(key: string): void {\n this.data.delete(key);\n this.notify(key, undefined);\n }\n\n /**\n * Subscribe to changes matching a glob-style pattern.\n * `*` matches any sequence of characters.\n * Returns an unsubscribe function.\n */\n subscribe(pattern: string, handler: (key: string, value: unknown) => void): () => void {\n const escaped = pattern.replace(/[.+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const regexStr = `^${escaped.replace(/\\*/g, \".*\")}$`;\n const sub: Subscriber = { regex: new RegExp(regexStr), handler };\n this.subscribers.push(sub);\n\n return () => {\n const idx = this.subscribers.indexOf(sub);\n if (idx !== -1) this.subscribers.splice(idx, 1);\n };\n }\n\n /** Rehydrate from disk JSON. Missing file = empty store (no throw). */\n async load(): Promise<void> {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed = JSON.parse(raw);\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n this.data = new Map(Object.entries(parsed));\n }\n } catch (e: unknown) {\n // Missing file or invalid JSON — start with empty store\n }\n }\n\n /** Write entire store to disk as JSON. Creates parent dirs if needed. */\n async flush(): Promise<void> {\n const obj = Object.fromEntries(this.data);\n const json = JSON.stringify(obj, null, 2);\n await mkdir(dirname(this.statePath), { recursive: true });\n await writeFile(this.statePath, json, \"utf-8\");\n }\n\n private notify(key: string, value: unknown): void {\n for (const sub of this.subscribers) {\n if (sub.regex.test(key)) {\n sub.handler(key, value);\n }\n }\n }\n}\n","import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { ConnectorManager } from \"@skaile/workspaces/connectors\";\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { PluginStore } from \"./store.js\";\n\n/**\n * Construction options for {@link WorkspacePlugin}.\n *\n * At minimum `projectDir` must be supplied. All other fields are optional\n * and are pre-resolved by the caller when available (e.g. the runner already\n * knows `driver`/`provider`/`model` from its own settings resolution).\n *\n * @docLink packages/workspace-plugin/concepts#workspaceplugin-lifecycle\n */\nexport interface WorkspacePluginOpts {\n projectDir: string;\n /**\n * Active connector manager. The unified `ConnectorManager` owns both\n * filesystem-face (mountable) and tool-face connectors.\n */\n connectorManager?: ConnectorManager;\n bootOwned?: boolean;\n onLog?: (msg: string) => void;\n /** Pre-resolved driver type (avoids needing boot() to read settings). */\n driver?: string;\n /** Pre-resolved provider. */\n provider?: string;\n /** Pre-resolved model. */\n model?: string;\n}\n\n/**\n * Shared runtime core for the skaile workspace plugin.\n *\n * Manages the full lifecycle (`boot` → tools available → `shutdown`) and\n * surfaces workspace capabilities — mounts, connectors, flows, skills,\n * sessions, and config validation — through two adapter backends:\n *\n * - **MCP, in-process** (runner): call {@link buildWorkspaceMcpServer} for the\n * Claude Agent SDK server the runner embeds into its `query()` call.\n * - **MCP, stdio** (`skaile mcp-server`): call {@link runMcpServerStdio} for a\n * raw `@modelcontextprotocol/sdk` server — no Claude Agent SDK.\n * - **OMP**: call {@link buildOmpToolSet} for the 13-tool native subset and\n * {@link buildOmpExtensionSource} for the generated extension file.\n *\n * Two boot modes are supported via {@link WorkspacePluginOpts.bootOwned}:\n * - `bootOwned: false` (default) — managers injected externally by the runner.\n * - `bootOwned: true` — plugin owns the full manager lifecycle (standalone MCP\n * subprocess or OMP extension).\n *\n * @docLink packages/workspace-plugin/concepts#workspaceplugin-lifecycle\n */\nexport class WorkspacePlugin {\n readonly projectDir: string;\n connectorManager: ConnectorManager | null;\n readonly store: PluginStore;\n\n private readonly bootOwned: boolean;\n private readonly onLog: (msg: string) => void;\n private readonly log: Logger = createLogger({\n kind: \"mcp\",\n subkind: \"skaile-workspace\",\n });\n driver?: string;\n provider?: string;\n model?: string;\n\n constructor(opts: WorkspacePluginOpts) {\n this.projectDir = opts.projectDir;\n this.connectorManager = opts.connectorManager ?? null;\n this.store = new PluginStore(join(opts.projectDir, \".skaile\", \"plugin-state.json\"));\n this.bootOwned = opts.bootOwned ?? false;\n if (opts.driver) this.driver = opts.driver;\n if (opts.provider) this.provider = opts.provider;\n if (opts.model) this.model = opts.model;\n this.onLog = opts.onLog ?? (() => {});\n this.log.debug(\"plugin constructed\", {\n driver: opts.driver,\n hasConnectors: !!opts.connectorManager,\n provider: opts.provider,\n model: opts.model,\n bootOwned: this.bootOwned,\n });\n }\n\n async boot(): Promise<void> {\n if (!this.bootOwned) {\n // Managers were injected externally — resolve settings only (non-fatal)\n try {\n const { resolveSettings } = await import(\"@skaile/workspaces/core\");\n const settings = await resolveSettings(this.projectDir);\n this.driver = settings.driver ?? \"omp\";\n this.provider = settings.provider;\n this.model = settings.model;\n } catch {\n /* non-fatal */\n }\n await this.store.load();\n return;\n }\n\n // bootOwned: we own the managers lifecycle\n try {\n const { resolveSettings } = await import(\"@skaile/workspaces/core\");\n const settings = await resolveSettings(this.projectDir);\n this.driver = settings.driver ?? \"omp\";\n this.provider = settings.provider;\n this.model = settings.model;\n } catch {\n /* non-fatal */\n }\n\n try {\n const {\n ConnectorManager,\n loadConnectorDeclarations,\n registerBuiltinConnectors,\n createCliSecretProviderChain,\n } = await import(\"@skaile/workspaces/connectors\");\n\n registerBuiltinConnectors();\n\n const secrets = createCliSecretProviderChain();\n\n const connectorDecls = await loadConnectorDeclarations(this.projectDir);\n const cm = new ConnectorManager(this.projectDir, { secrets });\n await cm.connectAll(connectorDecls);\n this.connectorManager = cm;\n\n this.log.info(\"workspace plugin booted\", {\n connectors: connectorDecls.length,\n });\n this.onLog(`WorkspacePlugin booted: ${connectorDecls.length} connectors`);\n } catch (err) {\n this.log.warn(\"workspace plugin boot warning\", {\n error: err instanceof Error ? err.message : String(err),\n });\n this.onLog(`WorkspacePlugin boot warning: ${err}`);\n }\n\n await this.store.load();\n }\n\n async reload(): Promise<void> {\n if (!this.bootOwned) return;\n await this.shutdown();\n await this.boot();\n }\n\n async shutdown(): Promise<void> {\n this.log.info(\"workspace plugin shutdown\");\n await this.store.flush();\n if (!this.bootOwned) return;\n try {\n await (this.connectorManager as any)?.disconnectAll?.();\n } catch {\n /* best-effort */\n }\n this.connectorManager = null;\n }\n\n buildSystemPromptSection(driver?: string): string {\n const d = driver ?? this.driver ?? \"unknown\";\n // The unified ConnectorManager owns both mountable (filesystem-face) and\n // tool-face connectors. Filesystem-face connectors expose a `mountPath`.\n const all = (this.connectorManager as any)?.listConnectors?.() ?? [];\n const mounts = (all as any[]).filter((c) => typeof c.mountPath === \"string\");\n const connectors = (all as any[]).filter((c) => typeof c.mountPath !== \"string\");\n const lines = [\"## Workspace (skaile)\", \"\", `Driver: ${d}`, `Project: ${this.projectDir}`];\n if (mounts.length > 0) {\n lines.push(\"\", \"Mounts:\");\n for (const v of mounts) {\n lines.push(` · ${v.id} (${v.driver}) → ${v.mountPath ?? \"(unmounted)\"}`);\n }\n }\n if (connectors.length > 0) {\n lines.push(\"\", \"Connectors:\");\n for (const c of connectors) {\n lines.push(` · ${c.id} (${c.driver})`);\n }\n }\n lines.push(\"\", \"Use workspace_info for full details. Use workspace_validate to check health.\");\n\n for (const name of [\"SOUL.md\", \"RULES.md\"]) {\n const skaileOverride = join(this.projectDir, \".skaile\", name);\n const rootFile = join(this.projectDir, name);\n for (const candidate of [skaileOverride, rootFile]) {\n try {\n const content = readFileSync(candidate, \"utf-8\").trim();\n if (content) {\n lines.push(\"\", `## ${name.replace(\".md\", \"\")}`, \"\", content);\n break;\n }\n } catch {\n // file not found, try next\n }\n }\n }\n\n return lines.join(\"\\n\");\n }\n\n /**\n * Build the in-process Claude Agent SDK MCP server (runner embedding).\n * Returns `null` when `@anthropic-ai/claude-agent-sdk` is unavailable.\n */\n async buildWorkspaceMcpServer(): Promise<unknown | null> {\n this.log.info(\"building workspace MCP server\");\n try {\n const { buildWorkspaceMcpServer } = await import(\"./adapters/mcp.js\");\n const server = await buildWorkspaceMcpServer(this);\n if (server) this.log.info(\"workspace MCP server ready\");\n else this.log.debug(\"workspace MCP server skipped (no tools)\");\n return server;\n } catch (err) {\n this.log.error(\"workspace MCP server build failed\", err);\n throw err;\n }\n }\n\n /**\n * Build the raw `@modelcontextprotocol/sdk` stdio MCP server — no Claude\n * Agent SDK. Used by the `skaile mcp-server` subprocess. The returned\n * server is not yet connected to a transport.\n */\n async buildWorkspaceMcpStdioServer(): Promise<unknown> {\n this.log.info(\"building workspace stdio MCP server\");\n const { buildWorkspaceMcpStdioServer } = await import(\"./adapters/mcp.js\");\n return buildWorkspaceMcpStdioServer(this);\n }\n\n /**\n * Build and run the stdio MCP server: builds the raw\n * `@modelcontextprotocol/sdk` server and connects a `StdioServerTransport`.\n * Used by the `skaile mcp-server` subprocess.\n */\n async runMcpServerStdio(): Promise<void> {\n this.log.info(\"starting workspace stdio MCP server\");\n const { runMcpServerStdio } = await import(\"./adapters/mcp.js\");\n await runMcpServerStdio(this);\n }\n\n async buildOmpToolSet(): Promise<unknown[]> {\n const { buildOmpToolSet } = await import(\"./adapters/omp.js\");\n return buildOmpToolSet(this);\n }\n\n async buildOmpExtensionSource(): Promise<string> {\n const { buildOmpExtensionSource } = await import(\"./adapters/omp.js\");\n return buildOmpExtensionSource(this.projectDir);\n }\n\n async handleSlashCommand(group: string, args: string[]): Promise<string> {\n const { handleSlashCommand } = await import(\"./adapters/omp.js\");\n return handleSlashCommand(this, group, args);\n }\n}\n","// utils/project-dir.ts\n// Centralised project-directory resolution used by all plugin entry points.\n\n/**\n * Resolve the skaile project directory from environment variables.\n *\n * Resolution order:\n * 1. `SKAILE_PROJECT_DIR` (always checked first)\n * 2. Any additional env var keys supplied by the caller (in order)\n * 3. `process.cwd()` as final fallback\n *\n * @param additionalEnvVars - Optional list of extra environment variable names\n * to check before falling back to `process.cwd()`.\n * @returns Absolute path to the resolved project directory.\n *\n * @example\n * // Claude Code — also checks CLAUDE_PROJECT_DIR\n * const projectDir = resolveProjectDir([\"CLAUDE_PROJECT_DIR\"]);\n *\n * // OMP / standalone — SKAILE_PROJECT_DIR or cwd only\n * const projectDir = resolveProjectDir();\n *\n * @docLink packages/workspace-plugin/concepts#workspaceplugin-lifecycle\n */\nexport function resolveProjectDir(additionalEnvVars?: string[]): string {\n if (process.env.SKAILE_PROJECT_DIR) return process.env.SKAILE_PROJECT_DIR;\n for (const key of additionalEnvVars ?? []) {\n const val = process.env[key];\n if (val) return val;\n }\n return process.cwd();\n}\n"]}
|
package/dist/cli/index.js
CHANGED
|
@@ -8,11 +8,11 @@ import { resolveLibraryDir } from '../chunk-42OQF7UU.js';
|
|
|
8
8
|
import '../chunk-R7FOF242.js';
|
|
9
9
|
import '../chunk-GKIA2PU5.js';
|
|
10
10
|
import '../chunk-OKRUTSG7.js';
|
|
11
|
-
import { runFlow, resumeFlow } from '../chunk-
|
|
11
|
+
import { runFlow, resumeFlow } from '../chunk-XYEFV7XN.js';
|
|
12
12
|
import '../chunk-GCJXPUHG.js';
|
|
13
13
|
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-IPUYL6TD.js';
|
|
14
|
-
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-
|
|
15
|
-
import { buildClaudePluginFiles } from '../chunk-
|
|
14
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-34333Z5H.js';
|
|
15
|
+
import { buildClaudePluginFiles } from '../chunk-Z5PO7ZVP.js';
|
|
16
16
|
import '../chunk-X5YPJV4N.js';
|
|
17
17
|
import '../chunk-O7SG5PC2.js';
|
|
18
18
|
import '../chunk-W2O5LWYU.js';
|
|
@@ -20,24 +20,24 @@ import '../chunk-7PTP3SQJ.js';
|
|
|
20
20
|
import '../chunk-PBWMV5GM.js';
|
|
21
21
|
import '../chunk-W3UDISS2.js';
|
|
22
22
|
import '../chunk-TDSRLMDB.js';
|
|
23
|
-
import '../chunk-
|
|
23
|
+
import '../chunk-VMU2WEN7.js';
|
|
24
24
|
import '../chunk-EWP5HZBV.js';
|
|
25
25
|
import '../chunk-KOVLSBXK.js';
|
|
26
26
|
import '../chunk-RRVQAE5D.js';
|
|
27
|
-
import '../chunk-
|
|
27
|
+
import '../chunk-YOFKTALB.js';
|
|
28
28
|
import '../chunk-LV2HPH3C.js';
|
|
29
|
-
import '../chunk-
|
|
29
|
+
import '../chunk-EAJKY27M.js';
|
|
30
30
|
import '../chunk-W75ASXH4.js';
|
|
31
|
-
import '../chunk-
|
|
31
|
+
import '../chunk-6MB7CRME.js';
|
|
32
32
|
import '../chunk-GCRKAFH7.js';
|
|
33
33
|
import { loadAllFlows } from '../chunk-ICS76R4T.js';
|
|
34
34
|
import '../chunk-GZWJGNNN.js';
|
|
35
35
|
import '../chunk-FVTV7M76.js';
|
|
36
|
-
import { AssetManager } from '../chunk-
|
|
36
|
+
import { AssetManager } from '../chunk-EARKGKKB.js';
|
|
37
37
|
import '../chunk-M2NLRGIX.js';
|
|
38
38
|
import '../chunk-KTBKW2FI.js';
|
|
39
39
|
import '../chunk-UQ6LFBPZ.js';
|
|
40
|
-
import '../chunk-
|
|
40
|
+
import '../chunk-YHXBQLXX.js';
|
|
41
41
|
import '../chunk-DIKFRNCS.js';
|
|
42
42
|
import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync } from '../chunk-4RUVG5GX.js';
|
|
43
43
|
import '../chunk-JKNWJ64A.js';
|
|
@@ -5646,7 +5646,7 @@ program.command("init [project-dir]").description("Initialize a project director
|
|
|
5646
5646
|
}
|
|
5647
5647
|
);
|
|
5648
5648
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
5649
|
-
const { cmdSetup } = await import('../setup-
|
|
5649
|
+
const { cmdSetup } = await import('../setup-QAOUBECX.js');
|
|
5650
5650
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
5651
5651
|
});
|
|
5652
5652
|
program.addCommand(makeInstallCommand());
|
package/dist/connectors/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AbstractConnector, ConnectorFieldMissingError, ConnectorManager, ConnectorStartupError, FlowAdapter, LogBuffer, ManagedGitconfigCollisionError, atomicReplaceCredential, buildConnectorPromptSection, buildSdkConnectorTools, createFsWatcher, createWorktree, defaultSpawn, findGitRoot, findMissingPackages, getConnector, installNpmPackages, isPackageResolvable, listConnectors, listWorktrees, registerBuiltinConnectors, registerConnector, removeMountBlock, renderCredentialHelperScript, tryGetConnector, worktreeRegistry, writeHelperScript, writeMountBlock } from '../chunk-
|
|
1
|
+
export { AbstractConnector, ConnectorFieldMissingError, ConnectorManager, ConnectorStartupError, FlowAdapter, LogBuffer, ManagedGitconfigCollisionError, atomicReplaceCredential, buildConnectorPromptSection, buildSdkConnectorTools, createFsWatcher, createWorktree, defaultSpawn, findGitRoot, findMissingPackages, getConnector, installNpmPackages, isPackageResolvable, listConnectors, listWorktrees, registerBuiltinConnectors, registerConnector, removeMountBlock, renderCredentialHelperScript, tryGetConnector, worktreeRegistry, writeHelperScript, writeMountBlock } from '../chunk-EAJKY27M.js';
|
|
2
2
|
export { EnvSecretProvider, ForgeSecretProvider, InMemorySecretProvider, LegacyAuthGrammarError, LockedSecretProvider, OAuthRequiredError, PreMintedSecretProvider, SecretProviderChain, createCliSecretProviderChain, createForgeSecretProviderChain, loadConnectorDeclarations, resolveAuth, resolveAuthRef, resolveBackendAuthFor } from '../chunk-W75ASXH4.js';
|
|
3
|
-
export { PortPool, RcloneProcessManager } from '../chunk-
|
|
3
|
+
export { PortPool, RcloneProcessManager, ensureDirMode } from '../chunk-6MB7CRME.js';
|
|
4
4
|
export { renderOneDriveConfig, renderWebDAVConfig } from '../chunk-GCRKAFH7.js';
|
|
5
5
|
import '../chunk-ICS76R4T.js';
|
|
6
6
|
import '../chunk-GZWJGNNN.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { RcloneProcessManager, _routeRcloneLogLine } from '../chunk-
|
|
1
|
+
export { RcloneProcessManager, _routeRcloneLogLine } from '../chunk-6MB7CRME.js';
|
|
2
2
|
import '../chunk-NSBPE2FW.js';
|
|
3
3
|
//# sourceMappingURL=rclone.js.map
|
|
4
4
|
//# sourceMappingURL=rclone.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared filesystem helpers for connector infrastructure.
|
|
3
|
+
*
|
|
4
|
+
* @docLink packages/connectors/api-reference#fs-utils
|
|
5
|
+
*/
|
|
6
|
+
import type { Logger } from "@skaile/workspaces/types";
|
|
7
|
+
/**
|
|
8
|
+
* mkdir(recursive) + chmod 0o770 in one call. The post-mkdir `chmod` is the
|
|
9
|
+
* load-bearing piece: `mkdir(mode:)` is ANDed with the process umask
|
|
10
|
+
* (typically 022 → effective mode 0o750), which strips the group-write bit
|
|
11
|
+
* that `fusermount3` requires on the rclone mountpoint and rclone needs on
|
|
12
|
+
* its vfs cache directory. Explicit `chmod` is umask-immune.
|
|
13
|
+
*
|
|
14
|
+
* EPERM on `chmod` is swallowed: when a foreign uid pre-created the
|
|
15
|
+
* directory (a stray uid-1000 process inside the container or a host-side
|
|
16
|
+
* platform process writing through the project bind-mount), the runner
|
|
17
|
+
* cannot chmod it. The platform's agent container entrypoint runs as root
|
|
18
|
+
* and heals the subtree on the next restart — see
|
|
19
|
+
* `platform/docker/agent/entrypoint.sh` `_skaile_heal_ownership`. A debug
|
|
20
|
+
* line is emitted when a logger is supplied so the rare-but-real heal
|
|
21
|
+
* trigger is observable in session logs without adding noise on the happy
|
|
22
|
+
* path.
|
|
23
|
+
*
|
|
24
|
+
* The chmod is *idempotent* (the syscall always fires, but a no-op when
|
|
25
|
+
* the mode is already 0o770), not a no-op — kernel behaviour for chmod is
|
|
26
|
+
* "set", not "set-if-different".
|
|
27
|
+
*
|
|
28
|
+
* @param dir Absolute or relative path to ensure exists at mode 0o770.
|
|
29
|
+
* @param log Optional logger. When provided, EPERM-on-chmod emits a
|
|
30
|
+
* `debug`-level entry under whatever taxonomy the caller's logger uses.
|
|
31
|
+
*/
|
|
32
|
+
export declare function ensureDirMode(dir: string, log?: Logger): Promise<void>;
|
|
33
|
+
//# sourceMappingURL=fs-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs-utils.d.ts","sourceRoot":"","sources":["../../../connectors/src/fs-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU5E"}
|
|
@@ -25,6 +25,7 @@ export { buildConnectorPromptSection, buildSdkConnectorTools, } from "./connecto
|
|
|
25
25
|
export { getConnector, listConnectors, registerBuiltinConnectors, registerConnector, tryGetConnector, } from "./connector-registry.js";
|
|
26
26
|
export type { ConnectContext, Connector, ConnectorChangeEvent, ConnectorDeclaration, ConnectorFactory, ConnectorFieldSpec, ConnectorHandle, ConnectorInfo, ConnectorReport, ConnectorStartupReport, FieldType, FilesystemFace, OperationDescriptor, RuntimeSkillDescriptor, TokenMediator, TokenMediatorResult, ToolFace, } from "./connector-types.js";
|
|
27
27
|
export { ConnectorFieldMissingError, ConnectorStartupError } from "./connector-types.js";
|
|
28
|
+
export { ensureDirMode } from "./fs-utils.js";
|
|
28
29
|
export { LogBuffer } from "./log-buffer.js";
|
|
29
30
|
export type { RenderHelperOpts } from "./credential-helper-script.js";
|
|
30
31
|
export { renderCredentialHelperScript } from "./credential-helper-script.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../connectors/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACV,yBAAyB,EACzB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,cAAc,EACd,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,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2BAA2B,EAC3B,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rclone-process-manager.d.ts","sourceRoot":"","sources":["../../../connectors/src/rclone-process-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"rclone-process-manager.d.ts","sourceRoot":"","sources":["../../../connectors/src/rclone-process-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAOvD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,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L_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, emitSystemPromptComposed, ensureGitConfigInclude, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
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, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-34333Z5H.js';
|
|
2
|
+
import '../chunk-Z5PO7ZVP.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-W2O5LWYU.js';
|
|
@@ -7,15 +7,15 @@ import '../chunk-7PTP3SQJ.js';
|
|
|
7
7
|
import '../chunk-PBWMV5GM.js';
|
|
8
8
|
export { assembleSystemPrompt, buildCapabilitiesPromptSection, buildLinkedPeersPromptSection } from '../chunk-W3UDISS2.js';
|
|
9
9
|
import '../chunk-TDSRLMDB.js';
|
|
10
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-VMU2WEN7.js';
|
|
11
11
|
import '../chunk-EWP5HZBV.js';
|
|
12
12
|
import '../chunk-KOVLSBXK.js';
|
|
13
13
|
import '../chunk-RRVQAE5D.js';
|
|
14
|
-
import '../chunk-
|
|
14
|
+
import '../chunk-YOFKTALB.js';
|
|
15
15
|
import '../chunk-LV2HPH3C.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-EAJKY27M.js';
|
|
17
17
|
import '../chunk-W75ASXH4.js';
|
|
18
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-6MB7CRME.js';
|
|
19
19
|
import '../chunk-GCRKAFH7.js';
|
|
20
20
|
import '../chunk-ICS76R4T.js';
|
|
21
21
|
import '../chunk-GZWJGNNN.js';
|
|
@@ -0,0 +1,74 @@
|
|
|
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).
|
|
18
|
+
*
|
|
19
|
+
* @docLink packages/runner/dev-guide#ai-credential-mediation
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Safety margin between the scheduled refresh and the token's declared
|
|
23
|
+
* expiry. Default 5 minutes: long enough that any in-flight prompt at
|
|
24
|
+
* fire time still has a usable token, short enough that a server clock
|
|
25
|
+
* skew of a few seconds does not push the fire-time past expiry.
|
|
26
|
+
*/
|
|
27
|
+
export declare const PROACTIVE_AI_REFRESH_MARGIN_MS: number;
|
|
28
|
+
/**
|
|
29
|
+
* Caller-supplied side effects the scheduler invokes.
|
|
30
|
+
*
|
|
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.
|
|
35
|
+
* - `now()` is dependency-injected for deterministic timer tests; defaults
|
|
36
|
+
* to `Date.now`.
|
|
37
|
+
* - `setTimeoutImpl` / `clearTimeoutImpl` are injected for fake-timer
|
|
38
|
+
* tests; default to the host's `setTimeout` / `clearTimeout`.
|
|
39
|
+
*/
|
|
40
|
+
export interface AiCredentialRefreshDeps {
|
|
41
|
+
refresh: () => Promise<string | null | undefined>;
|
|
42
|
+
log: (line: string) => void;
|
|
43
|
+
now?: () => number;
|
|
44
|
+
setTimeoutImpl?: (handler: () => void, ms: number) => {
|
|
45
|
+
unref?: () => void;
|
|
46
|
+
};
|
|
47
|
+
clearTimeoutImpl?: (handle: {
|
|
48
|
+
unref?: () => void;
|
|
49
|
+
}) => void;
|
|
50
|
+
marginMs?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface AiCredentialRefreshScheduler {
|
|
53
|
+
/**
|
|
54
|
+
* Arm the timer for `expiresAtIso - marginMs`. Cancels any prior pending
|
|
55
|
+
* 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.
|
|
58
|
+
*/
|
|
59
|
+
schedule(expiresAtIso: string | null | undefined): void;
|
|
60
|
+
/** Cancel any pending fire. Idempotent. */
|
|
61
|
+
cancel(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Whether a timer is currently armed. Exposed for tests; production
|
|
64
|
+
* callers should not need this.
|
|
65
|
+
*/
|
|
66
|
+
isPending(): boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build a scheduler bound to the supplied dependencies. One scheduler
|
|
70
|
+
* per session — the runner constructs it once at session_init and
|
|
71
|
+
* disposes via `cancel()` during cleanup.
|
|
72
|
+
*/
|
|
73
|
+
export declare function createAiCredentialRefreshScheduler(deps: AiCredentialRefreshDeps): AiCredentialRefreshScheduler;
|
|
74
|
+
//# sourceMappingURL=ai-credential-refresh.d.ts.map
|
|
@@ -0,0 +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,GAC5B,4BAA4B,CA8E9B"}
|
|
@@ -47,4 +47,25 @@ export declare function writeClaudeCodeCredentialsFile(home: string, json: strin
|
|
|
47
47
|
* § "Runner-side handling on 401" (now bridge-side).
|
|
48
48
|
*/
|
|
49
49
|
export declare function mergeAndRewriteCredentialsFile(home: string, accessToken: string, expiresAt?: string | null): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Extract the access-token expiry from a raw Claude Code credentials JSON
|
|
52
|
+
* blob. Supports both the nested `claudeAiOauth.expiresAt` shape the
|
|
53
|
+
* platform writes at provision time and an optional top-level `expiresAt`
|
|
54
|
+
* field used by some SDK builds.
|
|
55
|
+
*
|
|
56
|
+
* Returns `null` when the field is missing, empty, or not a parseable
|
|
57
|
+
* date — callers treat `null` as "static token, don't schedule a
|
|
58
|
+
* proactive refresh". Tolerates both ISO-8601 strings and millisecond
|
|
59
|
+
* epochs (some Claude Code builds emit the epoch; normalise to ISO so
|
|
60
|
+
* downstream code has one format to reason about).
|
|
61
|
+
*
|
|
62
|
+
* Used by the runner's proactive AI-credential refresh scheduler in
|
|
63
|
+
* `serve.ts` to compute the next refresh fire time after a fresh
|
|
64
|
+
* credential lands (initial provision OR `host.refresh_credential`
|
|
65
|
+
* response). The runner never mutates the credentials blob; this is a
|
|
66
|
+
* pure read.
|
|
67
|
+
*
|
|
68
|
+
* @docLink packages/runner/dev-guide#ai-credential-mediation
|
|
69
|
+
*/
|
|
70
|
+
export declare function extractClaudeAiOauthExpiresAt(json: string): string | null;
|
|
50
71
|
//# 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"}
|
|
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"}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* transport setup, and lifecycle command handling.
|
|
32
32
|
*/
|
|
33
33
|
import type { AgentEvent, ServerTransport } from "@skaile/workspaces/types";
|
|
34
|
-
import { CLAUDE_CODE_CREDENTIALS_KEY, writeClaudeCodeCredentialsFile } from "./serve-credentials.js";
|
|
34
|
+
import { CLAUDE_CODE_CREDENTIALS_KEY, extractClaudeAiOauthExpiresAt, writeClaudeCodeCredentialsFile } from "./serve-credentials.js";
|
|
35
35
|
import { type AgentSession } from "./session-builder.js";
|
|
36
36
|
/**
|
|
37
37
|
* Emit a `system_prompt_composed` event carrying the labeled section
|
|
@@ -60,7 +60,7 @@ export declare function emitSystemPromptComposed(agentSession: AgentSession, sen
|
|
|
60
60
|
*
|
|
61
61
|
* @docLink packages/runner/dev-guide#environment-variables
|
|
62
62
|
*/
|
|
63
|
-
export { CLAUDE_CODE_CREDENTIALS_KEY, writeClaudeCodeCredentialsFile };
|
|
63
|
+
export { CLAUDE_CODE_CREDENTIALS_KEY, extractClaudeAiOauthExpiresAt, writeClaudeCodeCredentialsFile, };
|
|
64
64
|
/**
|
|
65
65
|
* Idempotently ensure `~/.gitconfig` includes the runner-managed gitconfig
|
|
66
66
|
* via `[include] path = <managedGitconfigPath>`. Fallback path for shells
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../runner/src/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"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EAAE,eAAe,CAAC;CAC7B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAkiExE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { AssetManager } from '../chunk-
|
|
1
|
+
export { AssetManager } from '../chunk-EARKGKKB.js';
|
|
2
2
|
export { createScaffold, deployAll, removeAsset } from '../chunk-M2NLRGIX.js';
|
|
3
3
|
export { appendHistory, clearHistory, getRecentHistory, loadHistory } from '../chunk-KTBKW2FI.js';
|
|
4
4
|
import '../chunk-UQ6LFBPZ.js';
|
|
5
|
-
export { listTemplates, scaffoldWorkspace, setTemplatesDir } from '../chunk-
|
|
5
|
+
export { listTemplates, scaffoldWorkspace, setTemplatesDir } from '../chunk-YHXBQLXX.js';
|
|
6
6
|
import '../chunk-DIKFRNCS.js';
|
|
7
7
|
import '../chunk-4RUVG5GX.js';
|
|
8
8
|
import '../chunk-JKNWJ64A.js';
|
package/dist/sdk/bridge.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { BridgeRuntime, EventNormalizer, createRuntime, detectFileChange, detectFileChanges, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-
|
|
1
|
+
export { BridgeRuntime, EventNormalizer, createRuntime, detectFileChange, detectFileChanges, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-VMU2WEN7.js';
|
|
2
2
|
export { AuthError, classifyClaudeSdkError } from '../chunk-EWP5HZBV.js';
|
|
3
3
|
export { STATIC_MODELS, fetchProviderModels, getModels, getStaticModels } from '../chunk-KOVLSBXK.js';
|
|
4
4
|
export { dispatchCapability, filterRenderCapabilities, renderFallback } from '../chunk-RRVQAE5D.js';
|
|
5
|
-
export { AgentDriver, DRIVER_CATALOG, createDriver, getBridgeLogger, listDrivers, listModelsForDriver, loadDriver, registerDriver } from '../chunk-
|
|
5
|
+
export { AgentDriver, DRIVER_CATALOG, createDriver, getBridgeLogger, listDrivers, listModelsForDriver, loadDriver, registerDriver } from '../chunk-YOFKTALB.js';
|
|
6
6
|
import '../chunk-24UIWON4.js';
|
|
7
7
|
import '../chunk-NSBPE2FW.js';
|
|
8
8
|
//# sourceMappingURL=bridge.js.map
|
package/dist/sdk/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { startAgentServer } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { startAgentServer } from '../chunk-34333Z5H.js';
|
|
2
|
+
import '../chunk-Z5PO7ZVP.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-W2O5LWYU.js';
|
|
@@ -8,15 +8,15 @@ import '../chunk-PBWMV5GM.js';
|
|
|
8
8
|
import '../chunk-W3UDISS2.js';
|
|
9
9
|
import '../chunk-TDSRLMDB.js';
|
|
10
10
|
import { AgentClient } from '../chunk-SZ3SIVZQ.js';
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-VMU2WEN7.js';
|
|
12
12
|
import '../chunk-EWP5HZBV.js';
|
|
13
13
|
import '../chunk-KOVLSBXK.js';
|
|
14
14
|
import '../chunk-RRVQAE5D.js';
|
|
15
|
-
import '../chunk-
|
|
15
|
+
import '../chunk-YOFKTALB.js';
|
|
16
16
|
import '../chunk-LV2HPH3C.js';
|
|
17
|
-
import '../chunk-
|
|
17
|
+
import '../chunk-EAJKY27M.js';
|
|
18
18
|
import '../chunk-W75ASXH4.js';
|
|
19
|
-
import '../chunk-
|
|
19
|
+
import '../chunk-6MB7CRME.js';
|
|
20
20
|
import '../chunk-GCRKAFH7.js';
|
|
21
21
|
import '../chunk-ICS76R4T.js';
|
|
22
22
|
import '../chunk-GZWJGNNN.js';
|
package/dist/sdk/runner.js
CHANGED
|
@@ -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, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, emitSystemPromptComposed, ensureGitConfigInclude, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
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, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-34333Z5H.js';
|
|
2
|
+
import '../chunk-Z5PO7ZVP.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-W2O5LWYU.js';
|
|
@@ -7,15 +7,15 @@ import '../chunk-7PTP3SQJ.js';
|
|
|
7
7
|
import '../chunk-PBWMV5GM.js';
|
|
8
8
|
export { assembleSystemPrompt, buildCapabilitiesPromptSection, buildLinkedPeersPromptSection } from '../chunk-W3UDISS2.js';
|
|
9
9
|
import '../chunk-TDSRLMDB.js';
|
|
10
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-VMU2WEN7.js';
|
|
11
11
|
import '../chunk-EWP5HZBV.js';
|
|
12
12
|
import '../chunk-KOVLSBXK.js';
|
|
13
13
|
import '../chunk-RRVQAE5D.js';
|
|
14
|
-
import '../chunk-
|
|
14
|
+
import '../chunk-YOFKTALB.js';
|
|
15
15
|
import '../chunk-LV2HPH3C.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-EAJKY27M.js';
|
|
17
17
|
import '../chunk-W75ASXH4.js';
|
|
18
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-6MB7CRME.js';
|
|
19
19
|
import '../chunk-GCRKAFH7.js';
|
|
20
20
|
import '../chunk-ICS76R4T.js';
|
|
21
21
|
import '../chunk-GZWJGNNN.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { validateApiKey } from './chunk-
|
|
1
|
+
import { validateApiKey } from './chunk-VMU2WEN7.js';
|
|
2
2
|
import './chunk-EWP5HZBV.js';
|
|
3
3
|
import { getModels } from './chunk-KOVLSBXK.js';
|
|
4
4
|
import './chunk-RRVQAE5D.js';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-YOFKTALB.js';
|
|
6
6
|
import { ALL_PROVIDERS, detectEnvApiKeys, resolveSettings, maskApiKey, providerEnvKey, projectSettingsPath, loadSettings, WorkspaceYamlEditor, saveSettings } from './chunk-4RUVG5GX.js';
|
|
7
7
|
import './chunk-JKNWJ64A.js';
|
|
8
8
|
import './chunk-O4JH3KUE.js';
|
|
@@ -484,5 +484,5 @@ async function cmdSetup(_args, opts) {
|
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
export { cmdSetup };
|
|
487
|
-
//# sourceMappingURL=setup-
|
|
488
|
-
//# sourceMappingURL=setup-
|
|
487
|
+
//# sourceMappingURL=setup-QAOUBECX.js.map
|
|
488
|
+
//# sourceMappingURL=setup-QAOUBECX.js.map
|