@shrkcrft/core 0.1.0-alpha.17 → 0.1.0-alpha.18

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.
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The `IDelegateRecipe` contract — a fenced, mechanical task a local-LLM worker
3
+ * may produce edits for (see `shrk delegate`).
4
+ *
5
+ * Lives in `core` (not `config`) so BOTH the config loader AND the pack contract
6
+ * (`@shrkcrft/plugin-api`, which depends only on core) can reference it — a pack
7
+ * ships recipes via `delegateRecipeFiles`, the config declares them inline, and
8
+ * both resolve to this one type.
9
+ */
10
+ /**
11
+ * Routing hints for a delegate recipe (forward-compat; recipes are resolved by
12
+ * explicit `--recipe <id>` today). Kept primitive — no dependency on the
13
+ * higher-layer task router.
14
+ */
15
+ export interface IDelegateRecipeMatch {
16
+ keywords?: readonly string[];
17
+ fileGlobs?: readonly string[];
18
+ }
19
+ /** A fenced, mechanical task a local-LLM worker may produce edits for. */
20
+ export interface IDelegateRecipe {
21
+ /** Stable id used by `shrk delegate run --recipe <id>`. */
22
+ id: string;
23
+ /** Human-readable label. */
24
+ title?: string;
25
+ /** Optional routing hints (unused by the explicit-`--recipe` path). */
26
+ match?: IDelegateRecipeMatch;
27
+ /**
28
+ * Allow-list of globs the worker may touch. A target path matching NONE of
29
+ * these is refused before any write — the worker's blast radius is fenced.
30
+ */
31
+ guardrailGlobs: readonly string[];
32
+ /**
33
+ * `IPlannedOperation` kinds the worker may emit (e.g. `'export'`,
34
+ * `'ensure-import'`). An op of any other kind is dropped, never applied.
35
+ */
36
+ allowedOps: readonly string[];
37
+ /** Local provider preference; defaults to the delegation block / `'auto'`. */
38
+ provider?: 'auto' | 'ollama' | 'llamacpp';
39
+ /** Model id passed to the provider. */
40
+ model?: string;
41
+ /** Max generate→verify attempts before escalating to a human. Default 2. */
42
+ maxAttempts?: number;
43
+ /** Per-attempt wall-clock budget (ms) for the model call. */
44
+ maxBudgetMs?: number;
45
+ /** Refuse delegation when the task risk exceeds this ceiling. */
46
+ riskCeiling?: 'low' | 'medium';
47
+ /**
48
+ * Deterministic verification ids run after the edit lands. Each MUST resolve
49
+ * to a `verificationCommands[].id` — this is the only way a recipe runs a
50
+ * verify command (a pack can never inject executable shell).
51
+ */
52
+ verificationIds: readonly string[];
53
+ }
54
+ //# sourceMappingURL=delegate-recipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegate-recipe.d.ts","sourceRoot":"","sources":["../../src/delegate/delegate-recipe.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAED,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B;;;OAGG;IACH,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;;;OAGG;IACH,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC1C,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,WAAW,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC/B;;;;OAIG;IACH,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The `IDelegateRecipe` contract — a fenced, mechanical task a local-LLM worker
3
+ * may produce edits for (see `shrk delegate`).
4
+ *
5
+ * Lives in `core` (not `config`) so BOTH the config loader AND the pack contract
6
+ * (`@shrkcrft/plugin-api`, which depends only on core) can reference it — a pack
7
+ * ships recipes via `delegateRecipeFiles`, the config declares them inline, and
8
+ * both resolve to this one type.
9
+ */
10
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './result/result.js';
2
2
  export * from './result/errors.js';
3
+ export * from './delegate/delegate-recipe.js';
3
4
  export * from './logger/log-level.js';
4
5
  export * from './logger/logger.js';
5
6
  export * from './fs/file-system.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./result/result.js";
2
2
  export * from "./result/errors.js";
3
+ export * from "./delegate/delegate-recipe.js";
3
4
  export * from "./logger/log-level.js";
4
5
  export * from "./logger/logger.js";
5
6
  export * from "./fs/file-system.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shrkcrft/core",
3
- "version": "0.1.0-alpha.17",
3
+ "version": "0.1.0-alpha.18",
4
4
  "description": "SharkCraft core primitives: Result, AppError, logger, file-system abstraction, path/string/object utils, IDs.",
5
5
  "license": "MIT",
6
6
  "author": "SharkCraft contributors",