@skaile/workspaces 1.6.1 → 1.8.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.
- package/CHANGELOG.md +76 -0
- package/dist/{asset-feeds-PTZBWJEL.js → asset-feeds-Y66NCOQZ.js} +4 -4
- package/dist/{asset-feeds-PTZBWJEL.js.map → asset-feeds-Y66NCOQZ.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/chunk-34U5UC6G.js +284 -0
- package/dist/chunk-34U5UC6G.js.map +1 -0
- package/dist/{chunk-EA73UA42.js → chunk-35OWUKOD.js} +2 -2
- package/dist/{chunk-EA73UA42.js.map → chunk-35OWUKOD.js.map} +1 -1
- package/dist/{chunk-4OVPB7SI.js → chunk-6K6T2RBP.js} +6 -2
- package/dist/chunk-6K6T2RBP.js.map +1 -0
- package/dist/{chunk-M4UKIJ5K.js → chunk-M3Y5KM6F.js} +28 -13
- package/dist/chunk-M3Y5KM6F.js.map +1 -0
- package/dist/{chunk-Y5B5272E.js → chunk-MB6563TL.js} +16 -3
- package/dist/chunk-MB6563TL.js.map +1 -0
- package/dist/{chunk-SH55Z5QA.js → chunk-O3D4KYFG.js} +3 -3
- package/dist/{chunk-SH55Z5QA.js.map → chunk-O3D4KYFG.js.map} +1 -1
- package/dist/{chunk-SNN6O7ON.js → chunk-PP2LOT4W.js} +43 -7
- package/dist/chunk-PP2LOT4W.js.map +1 -0
- package/dist/{chunk-HIATVS2E.js → chunk-S74G7AZL.js} +3 -3
- package/dist/{chunk-HIATVS2E.js.map → chunk-S74G7AZL.js.map} +1 -1
- package/dist/{chunk-NTYCGPZ3.js → chunk-THJZ3JZE.js} +6 -6
- package/dist/{chunk-NTYCGPZ3.js.map → chunk-THJZ3JZE.js.map} +1 -1
- package/dist/{chunk-X7G2CCW4.js → chunk-TITPPC54.js} +3 -3
- package/dist/{chunk-X7G2CCW4.js.map → chunk-TITPPC54.js.map} +1 -1
- package/dist/{chunk-NRWDQBZ7.js → chunk-VBRXFLIP.js} +3 -3
- package/dist/{chunk-NRWDQBZ7.js.map → chunk-VBRXFLIP.js.map} +1 -1
- package/dist/{chunk-MY7TSVO7.js → chunk-Y3UCU4ZK.js} +6 -2
- package/dist/chunk-Y3UCU4ZK.js.map +1 -0
- package/dist/{chunk-OJ7G56I7.js → chunk-Y6FV73IH.js} +57 -3
- package/dist/chunk-Y6FV73IH.js.map +1 -0
- package/dist/cli/index.js +239 -387
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +12 -2
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/manage.d.ts.map +1 -1
- package/dist/cli/src/commands/publish-core.d.ts +24 -0
- package/dist/cli/src/commands/publish-core.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/remote-query.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/remote-tail.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/superjson-transformer.d.ts +12 -0
- package/dist/cli/src/commands/session-logs/superjson-transformer.d.ts.map +1 -0
- package/dist/cli/src/commands/source-manifest-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/store.d.ts.map +1 -1
- package/dist/cli/src/store-auth.d.ts +11 -0
- package/dist/cli/src/store-auth.d.ts.map +1 -1
- package/dist/cli/src/store-publisher.d.ts +24 -1
- package/dist/cli/src/store-publisher.d.ts.map +1 -1
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +2 -2
- package/dist/connectors/src/config.d.ts +21 -0
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +1 -1
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/{ensure-sources-ORACQA4I.js → ensure-sources-NXBYK5GP.js} +4 -4
- package/dist/{ensure-sources-ORACQA4I.js.map → ensure-sources-NXBYK5GP.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +2 -2
- package/dist/factory-assets/connectors/deploy.js +2 -2
- package/dist/factory-assets/connectors/devserver.js +2 -2
- package/dist/factory-assets/connectors/flow/adapter.js +2 -2
- package/dist/factory-assets/connectors/flow/run-flow.js +3 -3
- package/dist/factory-assets/connectors/flow.js +2 -2
- package/dist/factory-assets/connectors/git.js +2 -2
- package/dist/factory-assets/connectors/gmail.js +2 -2
- package/dist/factory-assets/connectors/googledrive.js +2 -2
- package/dist/factory-assets/connectors/local.js +2 -2
- package/dist/factory-assets/connectors/mattermost.js +2 -2
- package/dist/factory-assets/connectors/memory.js +2 -2
- package/dist/factory-assets/connectors/minio.js +2 -2
- package/dist/factory-assets/connectors/postgres.js +2 -2
- package/dist/factory-assets/connectors/s3.js +2 -2
- package/dist/factory-assets/connectors/sharepoint.js +2 -2
- package/dist/factory-assets/connectors/sqlite.js +2 -2
- package/dist/factory-assets/connectors/static-server.js +2 -2
- package/dist/factory-assets/connectors/tunnel.js +2 -2
- package/dist/factory-assets/connectors/webdav.js +2 -2
- package/dist/factory-assets/connectors/xstate-store.js +2 -2
- package/dist/factory-assets/connectors/xstate.js +2 -2
- package/dist/{helpers-SXGIHFCF.js → helpers-DN4MWOHB.js} +4 -4
- package/dist/{helpers-SXGIHFCF.js.map → helpers-DN4MWOHB.js.map} +1 -1
- package/dist/{library-publish-NQQFPOUY.js → library-publish-TPWFSO3Q.js} +24 -8
- package/dist/library-publish-TPWFSO3Q.js.map +1 -0
- package/dist/{open-library-ODW2PJ2J.js → open-library-ST2VFQTK.js} +5 -5
- package/dist/{open-library-ODW2PJ2J.js.map → open-library-ST2VFQTK.js.map} +1 -1
- package/dist/project-4M6QXHCH.js +28 -0
- package/dist/project-4M6QXHCH.js.map +1 -0
- package/dist/run-group-engine/index.d.ts +2 -0
- package/dist/run-group-engine/index.js +68 -0
- package/dist/run-group-engine/index.js.map +1 -0
- package/dist/run-group-engine/src/admit.d.ts +13 -0
- package/dist/run-group-engine/src/admit.d.ts.map +1 -0
- package/dist/run-group-engine/src/derive-instance-status.d.ts +9 -0
- package/dist/run-group-engine/src/derive-instance-status.d.ts.map +1 -0
- package/dist/run-group-engine/src/index.d.ts +5 -0
- package/dist/run-group-engine/src/index.d.ts.map +1 -0
- package/dist/run-group-engine/src/plan-retry.d.ts +11 -0
- package/dist/run-group-engine/src/plan-retry.d.ts.map +1 -0
- package/dist/run-group-engine/src/rollup.d.ts +16 -0
- package/dist/run-group-engine/src/rollup.d.ts.map +1 -0
- package/dist/runner/index.js +4 -4
- package/dist/runner/src/resources.d.ts +8 -2
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +10 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/index.js +4 -4
- package/dist/sdk/runner.js +4 -4
- package/dist/sdk/store.js +1 -1
- package/dist/{source-KPH66TXY.js → source-KUWAEJOO.js} +6 -6
- package/dist/{source-KPH66TXY.js.map → source-KUWAEJOO.js.map} +1 -1
- package/dist/{source-manifest-publish-HJ5G4CTH.js → source-manifest-publish-FTSKRYPI.js} +12 -10
- package/dist/source-manifest-publish-FTSKRYPI.js.map +1 -0
- package/dist/store/index.js +1 -1
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/tui/index.js +4 -4
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/run-group.d.ts +148 -0
- package/dist/types/src/run-group.d.ts.map +1 -0
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +7 -1
- package/dist/chunk-4OVPB7SI.js.map +0 -1
- package/dist/chunk-M4UKIJ5K.js.map +0 -1
- package/dist/chunk-MY7TSVO7.js.map +0 -1
- package/dist/chunk-OJ7G56I7.js.map +0 -1
- package/dist/chunk-SNN6O7ON.js.map +0 -1
- package/dist/chunk-Y5B5272E.js.map +0 -1
- package/dist/library-publish-NQQFPOUY.js.map +0 -1
- package/dist/source-manifest-publish-HJ5G4CTH.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { makeHttpPublisherClient, refFor, publishToStore, bareName } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import './chunk-
|
|
5
|
-
import { logErr, S, logInfo, logOk, logWarn } from './chunk-
|
|
1
|
+
import { makeHttpPublisherClient, refFor, publishToStore, bareName } from './chunk-PP2LOT4W.js';
|
|
2
|
+
import { sourceClonePath, resolveSourceArg } from './chunk-THJZ3JZE.js';
|
|
3
|
+
import { isStoreAuthenticated } from './chunk-MB6563TL.js';
|
|
4
|
+
import './chunk-TITPPC54.js';
|
|
5
|
+
import { logErr, S, logInfo, logOk, logWarn } from './chunk-O3D4KYFG.js';
|
|
6
6
|
import './chunk-4N5XR5DQ.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-Y3UCU4ZK.js';
|
|
8
8
|
import './chunk-MWE7DEGC.js';
|
|
9
9
|
import './chunk-MZV6WCF3.js';
|
|
10
10
|
import './chunk-JXT46QFC.js';
|
|
@@ -147,8 +147,10 @@ async function runPublish(arg, opts, client, spawn = spawnSync) {
|
|
|
147
147
|
}
|
|
148
148
|
let namespace;
|
|
149
149
|
if (opts.as) namespace = opts.as;
|
|
150
|
-
else if (authed)
|
|
151
|
-
|
|
150
|
+
else if (authed) {
|
|
151
|
+
const me = await pub.me();
|
|
152
|
+
namespace = me.githubLogin || me.username;
|
|
153
|
+
} else namespace = "<your store username>";
|
|
152
154
|
const normalized = normalizePublishedManifest(manifest, namespace);
|
|
153
155
|
const publishedText = encodeSkaileManifest(normalized);
|
|
154
156
|
const wouldBeRefs = (normalized.assets ?? []).map(
|
|
@@ -224,5 +226,5 @@ async function runYank(arg, opts, client) {
|
|
|
224
226
|
}
|
|
225
227
|
|
|
226
228
|
export { getSidecarRepo, normalizePublishedManifest, pushSidecarManifest, runPublish, runYank, saveSidecarRepo };
|
|
227
|
-
//# sourceMappingURL=source-manifest-publish-
|
|
228
|
-
//# sourceMappingURL=source-manifest-publish-
|
|
229
|
+
//# sourceMappingURL=source-manifest-publish-FTSKRYPI.js.map
|
|
230
|
+
//# sourceMappingURL=source-manifest-publish-FTSKRYPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../cli/src/commands/source-manifest-publish.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,IAAM,yBAAA,GAA4B,sBAAA;AAW3B,SAAS,0BAAA,CACd,UACA,SAAA,EACmB;AACnB,EAAA,MAAM,UAAU,QAAA,CAAS,MAAA,IAAU,EAAC,EAAG,GAAA,CAAI,CAAC,CAAA,KAAM;AAChD,IAAA,MAAM,EAAE,SAAA,EAAW,KAAA,EAAO,GAAG,MAAK,GAAI,CAAA;AACtC,IAAA,OAAO,IAAA;AAAA,EACT,CAAC,CAAA;AACD,EAAA,OAAO,EAAE,GAAG,QAAA,EAAU,SAAA,EAAW,WAAW,MAAA,EAAO;AACrD;AAWA,SAAS,YAAA,GAAuB;AAC9B,EAAA,MAAM,OAAO,OAAA,CAAQ,GAAA,CAAI,eAAe,IAAA,CAAK,OAAA,IAAW,SAAS,CAAA;AACjE,EAAA,OAAO,IAAA,CAAK,MAAM,eAAe,CAAA;AACnC;AAEA,SAAS,YAAA,GAAoC;AAC3C,EAAA,MAAM,OAAO,YAAA,EAAa;AAC1B,EAAA,IAAI,CAAC,UAAA,CAAW,IAAI,CAAA,SAAU,EAAC;AAC/B,EAAA,IAAI;AACF,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,YAAA,CAAa,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC/C,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF;AAMO,SAAS,eAAe,I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AAA,OACzF;AAAA,IACF;AAAA,EACF;AAEA,EAAA,KAAA,CAAM,CAAA,OAAA,EAAU,MAAA,CAAO,MAAM,CAAA,UAAA,CAAY,CAAA;AACzC,EAAA,KAAA,MAAW,CAAA,IAAK,MAAA,EAAQ,OAAA,CAAQ,CAAA,EAAA,EAAK,CAAC,CAAA,CAAE,CAAA;AAC1C","file":"source-manifest-publish-FTSKRYPI.js","sourcesContent":["/**\n * `skaile source manifest publish` / `yank` — the curator-publish flow. Takes a\n * locally-curated sidecar manifest (over a foreign public GitHub repo) and:\n *\n * 1. Pushes the curated `skaile.manifest.yaml` to the curator's OWN public\n * \"sidecar\" repo (bytes stay in the foreign source; the sidecar holds only\n * the manifest pointing at it).\n * 2. Registers the foreign source + the sidecar (url + pinned commit) with the\n * store, syncs it, and publishes each curated asset.\n *\n * `yank` is the inverse: unpublish each currently-published asset of the source.\n *\n * The store REST surface is reached through the injectable {@link PublisherClient}\n * (default HTTP client); git side-effects go through an injectable `spawn`. Both\n * seams keep the pure helpers + orchestration unit/integration-testable without a\n * live store or a real remote.\n *\n * @docLink cli/commands/source#manifest-publish\n */\n\nimport { spawnSync } from \"node:child_process\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\nimport {\n decodeSkaileManifest,\n encodeSkaileManifest,\n type SkPublishManifest,\n sourceCacheKey,\n} from \"@skaile/workspaces/core\";\nimport { logErr, logInfo, logOk, logWarn, S } from \"../helpers.ts\";\nimport { makeHttpPublisherClient, type PublisherClient } from \"../store-publisher.ts\";\nimport { isStoreAuthenticated } from \"../store-client.ts\";\nimport { bareName, publishToStore, refFor } from \"./publish-core.ts\";\nimport { sourceClonePath } from \"./source.ts\";\nimport { resolveSourceArg } from \"./source-manifest.ts\";\n\n/** The fixed filename a sidecar repo carries at its root. */\nconst SIDECAR_MANIFEST_FILENAME = \"skaile.manifest.yaml\";\n\n/** Injectable spawn contract — the subset of `spawnSync` these helpers use. */\ntype SpawnLike = typeof spawnSync;\n\n/**\n * Return a copy of `manifest` normalized for publication under `namespace`:\n * the top-level `publisher` is set to `namespace` and every per-asset\n * `publisher` override is removed so all assets inherit the top-level one.\n * Pure — the input is not mutated.\n */\nexport function normalizePublishedManifest(\n manifest: SkPublishManifest,\n namespace: string,\n): SkPublishManifest {\n const assets = (manifest.assets ?? []).map((a) => {\n const { publisher: _drop, ...rest } = a;\n return rest;\n });\n return { ...manifest, publisher: namespace, assets };\n}\n\n// ── Sidecar-repo association (~/.skaile/settings.json) ────────────────────────\n\n/**\n * Path to the user settings file — the same `~/.skaile/settings.json` the store\n * client reads tokens from. Resolves the `.skaile` root exactly as `getStoreRoot`\n * does (`SKAILE_HOME` when set — it IS the `.skaile` dir — else `~/.skaile`), so\n * the sidecar association lives beside the store manifests under one convention\n * and tests isolate through the same `SKAILE_HOME` seam.\n */\nfunction settingsFile(): string {\n const root = process.env.SKAILE_HOME ?? join(homedir(), \".skaile\");\n return join(root, \"settings.json\");\n}\n\nfunction readSettings(): Record<string, any> {\n const file = settingsFile();\n if (!existsSync(file)) return {};\n try {\n return JSON.parse(readFileSync(file, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\n/**\n * The sidecar repo URL previously associated with a source `slug`, if any.\n * Reads `settings.sidecarRepos?.[slug]?.repo`.\n */\nexport function getSidecarRepo(slug: string): string | undefined {\n const settings = readSettings();\n return settings.sidecarRepos?.[slug]?.repo;\n}\n\n/**\n * Persist the sidecar repo URL for a source `slug`, preserving every other\n * settings key. Stored as an object (`{ repo }`) so a `path` (or other fields)\n * can be added later without a schema migration.\n */\nexport function saveSidecarRepo(slug: string, repo: string): void {\n const file = settingsFile();\n mkdirSync(dirname(file), { recursive: true });\n const settings = readSettings();\n const sidecarRepos = { ...(settings.sidecarRepos ?? {}) };\n sidecarRepos[slug] = { ...(sidecarRepos[slug] ?? {}), repo };\n settings.sidecarRepos = sidecarRepos;\n writeFileSync(file, JSON.stringify(settings, null, 2), \"utf-8\");\n}\n\n// ── Sidecar push ──────────────────────────────────────────────────────────────\n\n/**\n * Run a git command in `cwd` via the injected spawn, throwing with the captured\n * stderr on failure. Returns trimmed stdout.\n */\nfunction git(spawn: SpawnLike, cwd: string, args: string[]): string {\n const res = spawn(\"git\", [\"-C\", cwd, ...args], { encoding: \"utf-8\" });\n if (res.status !== 0) {\n const stderr = (res.stderr ?? \"\").toString().trim();\n throw new Error(`git ${args.join(\" \")} failed: ${stderr || `exit ${res.status}`}`);\n }\n return (res.stdout ?? \"\").toString().trim();\n}\n\n/**\n * Clone the curator's sidecar repo, write the curated manifest at its root, and\n * commit + push. Returns the pushed commit sha (used to pin the store source).\n *\n * Idempotent re-publish: when the manifest is unchanged `git commit` fails with\n * \"nothing to commit\" — we swallow that and return the current HEAD so a no-op\n * re-run still yields a valid pin. Any push/auth failure surfaces as a thrown\n * Error carrying git's stderr.\n */\nexport function pushSidecarManifest(opts: {\n sidecarRepoUrl: string;\n manifestText: string;\n spawn?: SpawnLike;\n}): { commitSha: string } {\n const spawn = opts.spawn ?? spawnSync;\n // Dedicated dir next to the source clone cache; wipe any stale clone first so\n // a re-publish always starts from a clean shallow checkout of the remote.\n const cloneDir = `${sourceClonePath(sourceCacheKey(opts.sidecarRepoUrl))}-sidecar-push`;\n rmSync(cloneDir, { recursive: true, force: true });\n mkdirSync(dirname(cloneDir), { recursive: true });\n\n // The clone is scratch — always remove it afterwards (success or failure) so a\n // failed push never leaves a stale checkout in the cache dir.\n try {\n const cloneRes = spawn(\"git\", [\"clone\", \"--depth\", \"1\", opts.sidecarRepoUrl, cloneDir], {\n encoding: \"utf-8\",\n });\n if (cloneRes.status !== 0) {\n const stderr = (cloneRes.stderr ?? \"\").toString().trim();\n throw new Error(\n `git clone ${opts.sidecarRepoUrl} failed: ${stderr || `exit ${cloneRes.status}`}`,\n );\n }\n\n writeFileSync(join(cloneDir, SIDECAR_MANIFEST_FILENAME), opts.manifestText, \"utf-8\");\n git(spawn, cloneDir, [\"add\", SIDECAR_MANIFEST_FILENAME]);\n\n // Fixed bot identity via -c so the commit succeeds regardless of the curator's\n // git config (the sidecar push is a machine action, not authored work).\n const commitRes = spawn(\n \"git\",\n [\n \"-C\",\n cloneDir,\n \"-c\",\n \"user.email=publish@skaile.store\",\n \"-c\",\n \"user.name=skaile\",\n \"commit\",\n \"-m\",\n \"chore(sidecar): publish curated manifest\",\n ],\n { encoding: \"utf-8\" },\n );\n if (commitRes.status !== 0) {\n const out = `${commitRes.stdout ?? \"\"}${commitRes.stderr ?? \"\"}`;\n // Nothing changed → idempotent re-publish; keep the existing HEAD.\n if (!/nothing to commit/i.test(out)) {\n throw new Error(`git commit failed: ${out.trim() || `exit ${commitRes.status}`}`);\n }\n } else {\n // `push origin HEAD` (not a bare `push`) so a fresh sidecar repo with an\n // unborn/renamed default branch still gets its branch created on the remote.\n git(spawn, cloneDir, [\"push\", \"origin\", \"HEAD\"]);\n }\n\n return { commitSha: git(spawn, cloneDir, [\"rev-parse\", \"HEAD\"]) };\n } finally {\n rmSync(cloneDir, { recursive: true, force: true });\n }\n}\n\n// ── Orchestration ───────────────────────────────────────────────────────────\n\n/**\n * `source manifest publish <src>` — publish a curated sidecar manifest to the\n * store. See the module header for the full flow. Store calls go through\n * `client` (default HTTP); git side-effects through `spawn` (default\n * `spawnSync`). The auth gate is enforced only for the default HTTP client so\n * injected fakes bypass it.\n */\nexport async function runPublish(\n arg: string,\n opts: {\n projectDir: string;\n as?: string;\n sidecarRepo?: string;\n ref?: string;\n dryRun?: boolean;\n },\n client?: PublisherClient,\n spawn: SpawnLike = spawnSync,\n): Promise<void> {\n const injected = client !== undefined;\n const pub = client ?? makeHttpPublisherClient();\n\n const { url, slug, manifestFile } = resolveSourceArg(arg, opts.projectDir);\n\n if (!existsSync(manifestFile)) {\n logErr(\n `No curated manifest for \"${slug}\" at ${S.dim(manifestFile)} — ` +\n \"run `skaile source manifest init` first.\",\n );\n process.exit(1);\n }\n\n const { manifest, diagnostics } = decodeSkaileManifest(readFileSync(manifestFile, \"utf-8\"));\n if (diagnostics.some((d) => d.severity === \"error\")) {\n for (const d of diagnostics.filter((x) => x.severity === \"error\")) {\n logErr(`${d.code}: ${d.message}`);\n }\n logErr(\n \"The curated manifest has errors — fix them with `skaile source manifest edit` / \" +\n \"`verify` before publishing.\",\n );\n process.exit(1);\n }\n\n // A real publish makes store calls (+ `me()` when `--as` is omitted), so it\n // needs a token. `--dry-run` is an offline preview: never gate it on auth.\n const authed = injected || isStoreAuthenticated();\n if (!opts.dryRun && !authed) {\n logErr(\"Not signed in — run `skaile store login` first.\");\n process.exit(1);\n }\n\n // Namespace: `--as` wins; else the caller's verified identity. Prefer the\n // GitHub handle (`githubLogin`) over the store login (`username`) — for a user\n // whose login differs from their GitHub handle the login namespace may be\n // reserved (matches the CLI's `resolveLibraryPublisher` precedence). In an\n // unauthenticated dry-run we cannot call `me()`, so show a placeholder.\n let namespace: string;\n if (opts.as) namespace = opts.as;\n else if (authed) {\n const me = await pub.me();\n // `||` not `??`: an empty-string githubLogin (partially-connected account) is\n // not a usable namespace — fall back to the login rather than publish under \"\".\n namespace = me.githubLogin || me.username;\n } else namespace = \"<your store username>\";\n\n const normalized = normalizePublishedManifest(manifest, namespace);\n const publishedText = encodeSkaileManifest(normalized);\n\n const wouldBeRefs = (normalized.assets ?? []).map((a) =>\n refFor(a.kind, namespace, a.name, a.version ?? normalized.version),\n );\n\n if (opts.dryRun) {\n const sidecar = opts.sidecarRepo ?? getSidecarRepo(slug) ?? \"<none — pass --sidecar-repo>\";\n logInfo(`Publish plan for ${S.bold(slug)}:`);\n logInfo(` namespace: ${namespace}`);\n logInfo(` sidecar repo: ${sidecar}`);\n logInfo(` source ref: ${opts.ref ?? \"main\"}`);\n logInfo(` would publish ${wouldBeRefs.length} asset(s):`);\n for (const r of wouldBeRefs) logInfo(` ${r}`);\n return;\n }\n\n const sidecarRepoUrl = opts.sidecarRepo ?? getSidecarRepo(slug);\n if (!sidecarRepoUrl) {\n logErr(\n \"No sidecar repo associated with this source. Pass \" +\n `${S.cmd(\"--sidecar-repo https://github.com/<you>/<repo>\")} — it must be a ` +\n \"PUBLIC GitHub repo you own; the curated manifest is committed there and the \" +\n \"store pins to that commit.\",\n );\n process.exit(1);\n }\n if (opts.sidecarRepo) saveSidecarRepo(slug, sidecarRepoUrl);\n\n const { commitSha } = pushSidecarManifest({ sidecarRepoUrl, manifestText: publishedText, spawn });\n logOk(`Pushed curated manifest to ${S.dim(sidecarRepoUrl)} @ ${commitSha.slice(0, 10)}.`);\n\n // The FOREIGN repo's ref to ingest (branch/sha). Defaults to `main`.\n const sourceRef = opts.ref ?? \"main\";\n\n const { published } = await publishToStore({\n sourceUrl: url,\n ref: sourceRef,\n sidecar: { url: sidecarRepoUrl, ref: commitSha },\n manifest: normalized,\n client: pub,\n });\n\n if (published.length > 0) {\n logInfo(`Consumers can now install them with \\`skaile add ${published[0]}\\`.`);\n }\n}\n\n/**\n * `source manifest yank <src>` — unpublish the source's published assets (all,\n * or the single asset matching `opts.asset`'s name). Auth-gated like publish.\n */\nexport async function runYank(\n arg: string,\n opts: { projectDir: string; asset?: string },\n client?: PublisherClient,\n): Promise<void> {\n const injected = client !== undefined;\n const pub = client ?? makeHttpPublisherClient();\n\n const { url, slug } = resolveSourceArg(arg, opts.projectDir);\n\n if (!injected && !isStoreAuthenticated()) {\n logErr(\"Not signed in — run `skaile store login` first.\");\n process.exit(1);\n }\n\n const rows = await pub.sourcesList();\n const source = rows.find((r) => r.url === url);\n if (!source) {\n logErr(`Source \"${slug}\" is not registered in the store — nothing to yank.`);\n process.exit(1);\n }\n\n // Optionally narrow to a single asset by name (accept a bare name or a ref).\n const targetName = opts.asset ? bareName(opts.asset) : undefined;\n const candidates = (await pub.sourceCandidates(source.id)).filter(\n (c) => c.published && (!targetName || c.name === targetName),\n );\n if (candidates.length === 0) {\n logWarn(\"No published assets matched — nothing to yank.\");\n return;\n }\n\n const yanked: string[] = [];\n for (const c of candidates) {\n try {\n await pub.assetUnpublish(c.id);\n yanked.push(`${c.kind}:${c.name}`);\n } catch (err) {\n logWarn(\n `Failed to yank ${c.kind}:${c.name}: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n }\n\n logOk(`Yanked ${yanked.length} asset(s):`);\n for (const r of yanked) logInfo(` ${r}`);\n}\n"]}
|
package/dist/store/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../store/src/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EAGV,OAAO,EAGR,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;GASG;AACH,qBAAa,UAAW,YAAW,iBAAiB,CAAC,kBAAkB,CAAC;IACtE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,gBAAgB,CAA+C;IACvE,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,iBAAiB,CAAQ;IACjC,6EAA6E;IAC7E,OAAO,CAAC,YAAY,CAAmD;IACvE,4EAA4E;IAC5E,OAAO,CAAC,aAAa,CAAsC;IAC3D,kFAAkF;IAClF,OAAO,CAAC,wBAAwB,CAA8C;IAC9E,uEAAuE;IACvE,OAAO,CAAC,aAAa,CAAkC;IACvD,yDAAyD;IACzD,OAAO,CAAC,qBAAqB,CAA0C;IAEvE,OAAO,CAAC,SAAS,CAAmC;IACpD,OA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ACH,MAAM,IAAI,IAAI;IAUd;;;;;;;;OAQG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAQhE;;;;;;;;OAQG;IACH,IAAI,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI;IAI7B;;;;;;;OAOG;IACG,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB3C;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAOzC;;;;;;;OAOG;IACH,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAG9C;IAEF;;;;;;OAMG;IACH,WAAW,QAAO,kBAAkB,CAmBlC;IAIF;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAQf;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,UAAU,CACf,MAAM,EAAE,eAAe,EACvB,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE,GACzD,UAAU;IAcb,OAAO,CAAC,YAAY;IAqHpB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,OAAO;CAMhB"}
|
package/dist/tui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createAgentSession } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { createAgentSession } from '../chunk-M3Y5KM6F.js';
|
|
2
|
+
import '../chunk-35OWUKOD.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -14,8 +14,8 @@ import '../chunk-BMQKMOQY.js';
|
|
|
14
14
|
import '../chunk-GAH4YRCI.js';
|
|
15
15
|
import '../chunk-TNSCHS4I.js';
|
|
16
16
|
import '../chunk-LV2HPH3C.js';
|
|
17
|
-
import '../chunk-
|
|
18
|
-
import { loadConnectorDeclarations } from '../chunk-
|
|
17
|
+
import '../chunk-VBRXFLIP.js';
|
|
18
|
+
import { loadConnectorDeclarations } from '../chunk-Y6FV73IH.js';
|
|
19
19
|
import '../chunk-6E6PKKAD.js';
|
|
20
20
|
import '../chunk-4N5XR5DQ.js';
|
|
21
21
|
import '../chunk-DEYYRFQU.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { A2AMessageEvent, AgentError, AgentEvent, AgentEventType, AgentPhase, CompactionAttemptEvent, CompactionTrigger, ConfiguredEvent, ConnectorContent, ConnectorEntry, ConnectorInfo, ConnectorOperation, ConnectorQueryResponseEvent, ConnectorResponseEvent, ConnectorStatusEvent, ConnectorsAvailableEvent, DevServerEvent, ErrorCategory, ErrorEvent, FileChangeEvent, FinishedEvent, FlowBreadcrumbEvent, HandoffEvent, LifecycleCompleteEvent, LifecyclePhase, LifecycleResult, ListOptions, LogEntryEvent, McpServerInfo, MountChangedEvent, MountInfo, MountMountedEvent, MountSyncStatusEvent, MountUnmountedEvent, QuestionEvent, QuestionReplyEvent, ReactionAddedEvent, ReactionRemovedEvent, ResourceStatusEvent, RuntimeSessionEvent, SearchOptions, SecretsReadyEvent, SnapshotEvent, StateChangedEvent, StatusEvent, SubagentEvent, SyncStatusEvent, SyncStatusPhase, SystemPromptComposedEvent, SystemPromptSection, TextEvent, TokenUsage, ToolCallEvent, ToolResultEvent, TypingEvent, UserMessageEvent, } from "./events.js";
|
|
2
2
|
export type { ActiveFlowRehydration, Approval, ArtifactRef, FlowExecution, FlowExecutionStatus, FormField, InputChoice, InputRequest, InputSchema, NodeError, NodeExecution, NodeExecutionSnapshot, NodeOutput, NodeStatus, } from "./flow.js";
|
|
3
|
+
export type { InputBinding, InputEnvelope, InstanceStatus, PrincipalRef, RunGroup, RunGroupMode, RunGroupPolicy, RunGroupStatus, RunInstance, RunInstanceError, RunInstanceMetrics, RunTemplate, TriggerSource, WorkspaceRecipe, } from "./run-group.js";
|
|
3
4
|
export type { InstallManifest } from "./install-manifest.js";
|
|
4
5
|
export type { LogEntry, Logger, LogKind, LogLevel, LogQuery, LogQueryResult, LogSink, LogSource, LogStoreConfig, LogStoreMode, LogStoreRetention, NormalizedError, } from "./logging.js";
|
|
5
6
|
export type { Mention, MentionGroup } from "./mentions.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,aAAa,EACb,UAAU,EACV,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,aAAa,EACb,eAAe,EACf,WAAW,EACX,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,qBAAqB,EACrB,QAAQ,EACR,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,EACT,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AO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,GAAG;IACxD,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,EAAE;QACX,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;QACpD;;;;WAIG;QACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;KAChC,CAAC;CACH,CAAC;AAEF,YAAY,EACV,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run-group contract - the fan-out / dark-automation layer shared between
|
|
3
|
+
* hosts (Skaile platform first; a CLI host later) and UI clients.
|
|
4
|
+
*
|
|
5
|
+
* A RunGroup is job control: one flow template executed N times across N
|
|
6
|
+
* inputs, each execution ("RunInstance") in its own isolated session. The
|
|
7
|
+
* flow-execution contract (`./flow.ts`) is the program INSIDE one instance;
|
|
8
|
+
* this contract schedules and aggregates across instances. The two are
|
|
9
|
+
* deliberately distinct - see docs/superpowers/specs/2026-07-16-run-group-contract-design.md.
|
|
10
|
+
*
|
|
11
|
+
* Live truth is owned by the HOST (there is no single runner for a group);
|
|
12
|
+
* the pure helpers in `@skaile/workspaces/run-group-engine` operate on these
|
|
13
|
+
* shapes without I/O.
|
|
14
|
+
*/
|
|
15
|
+
import type { ArtifactRef } from "./flow.js";
|
|
16
|
+
/** Where an input (and therefore an instance) may originate. */
|
|
17
|
+
export type TriggerSource = "manual" | "webhook" | "agent" | "schedule";
|
|
18
|
+
/**
|
|
19
|
+
* Host-interpreted declarative workspace/session configuration (the
|
|
20
|
+
* skaile.yaml shape: image, connectors, skills, model, egress, ...).
|
|
21
|
+
* Opaque at the contract level - hosts validate against their own config
|
|
22
|
+
* schema. Kept as a named alias so a stricter type can replace it without
|
|
23
|
+
* touching consumers.
|
|
24
|
+
*/
|
|
25
|
+
export type WorkspaceRecipe = Record<string, unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* Opaque principal reference. Hosts map to their identity model
|
|
28
|
+
* (Skaile platform: Keycloak role/group/userId). The framework never
|
|
29
|
+
* enforces authority - hosts do.
|
|
30
|
+
*/
|
|
31
|
+
export type PrincipalRef = string;
|
|
32
|
+
/**
|
|
33
|
+
* How one InputEnvelope reaches the flow inside an instance.
|
|
34
|
+
* `params` -> flow user_inputs/globals; `file` -> staged into the
|
|
35
|
+
* workspace; `both` -> both. `filePath` is required whenever files are
|
|
36
|
+
* staged (`file` / `both`).
|
|
37
|
+
*/
|
|
38
|
+
export type InputBinding = {
|
|
39
|
+
as: "params";
|
|
40
|
+
/** JSONPath from the payload to a flow param, e.g. `{ contractId: "$.id" }`. */
|
|
41
|
+
paramMap?: Record<string, string>;
|
|
42
|
+
} | {
|
|
43
|
+
as: "file";
|
|
44
|
+
/** Stage location inside the workspace, e.g. `input/contract.pdf`. */
|
|
45
|
+
filePath: string;
|
|
46
|
+
} | {
|
|
47
|
+
as: "both";
|
|
48
|
+
/** JSONPath from the payload to a flow param, e.g. `{ contractId: "$.id" }`. */
|
|
49
|
+
paramMap?: Record<string, string>;
|
|
50
|
+
/** Stage location inside the workspace, e.g. `input/contract.pdf`. */
|
|
51
|
+
filePath: string;
|
|
52
|
+
};
|
|
53
|
+
export interface RunTemplate {
|
|
54
|
+
/** Asset ref, e.g. `flow:@getec/contract-migration`. */
|
|
55
|
+
flow: string;
|
|
56
|
+
/** Pinned at group creation (same rule as startFlow). */
|
|
57
|
+
flowVersion: string;
|
|
58
|
+
workspace: WorkspaceRecipe;
|
|
59
|
+
inputBinding: InputBinding;
|
|
60
|
+
}
|
|
61
|
+
export interface RunGroupPolicy {
|
|
62
|
+
/** Admission cap: max instances in `spawning`/`running` at once. */
|
|
63
|
+
maxParallel: number;
|
|
64
|
+
/** Passed to each instance's startFlow. */
|
|
65
|
+
autonomousMode: boolean;
|
|
66
|
+
/** Automatic re-queue budget per instance. */
|
|
67
|
+
maxRetries: number;
|
|
68
|
+
/** Minutes; host hard-kills and marks failed (kind: infra). */
|
|
69
|
+
instanceTimeout?: number;
|
|
70
|
+
/** EUR, decimal; host auto-pauses the group at the cap. */
|
|
71
|
+
maxBudget?: number;
|
|
72
|
+
/** Allowed input sources; default `['manual']`. */
|
|
73
|
+
triggers?: TriggerSource[];
|
|
74
|
+
/** Who may create/activate/resume the group. Host-enforced. */
|
|
75
|
+
startableBy?: PrincipalRef[];
|
|
76
|
+
/** Who may decide instance gates; drives inbox routing. Host-enforced. */
|
|
77
|
+
approvers?: PrincipalRef[];
|
|
78
|
+
}
|
|
79
|
+
export type RunGroupMode = "batch" | "standing";
|
|
80
|
+
/**
|
|
81
|
+
* `complete`/`failed`: batch only. `closed`: standing only.
|
|
82
|
+
*/
|
|
83
|
+
export type RunGroupStatus = "draft" | "active" | "paused" | "complete" | "failed" | "cancelled" | "closed";
|
|
84
|
+
export type InstanceStatus = "queued" | "spawning" | "running" | "awaiting_approval" | "awaiting_input" | "complete" | "failed" | "cancelled";
|
|
85
|
+
export interface RunGroup {
|
|
86
|
+
groupId: string;
|
|
87
|
+
name: string;
|
|
88
|
+
mode: RunGroupMode;
|
|
89
|
+
status: RunGroupStatus;
|
|
90
|
+
template: RunTemplate;
|
|
91
|
+
policy: RunGroupPolicy;
|
|
92
|
+
/** Derived by `rollup`; denormalized for display. */
|
|
93
|
+
counters: Record<InstanceStatus, number>;
|
|
94
|
+
createdAt: string;
|
|
95
|
+
/** Last snapshot write; debugging aid. */
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
/** userId | trigger endpoint id | agent. */
|
|
98
|
+
createdBy: string;
|
|
99
|
+
}
|
|
100
|
+
export interface InputEnvelope {
|
|
101
|
+
inputId: string;
|
|
102
|
+
/** JSON payload from webhook/UI/agent/schedule. */
|
|
103
|
+
payload: unknown;
|
|
104
|
+
/** Staged file refs. */
|
|
105
|
+
files?: string[];
|
|
106
|
+
source: TriggerSource;
|
|
107
|
+
/** At-least-once sender protection. Scope: per-group, group lifetime. */
|
|
108
|
+
dedupeKey?: string;
|
|
109
|
+
/**
|
|
110
|
+
* UTC ISO 8601 (Z-suffixed); admit() sorts lexicographically, non-UTC
|
|
111
|
+
* offsets would misorder.
|
|
112
|
+
*/
|
|
113
|
+
receivedAt: string;
|
|
114
|
+
}
|
|
115
|
+
export interface RunInstanceError {
|
|
116
|
+
message: string;
|
|
117
|
+
recoverable: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* `flow` = the flow failed on content; `infra` = container death,
|
|
120
|
+
* timeout, spawn failure. Same retry path today; kept distinct for
|
|
121
|
+
* backoff/alerting and the circuit breaker (which counts only `infra`).
|
|
122
|
+
*/
|
|
123
|
+
kind: "flow" | "infra";
|
|
124
|
+
}
|
|
125
|
+
export interface RunInstanceMetrics {
|
|
126
|
+
startedAt?: string;
|
|
127
|
+
completedAt?: string;
|
|
128
|
+
costTokens?: number;
|
|
129
|
+
/** EUR, decimal. */
|
|
130
|
+
costCurrency?: number;
|
|
131
|
+
}
|
|
132
|
+
export interface RunInstance {
|
|
133
|
+
instanceId: string;
|
|
134
|
+
groupId: string;
|
|
135
|
+
input: InputEnvelope;
|
|
136
|
+
status: InstanceStatus;
|
|
137
|
+
/** Host session id, set at spawning. */
|
|
138
|
+
sessionRef?: string;
|
|
139
|
+
/** Set once start_flow fires; the instance's `flow:${runId}` store. */
|
|
140
|
+
flowRunId?: string;
|
|
141
|
+
/** 1..maxRetries+1. */
|
|
142
|
+
attempt: number;
|
|
143
|
+
error?: RunInstanceError;
|
|
144
|
+
metrics?: RunInstanceMetrics;
|
|
145
|
+
/** Flow contract's ArtifactRef (`./flow.ts`). */
|
|
146
|
+
artifacts?: ArtifactRef[];
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=run-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-group.d.ts","sourceRoot":"","sources":["../../../types/src/run-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB;IACE,EAAE,EAAE,QAAQ,CAAC;IACb,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;CAClB,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,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AW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;IACtB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,iDAAiD;IACjD,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;CAC3B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { mountList, mountSync, mountStatus, mountRead, connectorList, connectorRead, connectorWrite, connectorSearch, connectorExec, connectorLoadSkill, connectorDescribe } from '../../chunk-26L2B6P6.js';
|
|
1
2
|
import { flowList, flowShow, flowListSessions, flowGetSession, flowFindFlowForSession } from '../../chunk-QHU6TM7D.js';
|
|
2
3
|
import { sessionList, sessionGet } from '../../chunk-R6O6YWU7.js';
|
|
3
4
|
import { skillList, skillListDomains, skillShow, skillSearch, skillCheckRequirements, skillGetPreamble } from '../../chunk-KY5NY7LB.js';
|
|
4
5
|
import '../../chunk-XCBG2KDC.js';
|
|
5
6
|
import { workspaceValidate, workspaceInfo, workspaceTestSecret, workspaceReload } from '../../chunk-ACXLKNIM.js';
|
|
6
|
-
import { mountList, mountSync, mountStatus, mountRead, connectorList, connectorRead, connectorWrite, connectorSearch, connectorExec, connectorLoadSkill, connectorDescribe } from '../../chunk-26L2B6P6.js';
|
|
7
7
|
import '../../chunk-GXC3TYMQ.js';
|
|
8
8
|
import '../../chunk-X5YPJV4N.js';
|
|
9
9
|
import '../../chunk-NSBPE2FW.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-
|
|
1
|
+
export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-35OWUKOD.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": "1.
|
|
3
|
+
"version": "1.8.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",
|
|
@@ -424,6 +424,12 @@
|
|
|
424
424
|
"import": "./dist/resolver/index.js",
|
|
425
425
|
"default": "./dist/resolver/index.js"
|
|
426
426
|
},
|
|
427
|
+
"./run-group-engine": {
|
|
428
|
+
"skaile-src": "./run-group-engine/src/index.ts",
|
|
429
|
+
"types": "./dist/run-group-engine/src/index.d.ts",
|
|
430
|
+
"import": "./dist/run-group-engine/index.js",
|
|
431
|
+
"default": "./dist/run-group-engine/index.js"
|
|
432
|
+
},
|
|
427
433
|
"./runner": {
|
|
428
434
|
"skaile-src": "./runner/src/index.ts",
|
|
429
435
|
"types": "./dist/runner/src/index.d.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../store/src/resource-client.ts","../store/src/store.ts"],"names":[],"mappings":";AAkBA,IAAM,kBAAA,GAAqB,GAAA;AAUpB,IAAM,iBAAN,MAA0E;AAAA,EAC9D,KAAA;AAAA,EACT,UAAgC,EAAC;AAAA,EACjC,cAAwC,EAAC;AAAA;AAAA,EAGjD,eAAA,uBAAoD,GAAA,EAAI;AAAA,EAEhD,SAAA,GAA2C,IAAA;AAAA,EAClC,UAAA,uBAAiB,GAAA,EAAgB;AAAA,EACjC,gBAAA,uBAAuB,GAAA,EAOtC;AAAA,EACe,WAAA;AAAA;AAAA;AAAA;AAAA,EAKjB,YAAY,SAAA,EAA2B;AACrC,IAAA,IAAA,CAAK,QAAQ,SAAA,CAAU,IAAA;AACvB,IAAA,IAAA,CAAK,WAAA,GAAc,UAAU,OAAA,CAAQ,CAAC,UAAU,IAAA,CAAK,YAAA,CAAa,KAAK,CAAC,CAAA;AAAA,EAC1E;AAAA;AAAA;AAAA,EAKA,IAAI,MAAA,GAA+B;AACjC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,EACd;AAAA;AAAA,EAGA,IAAI,UAAA,GAAuC;AACzC,IAAA,OAAO,IAAA,CAAK,WAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,IAAA,CAAK,WAAA,EAAqB,IAAA,EAAe,IAAA,EAA+C;AAC5F,IAAA,MAAM,WAAW,MAAM,IAAA,CAAK,SAAS,WAAA,EAAa,MAAA,EAAQ,MAA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AAA;AAClE,IAAA,IAAA,CAAK,cAAA,GAAiB,EAAA;AACtB,IAAA,IAAA,CAAK,iBAAA,GAAoB,IAAA;AAAA,EAC3B;AAAA,EAEQ,cAAA,CAAe,SAAoC,QAAA,EAAyB;AAClF,IAAA,IAAA,CAAK,IAAA,EAAA;AACL,IAAA,IAAA,CAAK,SAAA,GAAY;AAAA,MACf,GAAG,IAAA,CAAK,SAAA;AAAA,MACR;AAAA,QACE,EAAA,EAAI,OAAO,UAAA,EAAW;AAAA,QACtB,KAAK,IAAA,CAAK,IAAA;AAAA,QACV,SAAA,EAAA,iBAAW,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAAA,QAClC,SAAA,EAAW,KAAK,QAAA,CAAS,SAAA;AAAA,QACzB,GAAI,QAAA,GAAW,EAAE,QAAA,KAAa,EAAC;AAAA,QAC/B;AAAA;AACF,KACF;AAAA,EACF;AAAA,EAEQ,OAAA,GAAgB;AACtB,IAAA,IAAA,CAAK,SAAA,GAAY,IAAA;AACjB,IAAA,KAAA,MAAW,QAAA,IAAY,KAAK,UAAA,EAAY;AACtC,MAAA,QAAA,EAAS;AAAA,IACX;AAAA,EACF;AACF","file":"chunk-4OVPB7SI.js","sourcesContent":["import type {\n AgentEvent,\n ConnectorContent,\n ConnectorEntry,\n ConnectorInfo,\n ConnectorResponseEvent,\n ConnectorStatusEvent,\n ListOptions,\n MountInfo,\n SearchOptions,\n} from \"@skaile/workspaces/types\";\nimport type {\n ConnectorStatus,\n ResourceClientSnapshot,\n StoreTransport,\n SubscribableStore,\n} from \"./types.js\";\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\n\n/**\n * Lazy resource browser for agent connectors.\n *\n * Provides a reactive list of connected mounts and connectors, and\n * request/response methods for browsing connector contents. Shares\n * the same transport (`send` + `onEvent`) as `AgentStore`.\n * @docLink packages/store/concepts#resource-client\n */\nexport class ResourceClient implements SubscribableStore<ResourceClientSnapshot> {\n private readonly _send: StoreTransport[\"send\"];\n private _mounts: readonly MountInfo[] = [];\n private _connectors: readonly ConnectorInfo[] = [];\n\n /** Live connection status per connector, keyed by connector ID. Updated by connector_status events. */\n connectorStatus: Map<string, ConnectorStatus> = new Map();\n\n private _snapshot: ResourceClientSnapshot | null = null;\n private readonly _listeners = new Set<() => void>();\n private readonly _pendingRequests = new Map<\n string,\n {\n resolve: (event: ConnectorResponseEvent) => void;\n reject: (error: Error) => void;\n timer: ReturnType<typeof setTimeout>;\n }\n >();\n private readonly _unsubEvent: () => void;\n\n /**\n * @param transport - Shared transport (same instance as the AgentStore for this session).\n */\n constructor(transport: StoreTransport) {\n this._send = transport.send;\n this._unsubEvent = transport.onEvent((event) => this._handleEvent(event));\n }\n\n // -- Reactive state --------------------------------------------------------\n\n /** Mounts available in this session, populated from `resources_available` events. */\n get mounts(): readonly MountInfo[] {\n return this._mounts;\n }\n\n /** Tool-based connectors available in this session, populated from `resources_available` events. */\n get connectors(): readonly ConnectorInfo[] {\n return this._connectors;\n }\n\n // -- Resource operations ---------------------------------------------------\n\n /**\n * List directory entries at the given path within a connector.\n *\n * @param connectorId - ID of the connector to query.\n * @param path - Directory path to list. Omit for the connector root.\n * @param opts - Optional pagination and filter options.\n * @returns Array of entries (files, directories, etc.) at the given path.\n * @throws If the request times out or the connector returns an error.\n */\n async list(connectorId: string, path?: string, opts?: ListOptions): Promise<ConnectorEntry[]> {\n const response = await this._request(connectorId, \"list\", path, opts);\n return (response.data as ConnectorEntry[]) ?? [];\n }\n\n /**\n * Read the content of a single resource.\n *\n * @param connectorId - ID of the connector to query.\n * @param path - Full path to the resource within the connector.\n * @returns The resource content object.\n * @throws If the request times out or the connector returns an error.\n */\n async read(connectorId: string, path: string): Promise<ConnectorContent> {\n const response = await this._request(connectorId, \"read\", path);\n return response.data as ConnectorContent;\n }\n\n /**\n * Write content to a resource, creating it if it does not exist.\n *\n * @param connectorId - ID of the connector to write to.\n * @param path - Full path to the resource within the connector.\n * @param content - Content to write.\n * @throws If the request times out or the connector returns an error.\n */\n async write(connectorId: string, path: string, content: ConnectorContent): Promise<void> {\n await this._request(connectorId, \"write\", path, undefined, content);\n }\n\n /**\n * Delete a resource from a connector.\n *\n * @param connectorId - ID of the connector to delete from.\n * @param path - Full path to the resource within the connector.\n * @throws If the request times out or the connector returns an error.\n */\n async delete(connectorId: string, path: string): Promise<void> {\n await this._request(connectorId, \"delete\", path);\n }\n\n /**\n * Full-text search within a connector.\n *\n * @param connectorId - ID of the connector to search.\n * @param query - Search query string.\n * @param opts - Optional search options (e.g. path prefix, result limit).\n * @returns Matching entries, ordered by relevance as determined by the connector.\n * @throws If the request times out or the connector returns an error.\n */\n async search(\n connectorId: string,\n query: string,\n opts?: SearchOptions,\n ): Promise<ConnectorEntry[]> {\n const response = await this._request(connectorId, \"search\", query, opts);\n return (response.data as ConnectorEntry[]) ?? [];\n }\n\n // -- useSyncExternalStore interface ----------------------------------------\n\n /**\n * Register a change listener. Called after every resource availability change.\n *\n * Conforms to the `subscribe` parameter of React's `useSyncExternalStore`.\n *\n * @param listener - Callback invoked whenever mounts or connectors change.\n * @returns Unsubscribe function — call to stop receiving notifications.\n */\n subscribe = (listener: () => void): (() => void) => {\n this._listeners.add(listener);\n return () => this._listeners.delete(listener);\n };\n\n /**\n * Return the current immutable resource snapshot.\n *\n * A new object is produced lazily after each `resources_available` event.\n * Conforms to the `getSnapshot` parameter of React's `useSyncExternalStore`.\n */\n getSnapshot = (): ResourceClientSnapshot => {\n if (!this._snapshot) {\n this._snapshot = { mounts: this._mounts, connectors: this._connectors };\n }\n return this._snapshot;\n };\n\n // -- Connector config mutations --------------------------------------------\n\n /**\n * Send a `connector_config` add command to wire a new connector at runtime,\n * without restarting the session. The runner receives this command and\n * calls `ConnectorManager.connect()`, which fires a `connector_status` event\n * back to the store once the connector is live.\n *\n * @param declaration - Connector declaration (id, driver, access level, options).\n */\n addConnector(declaration: {\n id: string;\n driver: string;\n access?: \"read-only\" | \"read-write\";\n options?: Record<string, unknown>;\n }): void {\n this._send({ type: \"connector_config\", action: \"add\", declaration });\n }\n\n /**\n * Send a `connector_config` remove command to disconnect a connector by ID\n * without restarting the session.\n *\n * @param connectorId - ID of the connector to disconnect and remove.\n */\n removeConnector(connectorId: string): void {\n this._send({ type: \"connector_config\", action: \"remove\", connectorId });\n }\n\n /**\n * Send a `connector_config` refresh command to reconnect all configured\n * connectors (e.g. after a credentials change).\n */\n refreshConnectors(): void {\n this._send({ type: \"connector_config\", action: \"refresh\" });\n }\n\n // -- Cleanup ---------------------------------------------------------------\n\n /**\n * Unsubscribe from transport events, reject all pending requests, and\n * clear all change listeners.\n *\n * All in-flight `list`/`read`/`write`/`delete`/`search` calls will reject\n * with `\"ResourceClient disposed\"`.\n */\n dispose(): void {\n this._unsubEvent();\n for (const [, pending] of this._pendingRequests) {\n clearTimeout(pending.timer);\n pending.reject(new Error(\"ResourceClient disposed\"));\n }\n this._pendingRequests.clear();\n this._listeners.clear();\n }\n\n // -- Internal --------------------------------------------------------------\n\n private _handleEvent(event: AgentEvent): void {\n if (event.type === \"connector_status\") {\n const e = event as ConnectorStatusEvent;\n const existing = this.connectorStatus.get(e.connectorId);\n const next = new Map(this.connectorStatus);\n next.set(e.connectorId, {\n id: e.connectorId,\n driver:\n existing?.driver ?? this._connectors.find((c) => c.id === e.connectorId)?.driver ?? \"\",\n state: e.status,\n ...(e.error !== undefined ? { error: e.error } : {}),\n ...(e.latencyMs !== undefined ? { latencyMs: e.latencyMs } : {}),\n lastUpdated: new Date(),\n });\n this.connectorStatus = next;\n for (const listener of this._listeners) {\n listener();\n }\n return;\n }\n\n if (event.type === \"resources_available\") {\n this._mounts = event.mounts;\n this._connectors = event.connectors;\n this._snapshot = null;\n for (const listener of this._listeners) {\n listener();\n }\n return;\n }\n\n if (event.type === \"resource_response\") {\n const pending = this._pendingRequests.get(event.requestId);\n if (!pending) return;\n\n clearTimeout(pending.timer);\n this._pendingRequests.delete(event.requestId);\n\n if (event.error) {\n pending.reject(new Error(event.error));\n } else {\n pending.resolve(event);\n }\n }\n }\n\n private _request(\n connectorId: string,\n operation: \"list\" | \"read\" | \"write\" | \"delete\" | \"search\",\n path?: string,\n options?: ListOptions | SearchOptions,\n content?: ConnectorContent,\n ): Promise<ConnectorResponseEvent> {\n const requestId = crypto.randomUUID();\n\n return new Promise<ConnectorResponseEvent>((resolve, reject) => {\n const timer = setTimeout(() => {\n this._pendingRequests.delete(requestId);\n reject(\n new Error(\n `Resource request timed out after ${DEFAULT_TIMEOUT_MS}ms: ${operation} ${connectorId}${path ? ` ${path}` : \"\"}`,\n ),\n );\n }, DEFAULT_TIMEOUT_MS);\n\n this._pendingRequests.set(requestId, { resolve, reject, timer });\n\n this._send({\n type: \"resource_request\",\n requestId,\n connectorId,\n operation,\n ...(path !== undefined ? { path } : {}),\n ...(options ? { options } : {}),\n ...(content ? { content } : {}),\n });\n });\n }\n}\n","import type {\n AgentCommand,\n AgentEvent,\n AgentPhase,\n Capability,\n IncompatibleProtocolEvent,\n Message,\n ProtocolInfoEvent,\n RenderInvokedEvent,\n} from \"@skaile/workspaces/types\";\nimport type {\n AgentClientLike,\n AgentStoreOptions,\n AgentStoreSnapshot,\n ConnectionStatus,\n SubscribableStore,\n} from \"./types.js\";\n\nconst DEFAULT_PAGE_SIZE = 50;\n\n/**\n * Headless reactive store for agent conversation state.\n *\n * Framework-agnostic — works with React (`useSyncExternalStore`),\n * Vue (`shallowRef` + `subscribe`), or any other UI framework.\n *\n * Accepts a minimal transport interface (`send` + `onEvent`) so it works\n * with WebSocket, tRPC, SSE, or any other delivery mechanism.\n * @docLink packages/store/concepts#agent-store\n */\nexport class AgentStore implements SubscribableStore<AgentStoreSnapshot> {\n private readonly _options: AgentStoreOptions;\n private _messages: Message[];\n private _streamingText = \"\";\n private _cancelledText = \"\";\n private _status: ConnectionStatus = \"idle\";\n private _phase: AgentPhase = \"idle\";\n private _pendingQuestion: AgentStoreSnapshot[\"pendingQuestion\"] = null;\n private _error: AgentStoreSnapshot[\"error\"] = null;\n private _isAllLoaded: boolean;\n private _seq: number;\n private _streamingFlushed = true;\n /** Shared state per store namespace — new Map instance on every mutation. */\n private _sharedState: Map<string, Record<string, unknown>> = new Map();\n /** Protocol v2 capability registry — new Map instance on every mutation. */\n private _capabilities: Map<string, Capability> = new Map();\n /** Protocol v2 active render invocations — new Map instance on every mutation. */\n private _activeRenderInvocations: Map<string, RenderInvokedEvent> = new Map();\n /** Protocol v2 — most recent `protocol_info` event from the runner. */\n private _protocolInfo: ProtocolInfoEvent | null = null;\n /** Protocol v2 — latest incompatible-protocol notice. */\n private _incompatibleProtocol: IncompatibleProtocolEvent | null = null;\n\n private _snapshot: AgentStoreSnapshot | null = null;\n private readonly _listeners = new Set<() => void>();\n private readonly _unsubEvent: () => void;\n private readonly _unsubStatus: (() => void) | undefined;\n\n /**\n * @param options - Store configuration including transport and optional pagination support.\n */\n constructor(options: AgentStoreOptions) {\n this._options = options;\n this._messages = options.initialMessages ? [...options.initialMessages] : [];\n this._isAllLoaded = !options.loadMessages;\n this._seq = this._messages.reduce((max, m) => Math.max(max, m.seq), 0);\n\n this._unsubEvent = options.onEvent((event) => this._handleEvent(event));\n this._unsubStatus = options.onStatusChange?.((status) => {\n this._status = status;\n this._notify();\n });\n }\n\n // -- Reactive state --------------------------------------------------------\n\n /** Accumulated conversation messages, oldest first. */\n get messages(): readonly Message[] {\n return this._messages;\n }\n\n /** Text currently streaming from the agent. Empty when not streaming. */\n get streamingText(): string {\n return this._streamingText;\n }\n\n /** Current connection lifecycle state. */\n get status(): ConnectionStatus {\n return this._status;\n }\n\n /** Current agent execution phase (e.g. `\"idle\"`, `\"thinking\"`, `\"executing\"`). */\n get phase(): AgentPhase {\n return this._phase;\n }\n\n /** The pending question the agent is waiting for the user to answer, or null. */\n get pendingQuestion(): AgentStoreSnapshot[\"pendingQuestion\"] {\n return this._pendingQuestion;\n }\n\n /** Most recent error, or null when no error is active. */\n get error(): AgentStoreSnapshot[\"error\"] {\n return this._error;\n }\n\n /** Partial text that was visible when the user cancelled. Empty when not cancelled. */\n get cancelledText(): string {\n return this._cancelledText;\n }\n\n /** True when there are no more older messages to load via pagination. */\n get isAllLoaded(): boolean {\n return this._isAllLoaded;\n }\n\n // -- Commands --------------------------------------------------------------\n\n /**\n * Send a user prompt to the agent and optimistically update local state.\n *\n * Clears any previous error and cancelled text, sets phase to `\"thinking\"`,\n * and appends the prompt as a local message before forwarding to the agent.\n *\n * @param text - The user's prompt text.\n */\n prompt(text: string): void {\n this._error = null;\n this._cancelledText = \"\";\n this._streamingFlushed = false;\n this._phase = \"thinking\";\n this._appendMessage({ type: \"prompt\", prompt: text }, \"user\");\n this._options.send({ type: \"prompt\", prompt: text });\n this._notify();\n }\n\n /**\n * Send a reply to the agent's pending question.\n *\n * Clears the pending question locally before forwarding the reply command.\n *\n * @param answer - The user's answer text.\n */\n reply(answer: string): void {\n this._pendingQuestion = null;\n // Answering a pending question resumes the agent turn — restore the busy\n // phase (mirrors prompt()) so the thinking indicator reappears immediately\n // rather than after the agent's first resumed event lands.\n this._phase = \"thinking\";\n this._appendMessage({ type: \"reply\", answer }, \"user\");\n this._options.send({ type: \"reply\", answer });\n this._notify();\n }\n\n /**\n * Cancel the current agent turn.\n *\n * Preserves partial streaming text in {@link cancelledText} so the UI can\n * display it. Clears streaming state, resets phase to `\"idle\"`, and sends\n * a `cancel` command to the agent.\n */\n cancel(): void {\n // Preserve partial streaming text so the UI can still display it\n this._cancelledText = this._streamingText;\n this._streamingText = \"\";\n this._streamingFlushed = true;\n this._phase = \"idle\";\n this._options.send({ type: \"cancel\" });\n this._notify();\n }\n\n /**\n * Update shared state for a store namespace.\n *\n * Sends a `state_update` command to the agent and optimistically\n * updates local state so the change is reflected immediately.\n *\n * @param store - Store namespace (e.g. \"app\", \"component:render-123\").\n * @param state - Full state snapshot (replaces previous).\n */\n updateState(store: string, state: Record<string, unknown>): void {\n this._options.send({ type: \"state_update\", store, state });\n // Optimistic local update\n this._sharedState = new Map(this._sharedState);\n this._sharedState.set(store, state);\n this._notify();\n }\n\n /**\n * Send an arbitrary command to the agent.\n *\n * Use this for commands that don't have a dedicated convenience method\n * (e.g. `ui_interaction`). No local state changes — the command is\n * forwarded as-is to the transport.\n *\n * @param cmd - The command to send.\n */\n send(cmd: AgentCommand): void {\n this._options.send(cmd);\n }\n\n /**\n * Load the previous page of messages and prepend them to the current list.\n *\n * No-op when `loadMessages` was not provided at construction time or when\n * all history has already been loaded ({@link isAllLoaded} is true).\n * Sets {@link isAllLoaded} to true once the server returns fewer messages\n * than the configured page size.\n */\n async loadPreviousMessages(): Promise<void> {\n if (!this._options.loadMessages || this._isAllLoaded) return;\n\n const pageSize = this._options.pageSize ?? DEFAULT_PAGE_SIZE;\n const before = this._messages.length > 0 ? this._messages[0].seq : undefined;\n const older = await this._options.loadMessages({ before, limit: pageSize });\n\n if (older.length < pageSize) this._isAllLoaded = true;\n\n const existingIds = new Set(this._messages.map((m) => m.id));\n const unique = older.filter((m) => !existingIds.has(m.id));\n this._messages = [...unique, ...this._messages];\n\n this._notify();\n }\n\n // -- External control ------------------------------------------------------\n\n /**\n * Programmatically update the connection status.\n *\n * Called by transport wrappers that cannot use the `onStatusChange`\n * callback (e.g. tRPC subscriptions that track status externally).\n *\n * @param status - The new connection status.\n */\n setStatus(status: ConnectionStatus): void {\n this._status = status;\n this._notify();\n }\n\n // -- useSyncExternalStore interface ----------------------------------------\n\n /**\n * Register a change listener. Called synchronously after every state change.\n *\n * Conforms to the `subscribe` parameter of React's `useSyncExternalStore`.\n *\n * @param listener - Callback invoked whenever state changes.\n * @returns Unsubscribe function — call to stop receiving notifications.\n */\n subscribe = (listener: () => void): (() => void) => {\n this._listeners.add(listener);\n return () => this._listeners.delete(listener);\n };\n\n /**\n * Return the current immutable state snapshot.\n *\n * A new object is produced lazily on the first call after each state change.\n * Subsequent calls return the same cached object until the next change.\n * Conforms to the `getSnapshot` parameter of React's `useSyncExternalStore`.\n */\n getSnapshot = (): AgentStoreSnapshot => {\n if (!this._snapshot) {\n this._snapshot = {\n messages: this._messages,\n streamingText: this._streamingText,\n cancelledText: this._cancelledText,\n status: this._status,\n phase: this._phase,\n pendingQuestion: this._pendingQuestion,\n error: this._error,\n isAllLoaded: this._isAllLoaded,\n sharedState: this._sharedState,\n capabilities: this._capabilities,\n activeRenderInvocations: this._activeRenderInvocations,\n protocolInfo: this._protocolInfo,\n incompatibleProtocol: this._incompatibleProtocol,\n };\n }\n return this._snapshot;\n };\n\n // -- Cleanup ---------------------------------------------------------------\n\n /**\n * Unsubscribe from transport events and clear all change listeners.\n *\n * Call this when the component or service that owns the store unmounts or\n * shuts down to prevent memory leaks.\n */\n dispose(): void {\n this._unsubEvent();\n this._unsubStatus?.();\n this._listeners.clear();\n }\n\n // -- Factory ---------------------------------------------------------------\n\n /**\n * Create an {@link AgentStore} connected to a duck-typed agent client.\n *\n * Adapts the client's `send`/`onEvent`/`offEvent` API to the\n * {@link StoreTransport} interface expected by the constructor, without\n * creating a hard runtime dependency on `@skaile/workspaces/client`.\n *\n * @param client - Any object implementing {@link AgentClientLike}.\n * @param opts - Optional store configuration.\n * @param opts.sessionId - Session ID for message envelopes (defaults to a new UUID).\n * @param opts.initialMessages - Messages to pre-populate the store with.\n *\n * @example\n * ```ts\n * const store = AgentStore.fromClient(agentClient, { sessionId: 'sess-123' })\n * ```\n */\n static fromClient(\n client: AgentClientLike,\n opts?: { sessionId?: string; initialMessages?: Message[] },\n ): AgentStore {\n return new AgentStore({\n sessionId: opts?.sessionId ?? crypto.randomUUID(),\n send: (cmd) => client.send(cmd),\n onEvent: (handler) => {\n client.onEvent(handler);\n return () => client.offEvent(handler);\n },\n initialMessages: opts?.initialMessages,\n });\n }\n\n // -- Internal --------------------------------------------------------------\n\n private _handleEvent(event: AgentEvent): void {\n switch (event.type) {\n case \"text\":\n this._cancelledText = \"\";\n this._streamingText += event.content;\n this._streamingFlushed = false;\n break;\n\n case \"finished\":\n this._cancelledText = \"\";\n this._flushStreaming();\n this._appendMessage(event);\n this._phase = \"idle\";\n this._pendingQuestion = null;\n break;\n\n case \"status\":\n this._phase = event.phase;\n break;\n\n case \"tool_call\":\n case \"tool_result\":\n case \"file_changed\":\n case \"subagent\":\n case \"dev_server\":\n case \"handoff\":\n case \"question_reply\":\n // Flush in-flight text first so each text block becomes its own\n // Message, interleaved with tool activity in order — otherwise text\n // before and after a tool call merges into one wall-of-text blob.\n this._flushStreaming();\n this._appendMessage(event);\n break;\n\n case \"question\":\n // A pending question is a human-in-the-loop pause — the agent is waiting\n // for the user, not working. Reset to idle (like finished/error) so any\n // phase-derived busy indicator clears until the user replies.\n this._flushStreaming();\n this._phase = \"idle\";\n this._pendingQuestion = event;\n this._appendMessage(event);\n break;\n\n case \"error\":\n this._error = { message: event.message, fatal: event.fatal };\n this._streamingText = \"\";\n this._streamingFlushed = true;\n this._phase = \"idle\";\n this._appendMessage(event);\n break;\n\n case \"state_changed\":\n // Accumulate state per store namespace (notify only — no message)\n this._sharedState = new Map(this._sharedState);\n this._sharedState.set(event.store, event.state);\n break;\n\n // ── Protocol v2 ────────────────────────────────────────────────────────\n\n case \"capability_register\":\n // TRANSIENT — accumulate v2 capabilities into the registry (no message).\n this._capabilities = new Map(this._capabilities);\n for (const cap of event.capabilities) {\n this._capabilities.set(cap.name, cap);\n }\n break;\n\n case \"capability_deregister\":\n // TRANSIENT — drop capabilities by name.\n if (event.names.length > 0) {\n this._capabilities = new Map(this._capabilities);\n for (const name of event.names) {\n this._capabilities.delete(name);\n }\n }\n break;\n\n case \"render_invoked\":\n // TRANSIENT — record latest render invocation (frontend pairs with\n // the matching `Capability.render` for placement).\n this._activeRenderInvocations = new Map(this._activeRenderInvocations);\n this._activeRenderInvocations.set(event.callId, event);\n break;\n\n case \"protocol_info\":\n // TRANSIENT — runner announced its protocol version.\n this._protocolInfo = event;\n break;\n\n case \"incompatible_protocol\":\n // TRANSIENT — runner detected version drift; platform restarts session.\n this._incompatibleProtocol = event;\n break;\n\n case \"capability_invoked\":\n // Backend intercepts client-side invocations and dispatches them\n // through V2CapabilityRegistryService — frontends should not see\n // these. Drop silently if one slips through.\n return;\n\n case \"resource_response\":\n case \"resources_available\":\n // Transient — handled by ResourceClient, not AgentStore\n return;\n }\n\n this._notify();\n }\n\n private _flushStreaming(): void {\n if (this._streamingFlushed || !this._streamingText) return;\n this._appendMessage({ type: \"text\", content: this._streamingText });\n this._streamingText = \"\";\n this._streamingFlushed = true;\n }\n\n private _appendMessage(payload: AgentCommand | AgentEvent, senderId?: string): void {\n this._seq++;\n this._messages = [\n ...this._messages,\n {\n id: crypto.randomUUID(),\n seq: this._seq,\n timestamp: new Date().toISOString(),\n sessionId: this._options.sessionId,\n ...(senderId ? { senderId } : {}),\n payload,\n },\n ];\n }\n\n private _notify(): void {\n this._snapshot = null;\n for (const listener of this._listeners) {\n listener();\n }\n }\n}\n"]}
|