@skaile/workspaces 0.44.0 → 0.45.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 +70 -0
- package/dist/{asset-feeds-EGSG4FUB.js → asset-feeds-AOZLZMDV.js} +2 -2
- package/dist/{asset-feeds-EGSG4FUB.js.map → asset-feeds-AOZLZMDV.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/asset-manager/src/index.d.ts +47 -0
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/{chunk-NHLXS2CH.js → chunk-JUZGLINM.js} +2 -2
- package/dist/{chunk-NHLXS2CH.js.map → chunk-JUZGLINM.js.map} +1 -1
- package/dist/{chunk-JUZLVRI4.js → chunk-L6BKSTAX.js} +71 -4
- package/dist/chunk-L6BKSTAX.js.map +1 -0
- package/dist/{chunk-7NQXVBCQ.js → chunk-LHUCCPH4.js} +2 -2
- package/dist/{chunk-7NQXVBCQ.js.map → chunk-LHUCCPH4.js.map} +1 -1
- package/dist/{chunk-5LHPKVGR.js → chunk-N2KV5RK3.js} +121 -4
- package/dist/chunk-N2KV5RK3.js.map +1 -0
- package/dist/cli/index.js +841 -553
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/asset-cmd.d.ts +1 -1
- package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +9 -3
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/skailify-lib.d.ts +108 -0
- package/dist/cli/src/commands/skailify-lib.d.ts.map +1 -0
- package/dist/core/index.js +1 -1
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +1 -1
- package/dist/factory-assets/skaile.manifest.yaml +3 -0
- package/dist/factory-assets/skills/skailify/SKILL.md +84 -0
- package/dist/{plugin-store-RBCDBO7K.js → plugin-store-2X2YXJVG.js} +2 -2
- package/dist/{plugin-store-RBCDBO7K.js.map → plugin-store-2X2YXJVG.js.map} +1 -1
- package/dist/runner/index.js +2 -2
- package/dist/runner/src/file-changed-coalescer.d.ts +48 -0
- package/dist/runner/src/file-changed-coalescer.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/index.js +2 -2
- package/dist/sdk/runner.js +2 -2
- package/dist/tui/index.js +2 -2
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5LHPKVGR.js.map +0 -1
- package/dist/chunk-JUZLVRI4.js.map +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Subcommands:
|
|
5
5
|
* migrate <path> move/copy/link a workspace asset into a library
|
|
6
6
|
* install <ref> install an asset from a library into a workspace
|
|
7
|
-
* list list
|
|
7
|
+
* list synonym for `skaile list` (declared deps + state)
|
|
8
8
|
* show <ref> inspect an asset by canonical ref
|
|
9
9
|
*
|
|
10
10
|
* The former `asset publish` stub has moved to `library publish` so the push
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-cmd.d.ts","sourceRoot":"","sources":["../../../../cli/src/commands/asset-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"asset-cmd.d.ts","sourceRoot":"","sources":["../../../../cli/src/commands/asset-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,wBAAgB,gBAAgB,IAAI,OAAO,CAoT1C"}
|
|
@@ -45,9 +45,15 @@ export declare function makeRemoveCommand(): Command;
|
|
|
45
45
|
/**
|
|
46
46
|
* Create the `skaile list` command.
|
|
47
47
|
*
|
|
48
|
-
* Lists
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* Lists the **declared** top-level dependencies from `skaile.yaml` (not the
|
|
49
|
+
* deployed tree), each annotated with a reconciliation state — `declared`,
|
|
50
|
+
* `installed`, or `drift`. Transitive (lock-only) deps are excluded. The
|
|
51
|
+
* available-assets view lives in `skaile search`. Delegates to
|
|
52
|
+
* {@link AssetManager.listDeclared}.
|
|
53
|
+
*
|
|
54
|
+
* `--target` selects which driver-target dir is inspected for the on-disk
|
|
55
|
+
* install/drift check; `--global` inspects the global deployment dir instead of
|
|
56
|
+
* the project one.
|
|
51
57
|
*
|
|
52
58
|
* @returns Configured {@link Command} ready for `program.addCommand()`.
|
|
53
59
|
* @docLink cli/commands/catalog#make-list-command
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../cli/src/commands/catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../cli/src/commands/catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAiH5C;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAW3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAmCxC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAiB3C;AAUD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,IAAI,OAAO,CA0DzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAiCzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAkB3C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CA2B3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library-cmd.d.ts","sourceRoot":"","sources":["../../../../cli/src/commands/library-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"library-cmd.d.ts","sourceRoot":"","sources":["../../../../cli/src/commands/library-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAgB5C,wBAAgB,kBAAkB,IAAI,OAAO,CAgiB5C"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* skailify — pure, individually-testable helpers for importing an existing
|
|
3
|
+
* coding-agent skill (e.g. a Claude Code skill from `~/.claude/skills/`) into a
|
|
4
|
+
* skaile library. Composed by the `asset import` command and the `skailify`
|
|
5
|
+
* factory skill. See each export's TSDoc for specifics.
|
|
6
|
+
*
|
|
7
|
+
* @docLink cli/commands/asset#import
|
|
8
|
+
*/
|
|
9
|
+
/** Default authoring version stamped on a skill that ships none. */
|
|
10
|
+
export declare const DEFAULT_IMPORT_VERSION = "0.1.0";
|
|
11
|
+
/** Default lifecycle stage stamped on an imported skill. */
|
|
12
|
+
export declare const DEFAULT_IMPORT_STAGE = "alpha";
|
|
13
|
+
/**
|
|
14
|
+
* Where coding-agent skills live on disk, highest precedence first. The
|
|
15
|
+
* `SKAILE_CLAUDE_SKILLS_DIR` override exists so tests (and non-default setups)
|
|
16
|
+
* can point the resolver at a fixture tree without touching `$HOME`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function claudeSkillRoots(): string[];
|
|
19
|
+
export interface ResolvedImportSource {
|
|
20
|
+
/** Absolute path to the skill directory. */
|
|
21
|
+
dir: string;
|
|
22
|
+
/** Absolute path to the skill's SKILL.md. */
|
|
23
|
+
skillFile: string;
|
|
24
|
+
/** How the source was located — for human-facing messages. */
|
|
25
|
+
via: "path" | "claude-skills";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolve an `import` argument to a concrete skill directory. A value that
|
|
29
|
+
* exists on disk (file or dir) is used verbatim; otherwise it is treated as a
|
|
30
|
+
* bare skill name and looked up under {@link claudeSkillRoots}.
|
|
31
|
+
*
|
|
32
|
+
* Returns `null` when nothing matches so the caller can print a tailored error.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveImportSource(nameOrPath: string): ResolvedImportSource | null;
|
|
35
|
+
export interface NormalizeOptions {
|
|
36
|
+
/** Fallback name when frontmatter has none (usually the source dir name). */
|
|
37
|
+
fallbackName?: string;
|
|
38
|
+
/** Version to stamp when the skill ships none. */
|
|
39
|
+
version?: string;
|
|
40
|
+
/** Stage to stamp when the skill ships none. */
|
|
41
|
+
stage?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface NormalizeResult {
|
|
44
|
+
/** Rewritten SKILL.md content (frontmatter + body). */
|
|
45
|
+
content: string;
|
|
46
|
+
/** Canonical asset name (slugified if the source was non-compliant). */
|
|
47
|
+
name: string;
|
|
48
|
+
/** The name as it appeared in the source, when it differed from `name`. */
|
|
49
|
+
originalName?: string;
|
|
50
|
+
/** True when `content` differs from the input (metadata added, name slugified, …). */
|
|
51
|
+
changed: boolean;
|
|
52
|
+
/** Human-facing notes about what was normalized. */
|
|
53
|
+
notes: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Bring a coding-agent `SKILL.md` into the skaile schema without touching the
|
|
57
|
+
* body: ensure a canonical lowercase-kebab `name`, and a `metadata:` block
|
|
58
|
+
* carrying at least `version`, `stage`, and `tags`. Idempotent — a SKILL.md
|
|
59
|
+
* that already conforms comes back unchanged (`changed: false`).
|
|
60
|
+
*
|
|
61
|
+
* A Claude Code skill only requires `name` + `description`; skaile additionally
|
|
62
|
+
* expects the `metadata:` block, so this is the transform `asset migrate`'s raw
|
|
63
|
+
* byte-copy skips.
|
|
64
|
+
*/
|
|
65
|
+
export declare function normalizeSkillContent(raw: string, opts?: NormalizeOptions): NormalizeResult;
|
|
66
|
+
export interface EnsureDomainResult {
|
|
67
|
+
/** Absolute path to the domain directory. */
|
|
68
|
+
dir: string;
|
|
69
|
+
/** Publisher slug derived for this domain (the dir name, kebab-cased). */
|
|
70
|
+
publisher: string;
|
|
71
|
+
/** True when this call created the directory / DOMAIN.md. */
|
|
72
|
+
created: boolean;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Scaffold a domain directory under a library: `<lib>/<domain>/DOMAIN.md`. A
|
|
76
|
+
* domain is the first-level dir of an asset repo and defines the publisher
|
|
77
|
+
* namespace, so assets placed beneath it publish as `@<publisher>/<name>`.
|
|
78
|
+
* No-op (returns `created: false`) when the DOMAIN.md already exists.
|
|
79
|
+
*/
|
|
80
|
+
export declare function ensureDomain(libraryPath: string, domain: string, opts?: {
|
|
81
|
+
description?: string;
|
|
82
|
+
publisher?: string;
|
|
83
|
+
}): EnsureDomainResult;
|
|
84
|
+
/** List the domains in a library — first-level dirs that carry a DOMAIN.md. */
|
|
85
|
+
export declare function listDomains(libraryPath: string): string[];
|
|
86
|
+
export interface UpsertAssetInput {
|
|
87
|
+
kind: string;
|
|
88
|
+
name: string;
|
|
89
|
+
/** Repo-relative path to the asset directory (the AssetEntry `root`). */
|
|
90
|
+
root: string;
|
|
91
|
+
version?: string;
|
|
92
|
+
publisher?: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
keywords?: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface UpsertAssetResult {
|
|
97
|
+
manifestPath: string;
|
|
98
|
+
/** True when a new entry was appended, false when an existing one was updated. */
|
|
99
|
+
added: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Auto-wire an asset into a library's `skaile.manifest.yaml` (creating the
|
|
103
|
+
* manifest when absent). Matches an existing entry by `(kind, name)` and
|
|
104
|
+
* updates it in place; otherwise appends. This is the manifest half of import
|
|
105
|
+
* that a plain byte-copy (`asset migrate`) leaves stale.
|
|
106
|
+
*/
|
|
107
|
+
export declare function upsertManifestAsset(libraryPath: string, input: UpsertAssetInput): UpsertAssetResult;
|
|
108
|
+
//# sourceMappingURL=skailify-lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skailify-lib.d.ts","sourceRoot":"","sources":["../../../../cli/src/commands/skailify-lib.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAC9C,4DAA4D;AAC5D,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAM3C;AAED,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAiBnF;AAED,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,OAAO,EAAE,OAAO,CAAC;IACjB,oDAAoD;IACpD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,gBAAqB,GAAG,eAAe,CAwD/F;AAED,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;CAClB;AAQD;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACtD,kBAAkB,CAWpB;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAOzD;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,gBAAgB,GACtB,iBAAiB,CAoBnB"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ALL_PROVIDERS, ManifestYamlEditor, SETTINGS_DEFAULTS, WorkspaceYamlEditor, applyPatch, buildLockFile, computeHash, detectEnvApiKeys, extractForPatch, generatePatch, globalSettingsPath, listPatches, loadSettings, mapLegacyFields, maskApiKey, migrateSettings, portableSpawn, portableSpawnSync, projectSettingsPath, providerEnvKey, readLock, readPatch, readPluginsLockSlice, resolveAllKeys, resolveApiKey, resolveSettings, savePatch, saveSettings, verifyLock, walkForSettings, writeLock, writePluginsLockSlice } from '../chunk-BLGHFVXE.js';
|
|
2
2
|
export { ASSET_KIND_DIRS, assetSearchDirs, detectAiResources, detectDomains, detectMonorepoRoot } from '../chunk-ZAP2BDHG.js';
|
|
3
3
|
export { FACTORY_ASSETS_REPO_NAME, factoryAssetRoots, resolveFactoryAssetsRoot, resolveFactoryAssetsRootOrNull, resolvePackagedAssetsDir, resolveRuntimeAssets, resolveWorkspacesPackageRoot } from '../chunk-VPXV2Z5E.js';
|
|
4
|
-
export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeLegacyEntriesInto, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, writeLinks } from '../chunk-COSTF7QW.js';
|
|
4
|
+
export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeLegacyEntriesInto, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, writeLinks } from '../chunk-COSTF7QW.js';
|
|
5
5
|
export { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest, encodeSkaileManifest, loadSkPublishManifest, saveSkPublishManifest } from '../chunk-DZCK7GRW.js';
|
|
6
6
|
export { bundleDepRefs, fromAgentMd, fromAgentYaml, fromBundleYaml, fromConnectorMd, fromContractMd, fromFlowYaml, fromMcpServerMd, fromMcpServerMdContent, fromPromptMd, fromSkillMd, parseFrontmatter, parseRequires, scanDirectory, walkDir } from '../chunk-6IDBWPK2.js';
|
|
7
7
|
export { ASSET_KINDS, ASSET_NAME_HINT, INDIVIDUAL_KINDS, assetRefToDep, assetRefToStr, depToStr, entryFromRaw, entryToRaw, isValidAssetName, parseAssetRef, parseDep, repositoryFromRaw, repositoryToRaw, slugifyAssetName } from '../chunk-GEEW6SY2.js';
|
package/dist/core/src/index.d.ts
CHANGED
|
@@ -39,6 +39,6 @@ export { portableSpawn, portableSpawnSync } from "./subprocess.js";
|
|
|
39
39
|
export type { ProvenanceCandidate, ProvenanceIndex, SourceClone, } from "./walker.js";
|
|
40
40
|
export { buildProvenanceIndex } from "./walker.js";
|
|
41
41
|
export type { AgentConfig, AgentContextConfig, AgentHooks, AgentPermissions, AssetRecipe, CompactionConfig, ConnectorDeclaration, ContainerConfig, DecodeResult, Diagnostic, DiagnosticSeverity, GitConfig, HookEntry, McpServerDeclaration, NetworkPolicy, OverrideEntry, RuntimeDefaults, SecretsConfig, SetupEntry, SkWorkspaceConfig, SkWorkspaceConfigFile, SourceDeclaration, SourceEntry, StoreEntry, SubagentConfig, WorkspaceLayoutConfig, } from "./workspace-config.js";
|
|
42
|
-
export { COMPACTION_DEFAULTS, DEFAULT_RECIPE_ATTR, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, findWorkspaceRoot, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeSkWorkspaceConfigs, normalizeConfig, resolveAgentDir, resolveSkWorkspaceConfig, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, saveSkWorkspaceConfig, stageMaterializedSkills, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, } from "./workspace-config.js";
|
|
42
|
+
export { COMPACTION_DEFAULTS, DEFAULT_RECIPE_ATTR, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, findWorkspaceRoot, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeSkWorkspaceConfigs, normalizeConfig, resolveAgentDir, resolveSkWorkspaceConfig, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, SKAILE_YAML_DEFAULT, saveSkWorkspaceConfig, stageMaterializedSkills, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, } from "./workspace-config.js";
|
|
43
43
|
export { WorkspaceYamlEditor } from "./workspace-yaml-editor.js";
|
|
44
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,YAAY,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AACzB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,eAAe,EACf,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,sCAAsC,EACtC,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE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,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,eAAe,EACf,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,sCAAsC,EACtC,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skailify
|
|
3
|
+
description: "Use when a user wants to move an existing coding-agent skill (a Claude Code skill under ~/.claude/skills/, or any SKILL.md directory) into a skaile library so it can be versioned, placed in a domain, and published. Trigger phrases: 'skailify my skill', 'import this Claude skill into my library', 'move my ~/.claude skill into skaile', 'turn my CC skill into a skaile asset', 'add my local skill to the library'. Drives `skaile asset import` + `skaile library domain` and verifies with `skaile validate`."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "0.1.0"
|
|
6
|
+
source: AUTHORED
|
|
7
|
+
stage: alpha
|
|
8
|
+
tags:
|
|
9
|
+
- skaile
|
|
10
|
+
- library
|
|
11
|
+
- import
|
|
12
|
+
- migrate
|
|
13
|
+
- claude-code
|
|
14
|
+
- skill
|
|
15
|
+
- domain
|
|
16
|
+
- manifest
|
|
17
|
+
requires:
|
|
18
|
+
- "skill:skaile-author-asset"
|
|
19
|
+
- "skill:manifest-compliance"
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Skailify a skill
|
|
23
|
+
|
|
24
|
+
Move an existing coding-agent skill into a **skaile library** — frontmatter
|
|
25
|
+
normalized to the skaile schema, placed under a domain, and wired into
|
|
26
|
+
`skaile.manifest.yaml` — in one `skaile asset import` call. For the
|
|
27
|
+
source/library/store model and publish lifecycle read **[skaile-author-asset]**;
|
|
28
|
+
for naming rules read **[manifest-compliance]**.
|
|
29
|
+
|
|
30
|
+
## What `import` does that a copy doesn't
|
|
31
|
+
|
|
32
|
+
A Claude Code `SKILL.md` carries only `name` + `description`. A skaile asset
|
|
33
|
+
additionally needs a `metadata:` block (`version`, `stage`, `tags`) and a
|
|
34
|
+
canonical lowercase-kebab name. `skaile asset import` performs that transform,
|
|
35
|
+
scaffolds the domain on demand, and auto-appends the `skaile.manifest.yaml`
|
|
36
|
+
entry. The low-level `skaile asset migrate` only copies bytes — use `import`.
|
|
37
|
+
|
|
38
|
+
## The flow
|
|
39
|
+
|
|
40
|
+
1. **Confirm a library exists.** `skaile library list`. If none:
|
|
41
|
+
`skaile library init personal` (add `--git <url>` to make it publishable).
|
|
42
|
+
2. **Pick a domain.** A domain is the first-level dir and the publisher
|
|
43
|
+
namespace (`@<domain>/<name>`). List with `skaile library domain list`.
|
|
44
|
+
Create one if needed — `import --domain` will also scaffold it:
|
|
45
|
+
```bash
|
|
46
|
+
skaile library domain create docs # → docs/DOMAIN.md, publisher @docs
|
|
47
|
+
```
|
|
48
|
+
3. **Import.** By bare name (resolved from `~/.claude/skills/`) or by path:
|
|
49
|
+
```bash
|
|
50
|
+
skaile asset import starlight-docs --domain docs
|
|
51
|
+
skaile asset import ./path/to/my-skill --domain docs --version 1.0.0
|
|
52
|
+
```
|
|
53
|
+
Companion files in the skill dir (e.g. `file-loader.ts`, `references/`) are
|
|
54
|
+
copied along. A non-kebab name is slugified and reported.
|
|
55
|
+
4. **Verify.** `skaile validate <library-path>` — must report all manifest(s)
|
|
56
|
+
valid before you publish.
|
|
57
|
+
|
|
58
|
+
## Options that matter
|
|
59
|
+
|
|
60
|
+
| Flag | Use |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `--domain <name>` | Place + scaffold the domain. Omit → library root, repo-level publisher. |
|
|
63
|
+
| `--version <semver>` | Stamp when the skill ships none (default `0.1.0`). |
|
|
64
|
+
| `--stage <stage>` | `alpha` (default) \| `beta` \| `stable`. |
|
|
65
|
+
| `--to <library>` | Target a non-default library. |
|
|
66
|
+
| `--no-normalize` | Copy frontmatter verbatim (rare — only if already skaile-shaped). |
|
|
67
|
+
| `--commit` | Auto-commit in a git-backed library. |
|
|
68
|
+
|
|
69
|
+
## After import
|
|
70
|
+
|
|
71
|
+
- Edit the stamped `metadata.tags` if `import` left them empty.
|
|
72
|
+
- To publish: `skaile library publish <kind>:@<publisher>/<name>@<version>`
|
|
73
|
+
(needs a git-linked library — see [skaile-author-asset]).
|
|
74
|
+
- Re-running `import` for the same `(kind, name)` updates its manifest entry in
|
|
75
|
+
place rather than duplicating it.
|
|
76
|
+
|
|
77
|
+
## Common mistakes
|
|
78
|
+
|
|
79
|
+
| Mistake | Fix |
|
|
80
|
+
|---|---|
|
|
81
|
+
| Using `asset migrate` then hand-editing frontmatter | Use `asset import` — it normalizes + wires the manifest. |
|
|
82
|
+
| `domain create` / `domain list` errors "no default library" | One library is used automatically; with several pass `--library`. |
|
|
83
|
+
| Skipping `skaile validate` | Always validate before publish — catches non-canonical names. |
|
|
84
|
+
| Expecting `~/.claude/skills` bytes to stay in sync | `import` copies; future edits to the library copy don't reach `~/.claude`. |
|
|
@@ -138,5 +138,5 @@ async function ensurePluginsLoaded(projectDir, plugins, registry = pluginRegistr
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
export { ensurePluginsLoaded, loadPlugins, reconcilePlugins, specName };
|
|
141
|
-
//# sourceMappingURL=plugin-store-
|
|
142
|
-
//# sourceMappingURL=plugin-store-
|
|
141
|
+
//# sourceMappingURL=plugin-store-2X2YXJVG.js.map
|
|
142
|
+
//# sourceMappingURL=plugin-store-2X2YXJVG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAUO,SAAS,WAAW,UAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,SAAS,CAAA;AAC9C;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,kBAAkB,UAAA,EAA4B;AAC5D,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,iBAAiB,CAAA;AACvD;AAOO,SAAS,kBAAA,CAAmB,YAAoB,OAAA,EAAyB;AAC9E,EAAA,OAAO,IAAA,CAAK,cAAA,CAAe,UAAU,CAAA,EAAG,OAAO,CAAA;AACjD;;;ACbO,SAAS,UAAU,IAAA,EAA0B;AAClD,EAAA,MAAM,OAAA,GAAU,KAAK,IAAA,EAAK;AAC1B,EAAA,IAAI,CAAC,OA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A,IAAW,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;AACpC,IAAA,OAAO,EAAE,MAAA,EAAQ,EAAC,EAAG,MAAA,EAAQ,EAAC,EAAE;AAAA,EAClC;AACA,EAAA,MAAM,gBAAA,CAAiB,UAAA,EAAY,OAAA,EAAS,IAAI,CAAA;AAChD,EAAA,OAAO,WAAA,CAAY,YAAY,OAAA,EAAS,QAAA,EAAU,EAAE,GAAA,EAAK,IAAA,CAAK,KAAK,CAAA;AACrE","file":"plugin-store-RBCDBO7K.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Nothing here touches the filesystem.\n */\n\nimport { join } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/**\n * Absolute path to a plugin package's entry directory under the store's\n * `node_modules`. Dynamic `import()` against this absolute path works inside\n * compiled binaries via `pathToFileURL`.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n return join(nodeModulesDir(projectDir), pkgName);\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}` });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (pluginsDir: string) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/**\n * The default real installer: `bun install` inside the store directory.\n * Frozen on subsequent runs (a `bun.lock`/`bun.lockb` already exists), and\n * non-frozen on the first run so a lock can be generated.\n */\nexport const defaultInstall: InstallFn = async (dir) => {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const hasLock =\n existsSync(`${dir}/bun.lock`) ||\n existsSync(`${dir}/bun.lockb`) ||\n existsSync(`${dir}/package-lock.json`);\n const args = hasLock ? [\"bun\", \"install\", \"--frozen-lockfile\"] : [\"bun\", \"install\"];\n const proc = portableSpawn(args, { cwd: dir });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n return { ok: code === 0, output: chunks.join(\"\") };\n};\n\n/** Generate the store's `package.json` from the plugin specs. */\nfunction writePackageJson(projectDir: string, plugins: string[]): void {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(pluginsPkgJson(projectDir), `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir));\n if (!result.ok) {\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins } from \"./reconcile.js\";\nexport { specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAUO,SAAS,WAAW,UAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,SAAS,CAAA;AAC9C;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,kBAAkB,UAAA,EAA4B;AAC5D,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,iBAAiB,CAAA;AACvD;AAOO,SAAS,kBAAA,CAAmB,YAAoB,OAAA,EAAyB;AAC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AAO,EAAE,OAAA,EAAS,IAAA,EAAM,MAAA,EAAQ,YAAA,EAAa;AAC/C;;;ACxFA,eAAsB,oBACpB,UAAA,EACA,OAAA,EACA,WAA2B,cAAA,EAC3B,IAAA,GAA6B,EAAC,EACT;AACrB,EAAA,IAAI,CAAC,OAAA,IAAW,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;AACpC,IAAA,OAAO,EAAE,MAAA,EAAQ,EAAC,EAAG,MAAA,EAAQ,EAAC,EAAE;AAAA,EAClC;AACA,EAAA,MAAM,gBAAA,CAAiB,UAAA,EAAY,OAAA,EAAS,IAAI,CAAA;AAChD,EAAA,OAAO,WAAA,CAAY,YAAY,OAAA,EAAS,QAAA,EAAU,EAAE,GAAA,EAAK,IAAA,CAAK,KAAK,CAAA;AACrE","file":"plugin-store-2X2YXJVG.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Nothing here touches the filesystem.\n */\n\nimport { join } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/**\n * Absolute path to a plugin package's entry directory under the store's\n * `node_modules`. Dynamic `import()` against this absolute path works inside\n * compiled binaries via `pathToFileURL`.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n return join(nodeModulesDir(projectDir), pkgName);\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}` });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (pluginsDir: string) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/**\n * The default real installer: `bun install` inside the store directory.\n * Frozen on subsequent runs (a `bun.lock`/`bun.lockb` already exists), and\n * non-frozen on the first run so a lock can be generated.\n */\nexport const defaultInstall: InstallFn = async (dir) => {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const hasLock =\n existsSync(`${dir}/bun.lock`) ||\n existsSync(`${dir}/bun.lockb`) ||\n existsSync(`${dir}/package-lock.json`);\n const args = hasLock ? [\"bun\", \"install\", \"--frozen-lockfile\"] : [\"bun\", \"install\"];\n const proc = portableSpawn(args, { cwd: dir });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n return { ok: code === 0, output: chunks.join(\"\") };\n};\n\n/** Generate the store's `package.json` from the plugin specs. */\nfunction writePackageJson(projectDir: string, plugins: string[]): void {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(pluginsPkgJson(projectDir), `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir));\n if (!result.ok) {\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins } from \"./reconcile.js\";\nexport { specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n"]}
|
package/dist/runner/index.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, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, 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, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-N2KV5RK3.js';
|
|
2
|
+
import '../chunk-JUZGLINM.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ConnectorChangeEvent } from "@skaile/workspaces/connectors";
|
|
2
|
+
/** Tuning for {@link FileChangedCoalescer}. */
|
|
3
|
+
export interface CoalesceOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Burst window in ms. Events within this gap of each other (per mount) are
|
|
6
|
+
* considered part of the same burst. Default: 1000.
|
|
7
|
+
*/
|
|
8
|
+
windowMs?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Number of events within a window that flips a mount into "burst mode".
|
|
11
|
+
* At/under this count events pass through individually; above it the rest of
|
|
12
|
+
* the burst is coalesced by directory. Default: 50.
|
|
13
|
+
*/
|
|
14
|
+
threshold?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Cap on the number of per-directory representative events emitted per burst.
|
|
17
|
+
* If a burst touches more distinct directories than this, the representatives
|
|
18
|
+
* for the first `maxDirs` directories are emitted plus a single root-level
|
|
19
|
+
* fallback event so nothing is silently missed. Default: 256.
|
|
20
|
+
*/
|
|
21
|
+
maxDirs?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Per-mount burst detector. Feed it watcher events via {@link push}; it calls
|
|
25
|
+
* `emit` either with the original event (normal traffic) or with one
|
|
26
|
+
* representative event per affected directory (when a burst is detected).
|
|
27
|
+
* Quiescence is detected with a timer so representatives fire shortly after the
|
|
28
|
+
* last file in the burst settles.
|
|
29
|
+
*
|
|
30
|
+
* Stateful and not thread-safe — one instance per `startWatching` lifetime.
|
|
31
|
+
*/
|
|
32
|
+
export declare class FileChangedCoalescer {
|
|
33
|
+
private readonly windowMs;
|
|
34
|
+
private readonly threshold;
|
|
35
|
+
private readonly maxDirs;
|
|
36
|
+
private readonly emit;
|
|
37
|
+
private readonly now;
|
|
38
|
+
private readonly log;
|
|
39
|
+
private readonly states;
|
|
40
|
+
constructor(emit: (mountId: string, event: ConnectorChangeEvent) => void, options?: CoalesceOptions, now?: () => number, log?: (msg: string) => void);
|
|
41
|
+
push(mountId: string, event: ConnectorChangeEvent): void;
|
|
42
|
+
/** Cancel timers and emit any pending representatives. Call on watcher teardown. */
|
|
43
|
+
dispose(): void;
|
|
44
|
+
private recordDir;
|
|
45
|
+
private armFlush;
|
|
46
|
+
private flush;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=file-changed-coalescer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-changed-coalescer.d.ts","sourceRoot":"","sources":["../../../runner/src/file-changed-coalescer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA4CD;;;;;;;;GAQG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyD;IAC9E,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwB;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;gBAG3D,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,KAAK,IAAI,EAC5D,OAAO,CAAC,EAAE,eAAe,EAEzB,GAAG,GAAE,MAAM,MAAiB,EAE5B,GAAG,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAA6B;IAUrD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,IAAI;IA4CxD,oFAAoF;IACpF,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,SAAS;IAkBjB,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,KAAK;CAyBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../runner/src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAMzB,KAAK,uBAAuB,EAI5B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../runner/src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAMzB,KAAK,uBAAuB,EAI5B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EACL,kBAAkB,EAKnB,MAAM,mBAAmB,CAAC;AAO3B;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,+FAA+F;IAC/F,eAAe,EAAE,GAAG,GAAG,IAAI,CAAC;IAC5B,sFAAsF;IACtF,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM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B,CAAC,EAAE,uBAAuB,EAC1C,qBAAqB,CAAC,EAAE,OAAO,EAC/B,kBAAkB,CAAC,EAAE,kBAAkB,GACtC,OAAO,CAAC,oBAAoB,CAAC,CA4O/B;AAsLD,6GAA6G;AAC7G,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AssetManager, NON_DEPLOYABLE_KINDS, parseCanonicalLockKey } from '../chunk-
|
|
1
|
+
export { AssetManager, MissingManifestError, NON_DEPLOYABLE_KINDS, parseCanonicalLockKey } from '../chunk-L6BKSTAX.js';
|
|
2
2
|
export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-CVWA4RIK.js';
|
|
3
3
|
import '../chunk-BLGHFVXE.js';
|
|
4
4
|
import '../chunk-ZAP2BDHG.js';
|
package/dist/sdk/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ALL_PROVIDERS, ManifestYamlEditor, SETTINGS_DEFAULTS, WorkspaceYamlEditor, applyPatch, buildLockFile, computeHash, detectEnvApiKeys, extractForPatch, generatePatch, globalSettingsPath, listPatches, loadSettings, mapLegacyFields, maskApiKey, migrateSettings, portableSpawn, portableSpawnSync, projectSettingsPath, providerEnvKey, readLock, readPatch, readPluginsLockSlice, resolveAllKeys, resolveApiKey, resolveSettings, savePatch, saveSettings, verifyLock, walkForSettings, writeLock, writePluginsLockSlice } from '../chunk-BLGHFVXE.js';
|
|
2
2
|
export { ASSET_KIND_DIRS, assetSearchDirs, detectAiResources, detectDomains, detectMonorepoRoot } from '../chunk-ZAP2BDHG.js';
|
|
3
3
|
export { FACTORY_ASSETS_REPO_NAME, factoryAssetRoots, resolveFactoryAssetsRoot, resolveFactoryAssetsRootOrNull, resolvePackagedAssetsDir, resolveRuntimeAssets, resolveWorkspacesPackageRoot } from '../chunk-VPXV2Z5E.js';
|
|
4
|
-
export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeLegacyEntriesInto, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, writeLinks } from '../chunk-COSTF7QW.js';
|
|
4
|
+
export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeLegacyEntriesInto, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, writeLinks } from '../chunk-COSTF7QW.js';
|
|
5
5
|
export { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest, encodeSkaileManifest, loadSkPublishManifest, saveSkPublishManifest } from '../chunk-DZCK7GRW.js';
|
|
6
6
|
export { bundleDepRefs, fromAgentMd, fromAgentYaml, fromBundleYaml, fromConnectorMd, fromContractMd, fromFlowYaml, fromMcpServerMd, fromMcpServerMdContent, fromPromptMd, fromSkillMd, parseFrontmatter, parseRequires, scanDirectory, walkDir } from '../chunk-6IDBWPK2.js';
|
|
7
7
|
export { ASSET_KINDS, ASSET_NAME_HINT, INDIVIDUAL_KINDS, assetRefToDep, assetRefToStr, depToStr, entryFromRaw, entryToRaw, isValidAssetName, parseAssetRef, parseDep, repositoryFromRaw, repositoryToRaw, slugifyAssetName } from '../chunk-GEEW6SY2.js';
|
package/dist/sdk/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentClient } from '../chunk-SZ3SIVZQ.js';
|
|
2
|
-
import { startAgentServer } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
2
|
+
import { startAgentServer } from '../chunk-N2KV5RK3.js';
|
|
3
|
+
import '../chunk-JUZGLINM.js';
|
|
4
4
|
import '../chunk-X5YPJV4N.js';
|
|
5
5
|
import '../chunk-O7SG5PC2.js';
|
|
6
6
|
import '../chunk-7QBNJTTQ.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, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, 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, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-N2KV5RK3.js';
|
|
2
|
+
import '../chunk-JUZGLINM.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-7QBNJTTQ.js';
|
package/dist/tui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createAgentSession } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { createAgentSession } from '../chunk-N2KV5RK3.js';
|
|
2
|
+
import '../chunk-JUZGLINM.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-
|
|
1
|
+
export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-JUZGLINM.js';
|
|
2
2
|
export { err, ok, okJson } from '../chunk-X5YPJV4N.js';
|
|
3
3
|
import '../chunk-JB35MVBN.js';
|
|
4
4
|
import '../chunk-NSBPE2FW.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skaile/workspaces",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.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",
|