@corenel/harness 0.8.0 → 0.9.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/dist/core/compactHistory.d.ts.map +1 -1
- package/dist/core/compactHistory.js +17 -2
- package/dist/core/compactHistory.js.map +1 -1
- package/dist/core/contextPressure.d.ts +45 -0
- package/dist/core/contextPressure.d.ts.map +1 -0
- package/dist/core/contextPressure.js +69 -0
- package/dist/core/contextPressure.js.map +1 -0
- package/dist/core/loop.d.ts.map +1 -1
- package/dist/core/loop.js +77 -12
- package/dist/core/loop.js.map +1 -1
- package/dist/core/pricing.d.ts +30 -1
- package/dist/core/pricing.d.ts.map +1 -1
- package/dist/core/pricing.js +50 -21
- package/dist/core/pricing.js.map +1 -1
- package/dist/guardrail/builtins.d.ts.map +1 -1
- package/dist/guardrail/builtins.js +9 -3
- package/dist/guardrail/builtins.js.map +1 -1
- package/dist/guardrail/validate.d.ts.map +1 -1
- package/dist/guardrail/validate.js +6 -2
- package/dist/guardrail/validate.js.map +1 -1
- package/dist/prompts/host.d.ts +23 -0
- package/dist/prompts/host.d.ts.map +1 -1
- package/dist/prompts/host.js.map +1 -1
- package/dist/prompts/index.d.ts +14 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +43 -2
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/library/defaults.generated.js +1 -1
- package/dist/prompts/library/defaults.generated.js.map +1 -1
- package/dist/providers/contextWindow.d.ts +23 -4
- package/dist/providers/contextWindow.d.ts.map +1 -1
- package/dist/providers/contextWindow.js +25 -0
- package/dist/providers/contextWindow.js.map +1 -1
- package/dist/skillSource.d.ts +36 -0
- package/dist/skillSource.d.ts.map +1 -0
- package/dist/skillSource.js +105 -0
- package/dist/skillSource.js.map +1 -0
- package/dist/skills.d.ts +38 -2
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +64 -9
- package/dist/skills.js.map +1 -1
- package/dist/tools/builtins.d.ts.map +1 -1
- package/dist/tools/builtins.js +48 -2
- package/dist/tools/builtins.js.map +1 -1
- package/package.json +2 -2
package/dist/core/pricing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../core/pricing.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,MAAM,UAAU,cAAc,CAAC,KAAY,EAAE,KAAwB;IACnE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;IAC1C,MAAM,IAAI,GAAG,OAAS,CAAC;IACvB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO;UACjC,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,GAAG,qBAAqB;UACvD,CAAC,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC;AACvD,CAAC;AAcD;;;;;WAKW;AACX,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,OAAO,KAAK,CAAC,OAAO,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC;AACjD,CAAC;
|
|
1
|
+
{"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../core/pricing.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,MAAM,UAAU,cAAc,CAAC,KAAY,EAAE,KAAwB;IACnE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,MAAM,GA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AE,CAAC;AAC7B,CAAC;AAED;;;;;;;;uCAQuC;AACvC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,QAAsC,EACtC,YAA0B,KAAK;IAE/B,OAAO,CAAC,MAAM,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../guardrail/builtins.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,6EAA6E;AAC7E,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../guardrail/builtins.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,6EAA6E;AAC7E,eAAO,MAAM,eAAe,EAAE,MAe7B,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,EAAE,MA+B9B,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,MAY/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAInD,CAAC"}
|
|
@@ -4,7 +4,11 @@ export const STANDARD_POLICY = {
|
|
|
4
4
|
name: 'standard',
|
|
5
5
|
description: 'Read-only tools run automatically; writes ask for approval.',
|
|
6
6
|
onViolation: 'stop',
|
|
7
|
-
maxTurns
|
|
7
|
+
// maxTurns counts iterations WITHIN one user message (one model call plus
|
|
8
|
+
// its tool round-trip), not messages across a conversation -- 8 was
|
|
9
|
+
// exhausted inside a single tool-heavy reply. 0 means unlimited (see
|
|
10
|
+
// core/loop.ts); this default stays a finite backstop.
|
|
11
|
+
maxTurns: 40,
|
|
8
12
|
permissions: {
|
|
9
13
|
'prompd:propose_edit': 'allow', // proposals are reviewed in the diff UI, not applied directly
|
|
10
14
|
'system:*': 'deny', // harness self-configuration is never automatic
|
|
@@ -17,7 +21,7 @@ export const READ_ONLY_POLICY = {
|
|
|
17
21
|
name: 'read-only',
|
|
18
22
|
description: 'Inspection only — all writes and side effects are refused.',
|
|
19
23
|
onViolation: 'stop',
|
|
20
|
-
maxTurns:
|
|
24
|
+
maxTurns: 40, // see STANDARD_POLICY: counts iterations within one reply, not conversation turns
|
|
21
25
|
tools: {
|
|
22
26
|
deny: [
|
|
23
27
|
'fs:write_file', 'fs:create_file', 'fs:delete_file', 'fs:rename_file',
|
|
@@ -50,7 +54,9 @@ export const AUTONOMOUS_POLICY = {
|
|
|
50
54
|
name: 'autonomous',
|
|
51
55
|
description: 'Everything runs automatically — no approval prompts (system config still asks).',
|
|
52
56
|
onViolation: 'warn',
|
|
53
|
-
|
|
57
|
+
// Higher than the other builtins: nobody is watching an autonomous run turn
|
|
58
|
+
// by turn, so it gets more headroom before the backstop kicks in.
|
|
59
|
+
maxTurns: 80,
|
|
54
60
|
permissions: {
|
|
55
61
|
'system:*': 'ask', // even unattended, never silently reconfigure the harness
|
|
56
62
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../guardrail/builtins.ts"],"names":[],"mappings":"AAQA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAW;IACrC,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,6DAA6D;IAC1E,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../guardrail/builtins.ts"],"names":[],"mappings":"AAQA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAW;IACrC,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,6DAA6D;IAC1E,WAAW,EAAE,MAAM;IAC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QACX,UAAU,EAAE,KAAK,EAAE,0DAA0D;KAC9E;IACD,iBAAiB,EAAE,OAAO;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,QAAQ,EAAE,eAAe;IACzB,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,iBAAiB;CAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../guardrail/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAoD,MAAM,mBAAmB,CAAC;AAkBlG,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AA2BD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../guardrail/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAoD,MAAM,mBAAmB,CAAC;AAkBlG,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AA2BD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAuErE"}
|
|
@@ -54,8 +54,12 @@ export function validatePolicy(input) {
|
|
|
54
54
|
if (o.onViolation !== undefined && !ACTIONS.includes(o.onViolation)) {
|
|
55
55
|
errors.push(`Policy.onViolation must be one of: ${ACTIONS.join(', ')}.`);
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
// 0 is a valid, meaningful value here -- explicit "unlimited turns" (see
|
|
58
|
+
// core/loop.ts) -- so maxTurns alone accepts a non-negative integer, not
|
|
59
|
+
// the strictly-positive isPosInt every other budget field requires.
|
|
60
|
+
if (o.maxTurns !== undefined && !(typeof o.maxTurns === 'number' && Number.isInteger(o.maxTurns) && o.maxTurns >= 0)) {
|
|
61
|
+
errors.push('Policy.maxTurns must be a non-negative integer (0 means unlimited).');
|
|
62
|
+
}
|
|
59
63
|
if (o.maxToolCalls !== undefined && !isPosInt(o.maxToolCalls))
|
|
60
64
|
errors.push('Policy.maxToolCalls must be a positive integer.');
|
|
61
65
|
if (o.tools !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../guardrail/validate.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,GAAsB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC3D,MAAM,OAAO,GAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,MAAM,UAAU,GAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/D;mFACmF;AACnF,MAAM,aAAa,GAAoC;IACrD,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM;IACxC,IAAI,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM;CACzC,CAAC;AAEF,kFAAkF;AAClF,SAAS,cAAc,CAAC,CAAU;IAChC,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9D,CAAC;AAQD,SAAS,aAAa,CAAC,CAAU;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AACnE,CAAC;AACD,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,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MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;YAClF,CAAC,CAAC,eAAe,GAAG,IAAI,CAAC;IAChC,CAAC;IACD,IAAI,CAAC,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAA4B,CAAC,EAAE,CAAC;QACvF,MAAM,CAAC,IAAI,CAAC,qCAAqC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7E,CAAC;IACD,IAAI,CAAC,CAAC,aAAa,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC;QAChE,MAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,MAAM,CAAC,MAAM;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAe,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC3D,CAAC"}
|
package/dist/prompts/host.d.ts
CHANGED
|
@@ -58,6 +58,29 @@ export interface PromptHost {
|
|
|
58
58
|
* itself with this, so a shared prompt cannot hardcode either brand. Optional:
|
|
59
59
|
* a host that does not set one gets the neutral default. */
|
|
60
60
|
appName?(): string;
|
|
61
|
+
/**
|
|
62
|
+
* The PRODUCT's own guidance on the tools this run actually has — shipped in
|
|
63
|
+
* the binary, not in the config workspace.
|
|
64
|
+
*
|
|
65
|
+
* WHY A HOOK AND NOT A FILE. `tools/guidance.md` is one shipped default
|
|
66
|
+
* seeded into every host's workspace, so anything host-specific written
|
|
67
|
+
* there would be wrong somewhere: the browser has no shell, and telling it
|
|
68
|
+
* about one is how the base prompt came to advertise `search_packages` to a
|
|
69
|
+
* CLI that never registers it. `reconcileConfig` iterates a module constant,
|
|
70
|
+
* so per-host default FILES are not available without changing how seeding
|
|
71
|
+
* works. A hook is the seam `appName` and `siteIndex` already use.
|
|
72
|
+
*
|
|
73
|
+
* KEYED ON THE TOOL NAMES, not on the host, because the host is the wrong
|
|
74
|
+
* granularity: the sidecar runs on this same node host but gates its shell
|
|
75
|
+
* behind `--allow-shell`, so "node means there is a shell" is false. An
|
|
76
|
+
* implementation must describe only what it is handed and stay silent about
|
|
77
|
+
* the rest — guidance for an absent tool is the original bug wearing a
|
|
78
|
+
* different hat.
|
|
79
|
+
*
|
|
80
|
+
* Composed ABOVE the workspace's `tools/guidance.md`, so the user's file is
|
|
81
|
+
* the last word and can qualify or contradict it.
|
|
82
|
+
*/
|
|
83
|
+
toolGuidance?(toolNames: string[]): string;
|
|
61
84
|
}
|
|
62
85
|
/** Wire the host bits at boot (the app calls this before composing). */
|
|
63
86
|
export declare function setPromptHost(h: PromptHost): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../prompts/host.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAAG,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE;AAChE,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAAG,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;AAElD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,SAAS,EAAE,WAAW,CAAC;IACvB,+DAA+D;IAC/D,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;+DAG2D;IAC3D,QAAQ,CAAC,IAAI,cAAc,CAAC;IAC5B,uDAAuD;IACvD,KAAK,CAAC,MA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;IACpC,yEAAyE;IACzE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACrF;gEAC4D;IAC5D,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACxG,+DAA+D;IAC/D,SAAS,IAAI,MAAM,CAAC;IACpB;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,IAAI,WAAW,GAAG,IAAI,CAAC;IACxC;;gEAE4D;IAC5D,OAAO,CAAC,IAAI,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CAC5C;AAID,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAc;AAEhE,wBAAgB,UAAU,IAAI,UAAU,CAGvC;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,IAAI,WAAW,CAAmC"}
|
package/dist/prompts/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../prompts/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../prompts/host.ts"],"names":[],"mappings":"AA8FA,IAAI,IAAI,GAAsB,IAAI,CAAC;AAEnC,wEAAwE;AACxE,MAAM,UAAU,aAAa,CAAC,CAAa,IAAU,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AAEhE,MAAM,UAAU,UAAU;IACxB,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,eAAe,KAAkB,OAAO,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -45,7 +45,21 @@ export interface ComposeArgs {
|
|
|
45
45
|
/** Optional host hook: the merged MEMORY.md index (both scopes). Injected into
|
|
46
46
|
* file_context so the agent knows what it can recall. Absent/empty -> no block. */
|
|
47
47
|
memoryIndex?: () => Promise<string>;
|
|
48
|
+
/** Facts about THIS run that the model cannot infer from anything else it is
|
|
49
|
+
* given — the host's working directory, its platform. One `Label: value` per
|
|
50
|
+
* entry. The DATE is always added here by compose (every host has a clock),
|
|
51
|
+
* so a host passing nothing still gets a dated prompt.
|
|
52
|
+
*
|
|
53
|
+
* THE BUG this closes: the terminal face composed with `{ mode, tools }` and
|
|
54
|
+
* nothing else, so the agent knew neither the date, nor the directory it was
|
|
55
|
+
* standing in, nor that it was on Windows — and guessed all three, which on
|
|
56
|
+
* Windows costs a failed command. */
|
|
57
|
+
runFacts?: string[];
|
|
48
58
|
}
|
|
59
|
+
/** The {{ run_context }} block: the date (always) plus whatever the host knows.
|
|
60
|
+
* `toISOString().slice(0, 10)` deliberately — a UTC calendar date is a fact the
|
|
61
|
+
* model can reason from, where a locale-formatted one is ambiguous to parse. */
|
|
62
|
+
export declare function formatRunContext(extra?: string[]): string;
|
|
49
63
|
/**
|
|
50
64
|
* Assemble the agent system prompt. The system prompt is the config file
|
|
51
65
|
* systems/system-base.md (a .prmd with declared parameters); @prompd/core
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../prompts/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;iFACiF;AACjF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,MAAM,CAA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OAAO,CAAC,MAAM,CAAC,CAuE3E;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,aAAa,SAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAO3E"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -49,6 +49,13 @@ export async function compileConfigTemplate(path, params, source) {
|
|
|
49
49
|
return liveSrc.trim();
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
/** The {{ run_context }} block: the date (always) plus whatever the host knows.
|
|
53
|
+
* `toISOString().slice(0, 10)` deliberately — a UTC calendar date is a fact the
|
|
54
|
+
* model can reason from, where a locale-formatted one is ambiguous to parse. */
|
|
55
|
+
export function formatRunContext(extra = []) {
|
|
56
|
+
const lines = [`Date: ${new Date().toISOString().slice(0, 10)}`, ...extra.map((s) => s.trim()).filter(Boolean)];
|
|
57
|
+
return lines.join('\n');
|
|
58
|
+
}
|
|
52
59
|
/** Render tool definitions as a markdown list for the {{ tools }} parameter. */
|
|
53
60
|
function formatTools(tools) {
|
|
54
61
|
return tools && tools.length ? formatToolLines(tools) : '';
|
|
@@ -78,7 +85,27 @@ export async function composeAgentSystem(args) {
|
|
|
78
85
|
]);
|
|
79
86
|
// The default tool-guidance body is an HTML-comment placeholder — drop it so it
|
|
80
87
|
// doesn't leak into the prompt; real guidance (no comment) passes through.
|
|
81
|
-
const
|
|
88
|
+
const userGuidance = toolGuidanceRaw.replace(/<!--[\s\S]*?-->/g, '').trim();
|
|
89
|
+
/* The PRODUCT's guidance for the tools this run actually has (PromptHost.
|
|
90
|
+
* toolGuidance), above the user's file so their file is the last word.
|
|
91
|
+
*
|
|
92
|
+
* Names come from `args.tools`, which is the same array the caller turns into
|
|
93
|
+
* the model's function schemas. A caller that passes `toolsText` instead (the
|
|
94
|
+
* worker, filling TOOLS_MARKER later) has no names here and gets no host
|
|
95
|
+
* guidance -- correct, since guidance for tools nobody enumerated would be
|
|
96
|
+
* guidance for tools that might not be there.
|
|
97
|
+
*
|
|
98
|
+
* Best-effort: a host hook that throws must not take the prompt down. */
|
|
99
|
+
let hostGuidance = '';
|
|
100
|
+
if (args.includeToolGuidance !== false) {
|
|
101
|
+
try {
|
|
102
|
+
hostGuidance = promptHost().toolGuidance?.((args.tools ?? []).map((t) => t.name))?.trim() ?? '';
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
hostGuidance = '';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const tool_guidance = [hostGuidance, userGuidance].filter(Boolean).join('\n\n');
|
|
82
109
|
// Enabled skills inject their SKILL.md as an extra context block (with a gated-
|
|
83
110
|
// scripts note). Read-only + best-effort — a skills failure never breaks compose.
|
|
84
111
|
const skillsBlock = await enabledSkillInstructions(args.skillAllow).catch(() => '');
|
|
@@ -98,7 +125,21 @@ export async function composeAgentSystem(args) {
|
|
|
98
125
|
mode_hint,
|
|
99
126
|
tool_guidance,
|
|
100
127
|
tools: args.toolsText ?? formatTools(args.tools),
|
|
101
|
-
|
|
128
|
+
run_context: formatRunContext(args.runFacts),
|
|
129
|
+
/* THREE SLOTS, not one. These used to be concatenated into `file_context`,
|
|
130
|
+
* whose own declared description is "the editor file / selection /
|
|
131
|
+
* compiled-output context block" -- so skills and memory were filed as
|
|
132
|
+
* incidental context, below the mode hint, in a parameter documented to
|
|
133
|
+
* hold something else. Skills are not context: they are instructions that
|
|
134
|
+
* change how a task is done, and burying sixteen of them under a slot that
|
|
135
|
+
* means "here is the open file" is what made them easy to ignore.
|
|
136
|
+
*
|
|
137
|
+
* ORDER in the template is skills, memory, then file_context -- the editor
|
|
138
|
+
* context stays LAST, nearest the user's message, because it is the part
|
|
139
|
+
* that changes every turn. */
|
|
140
|
+
skills: skillsBlock,
|
|
141
|
+
memory: memoryBlock,
|
|
142
|
+
file_context: (args.contextText || '').trim(),
|
|
102
143
|
...(args.params || {}),
|
|
103
144
|
}, args.systemText);
|
|
104
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","source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7 +35,7 @@ export const RAW_DEFAULTS = {
|
|
|
35
35
|
"personas/senior-dev.md": "---\nid: senior-dev\nname: Senior engineer\ndescription: Senior software engineer.\n---\nYou are a senior software engineer. Bring that craft to every change:\n- Fit the codebase. Study neighboring code and follow its conventions before writing. Don't assume a library is available — confirm it's already used in the project before depending on it.\n- Write the minimum that solves the task. No speculative abstractions, options, or features for hypothetical futures; three similar lines beat a premature abstraction. No half-finished or stubbed implementations.\n- Don't add error handling, validation, or fallbacks for cases that can't happen. Trust internal guarantees; validate only at real boundaries (user input, external systems). No backwards-compat shims unless asked.\n- Comments are for the non-obvious WHY — a constraint, an invariant, a workaround. Don't narrate what the code already says; default to none.\n- Verify your work before calling a change done. If you couldn't verify something, say so plainly.\n- Be security-minded: no injection, no leaked secrets, least privilege.\n",
|
|
36
36
|
"personas/terse.md": "---\nid: terse\nname: Terse\ndescription: Extremely concise.\n---\nBe extremely concise. One sentence per update. No preamble. No summary unless asked.\n",
|
|
37
37
|
"memory/MEMORY.md": "# Memory index\n\nSaved notes appear here, one line each. The agent adds them with save_memory and\nreads them with recall_memory. This is the global (~/.prompd) memory; a project's\nown notes live in ./.prompd/memory.\n",
|
|
38
|
-
"systems/system-base.md": "---\nid: system-base\nname: Operational system prompt\nversion: 1.0.0\ndescription: The agent's system prompt — surface-agnostic identity, mode, tool definitions and context composed by @prompd/core. Editor and workflow specifics live in the prompts that inherit this one.\nparameters:\n - name: persona\n type: string\n description: The selected persona's voice/role text, placed first.\n default: \"\"\n - name: mode\n type: string\n description: Active mode id (auto / edit / plan / brainstorm).\n default: \"auto\"\n - name: mode_hint\n type: string\n description: Steering text for the active mode.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: The editor file / selection / compiled-output context block.\n default: \"\"\n - name: app\n type: string\n description: Product name of the host application, used for the agent's own identity.\n default: \"Prompd\"\n---\n{% if persona %}{{ persona }}\n\n{% endif %}You are the {{ app }} assistant. You help the user do real work
|
|
38
|
+
"systems/system-base.md": "---\nid: system-base\nname: Operational system prompt\nversion: 1.0.0\ndescription: The agent's system prompt — surface-agnostic identity, mode, tool definitions and context composed by @prompd/core. Editor and workflow specifics live in the prompts that inherit this one.\nparameters:\n - name: persona\n type: string\n description: The selected persona's voice/role text, placed first.\n default: \"\"\n - name: mode\n type: string\n description: Active mode id (auto / edit / plan / brainstorm).\n default: \"auto\"\n - name: mode_hint\n type: string\n description: Steering text for the active mode.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: The editor file / selection / compiled-output context block.\n default: \"\"\n - name: skills\n type: string\n description: Instructions contributed by the skills enabled for this run.\n default: \"\"\n - name: memory\n type: string\n description: The index of notes saved to this run's memory plane.\n default: \"\"\n - name: run_context\n type: string\n description: Facts about THIS run the model cannot otherwise know — the date, and whatever the host adds (working directory, platform).\n default: \"\"\n - name: app\n type: string\n description: Product name of the host application, used for the agent's own identity.\n default: \"Prompd\"\n---\n{% if persona %}{{ persona }}\n\n{% endif %}You are the {{ app }} assistant. You help the user do real work: reading and changing files, composing and running prompts and workflows, and building software. Work from the context you were given below rather than assuming a particular screen.\n\nVerify before you claim. Do not say something is done, fixed, passing or ready unless you checked it in this conversation and can point at what you checked. If you did not run it, say you did not run it. If a check failed, say so plainly and show what failed. A wrong claim of success costs the user far more than the check would have.\n\nSay what you assumed and what you did not do. A request that leaves room for interpretation gets its decisions named, one line each, so the user can correct one without unpicking the rest. How much you decide for yourself versus ask about is the mode's call, below.\n\nA tool call that comes back denied, blocked or unavailable is a decision, not a failure to route around. Do not retry it, do not reach for another tool to accomplish the same thing, and never describe the change as made. Say what you wanted to do and stop.\n\nPrefer calling a tool over guessing: read the file rather than recalling it, run the command rather than predicting its output. Use the file tools to read and change files, and compile_prompd to preview rendered output. For a job with several steps, keep a visible task list with todo_write and mark each step as you finish it.\n\nBe brief. Lead with the answer, then only what the user needs to act on or check it. Use headings, lists and tables where they carry something prose would not, and prose everywhere else. Do not restate the request back, do not narrate what you are about to do, and do not end by summarizing what the user has just read.\n\n{% if run_context %}## This run\n{{ run_context }}\n\n{% endif %}## Tools available this run\n{{ tools }}\n{% if tool_guidance %}\n\n{{ tool_guidance }}\n{% endif %}\n{% if mode_hint %}\n\n## Mode\n{{ mode_hint }}\n{% endif %}\n{% if skills %}\n\n{{ skills }}\n{% endif %}\n{% if memory %}\n\n{{ memory }}\n{% endif %}\n{% if file_context %}\n\n{{ file_context }}\n{% endif %}\n",
|
|
39
39
|
"systems/system-crew-agent.md": "---\nid: system-crew-agent\nname: Crew agent — interactive chat\nversion: 1.0.0\ndescription: The system prompt for a crew agent talking to a person in the Chat tab. The agent's own definition leads; this only adds what the browser session needs and the daemon does not.\nparameters:\n - name: agent_system\n type: string\n description: The crew agent's own composed definition — role, soul, persona, instructions, memory and self-direction. Placed FIRST because it is the agent's identity, not context about it.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: Workspace description and any host-supplied context blocks.\n default: \"\"\n---\n{{ agent_system }}\n\n## This session\n\nYou are talking with a person, in a chat window, right now. This is not one of\nyour triggered runs: nobody scheduled it, and the person who opened it is\nreading your replies as they arrive and can answer you.\n\nThat changes one thing about how you work. When a request is genuinely\nambiguous, ask — a short, specific question, then wait. On a triggered run\nthere is nobody to ask and you have to make a reasonable assumption and record\nit; here, asking is cheaper and better. Do not ask when you can simply begin:\none clarifying question that unblocks real work beats a list of questions that\npostpones it.\n\nEverything else is unchanged. You are the same agent here as when you run on a\nschedule — same role, same instructions, same memory, same limits. This window\nis where your person works with you directly, and a good way for them to see\nwhat you will do before you do it unattended.\n\n## Tools available this run\n{{ tools }}\n{% if tool_guidance %}\n\n{{ tool_guidance }}\n{% endif %}\n{% if file_context %}\n\n{{ file_context }}\n{% endif %}\n",
|
|
40
40
|
"systems/system-pdflow.md": "---\nid: system-pdflow\nname: Workflow file system prompt\nversion: 1.0.0\ndescription: Adds .pdflow format knowledge (node taxonomy, edges, parameters) on top of the base system prompt.\ninherits: system-base.md\n---\n\n## Active file format — Prompd workflow (.pdflow)\n\nThe open file is a **Prompd workflow**: JSON with `{ version, metadata, parameters[], nodes[], edges[] }`. The web editor renders it as a linear chain — a fixed Start, ordered middle nodes, a fixed End — connected one edge each.\n\nEach node is `{ id, type, position, data }`. Node types and their key `data`:\n\n- `trigger` — Start (entry point). Exactly one.\n- `prompt` — runs a `.prmd`/`.md` prompt. `data.sourceType` is `'file'` (`data.source` = a WORKSPACE-RELATIVE path) or `'raw'` (`data.rawPrompt`). Optional `data.model` / `data.providerNodeId`.\n- `user-input` — pauses to collect input. `data.prompt`, `data.inputType` (`text` / `textarea` / `choice` / `confirm` / `number`).\n- `guardrail` — validates/gates. `data.systemPrompt`, `data.passExpression` or `data.scoreThreshold`.\n- `agent` — composite (input guardrail → prompt → output guardrail). `data.systemPrompt`, `data.userPrompt`, `data.maxIterations`; internal guardrails in `data.inputGuardrail` / `data.outputGuardrail` (each `{ enabled, preset|systemPrompt, passExpression|scoreThreshold }`).\n- `transformer` — JSON→JSON map. `data.mode: 'template'` with `data.template` (`{{ input }}` substitution).\n- `callback` / `checkpoint` — debug/observation point (logs node I/O).\n- `output` — End (workflow result). Exactly one.\n- `provider` — one off-chain node holding the canvas-wide provider/model; nodes reference it via `data.providerNodeId`.\n\nEdges thread each node's output to the next; the runner exposes `{{ input }}` / `{{ previous_output }}` to downstream nodes.\n\n### Example (minimal chain)\n\n```\n{\n \"version\": \"1.0\",\n \"metadata\": { \"name\": \"summarize\" },\n \"parameters\": [],\n \"nodes\": [\n { \"id\": \"start\", \"type\": \"trigger\", \"position\": { \"x\": 0, \"y\": 0 }, \"data\": {} },\n { \"id\": \"p1\", \"type\": \"prompt\", \"position\": { \"x\": 0, \"y\": 120 }, \"data\": { \"sourceType\": \"file\", \"source\": \"prompts/summarize.prmd\" } },\n { \"id\": \"end\", \"type\": \"output\", \"position\": { \"x\": 0, \"y\": 240 }, \"data\": {} }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"start\", \"target\": \"p1\" },\n { \"id\": \"e2\", \"source\": \"p1\", \"target\": \"end\" }\n ]\n}\n```\n\nTo edit the workflow, modify this JSON with the file tools (paths are workspace-relative). Keep exactly one `trigger` and one `output`.\n",
|
|
41
41
|
"systems/system-prmd-md.md": "---\nid: system-prmd-md\nname: Prompt file system prompt (.prmd / .md)\nversion: 1.0.0\ninherits: ./system-base.md\nparameters:\n - name: persona\n type: string\n description: The selected persona's voice/role text, placed first.\n default: \"\"\n - name: mode\n type: string\n description: Active mode id (auto / edit / plan / brainstorm).\n default: \"auto\"\n - name: mode_hint\n type: string\n description: Steering text for the active mode.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: The editor file / selection / compiled-output context block.\n default: \"\"\n---\n\n{% include \"../languages/prmd.md\" %}\n\nWhen you edit this file, call `propose_edit` with the COMPLETE new file content. Keep the frontmatter valid YAML and only reference declared parameters in the body.\n",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.generated.js","sourceRoot":"","sources":["../../../prompts/library/defaults.generated.ts"],"names":[],"mappings":"AAAA;;gFAEgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,wBAAwB,EAAE,2iFAA2iF;IACrkF,mBAAmB,EAAE,0PAA0P;IAC/Q,2BAA2B,EAAE,87EAA87E;IAC39E,qCAAqC,EAAE,wuBAAwuB;IAC/wB,aAAa,EAAE,ysBAAysB;IACxtB,mBAAmB,EAAE,soJAAsoJ;IAC3pJ,eAAe,EAAE,krBAAkrB;IACnsB,qBAAqB,EAAE,mZAAmZ;IAC1a,eAAe,EAAE,uVAAuV;IACxW,eAAe,EAAE,6gBAA6gB;IAC9hB,gBAAgB,EAAE,mnCAAmnC;IACroC,cAAc,EAAE,86HAA86H;IAC97H,wBAAwB,EAAE,utBAAutB;IACjvB,yBAAyB,EAAE,49CAA49C;IACv/C,gBAAgB,EAAE,8hCAA8hC;IAChjC,qBAAqB,EAAE,g7CAAg7C;IACv8C,2BAA2B,EAAE,+pBAA+pB;IAC5rB,mBAAmB,EAAE,uiBAAuiB;IAC5jB,wBAAwB,EAAE,+sBAA+sB;IACzuB,yBAAyB,EAAE,0jBAA0jB;IACrlB,mBAAmB,EAAE,qmBAAqmB;IAC1nB,mBAAmB,EAAE,koBAAkoB;IACvpB,yBAAyB,EAAE,2bAA2b;IACtd,sBAAsB,EAAE,yiBAAyiB;IACjkB,oBAAoB,EAAE,qbAAqb;IAC3c,uBAAuB,EAAE,mhBAAmhB;IAC5iB,qBAAqB,EAAE,oKAAoK;IAC3L,0BAA0B,EAAE,4uBAA4uB;IACxwB,6BAA6B,EAAE,00BAA00B;IACz2B,8BAA8B,EAAE,qlCAAqlC;IACrnC,wBAAwB,EAAE,ykCAAykC;IACnmC,mBAAmB,EAAE,2JAA2J;IAChL,kBAAkB,EAAE,8NAA8N;IAClP,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"defaults.generated.js","sourceRoot":"","sources":["../../../prompts/library/defaults.generated.ts"],"names":[],"mappings":"AAAA;;gFAEgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,wBAAwB,EAAE,2iFAA2iF;IACrkF,mBAAmB,EAAE,0PAA0P;IAC/Q,2BAA2B,EAAE,87EAA87E;IAC39E,qCAAqC,EAAE,wuBAAwuB;IAC/wB,aAAa,EAAE,ysBAAysB;IACxtB,mBAAmB,EAAE,soJAAsoJ;IAC3pJ,eAAe,EAAE,krBAAkrB;IACnsB,qBAAqB,EAAE,mZAAmZ;IAC1a,eA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AC97I,CAAC"}
|
|
@@ -7,13 +7,32 @@
|
|
|
7
7
|
export declare const CONSERVATIVE_FALLBACK_WINDOW = 32000;
|
|
8
8
|
export interface ResolvedContextWindow {
|
|
9
9
|
window: number;
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
10
|
+
/** Where this window came from — surfaced so a caller can report it (see
|
|
11
|
+
* `corenel doctor` / --debug), since a silent wrong guess is what caused
|
|
12
|
+
* this bug in the first place.
|
|
13
|
+
* - 'hydrated': the backend's own catalog said so (see
|
|
14
|
+
* @corenel/harness/core/pricing's `WindowTable`) — authoritative,
|
|
15
|
+
* preferred over everything below.
|
|
16
|
+
* - 'known': the hand-maintained static map in this file.
|
|
17
|
+
* - 'fallback': neither of the above knew this model; CONSERVATIVE_FALLBACK_WINDOW. */
|
|
18
|
+
source: 'hydrated' | 'known' | 'fallback';
|
|
14
19
|
}
|
|
15
20
|
/** Resolve a model id's context window. Exact match first, then the id with a
|
|
16
21
|
* trailing date/version suffix stripped, else the conservative fallback.
|
|
17
22
|
* Case-insensitive, since provider ids are inconsistent about it. */
|
|
18
23
|
export declare function resolveContextWindow(modelId: string): ResolvedContextWindow;
|
|
24
|
+
/** Same resolution as `resolveContextWindow`, but checks a hydrated table
|
|
25
|
+
* FIRST (see @corenel/harness/core/pricing's `WindowTable`) -- the backend's
|
|
26
|
+
* own catalog, which knows about a model released after this file's
|
|
27
|
+
* `KNOWN_WINDOWS` was last hand-edited. This is a layer ON TOP of
|
|
28
|
+
* `resolveContextWindow`, not a replacement for it: `resolveContextWindow`
|
|
29
|
+
* itself stays synchronous and network-free (see this file's header) for
|
|
30
|
+
* callers with no hydrated data yet, e.g. before hydration has completed or
|
|
31
|
+
* when it never will (offline / signed-out -- `hydrated` is then `null` or
|
|
32
|
+
* empty and this falls straight through to the exact same static-map-then-
|
|
33
|
+
* fallback behavior).
|
|
34
|
+
*
|
|
35
|
+
* `hydrated` may be `null`/`undefined` (nothing fetched yet) or empty (fetch
|
|
36
|
+
* ran but returned nothing, e.g. no token) -- both fall through unchanged. */
|
|
37
|
+
export declare function resolveContextWindowWithHydration(modelId: string, hydrated: ReadonlyMap<string, number> | null | undefined): ResolvedContextWindow;
|
|
19
38
|
//# sourceMappingURL=contextWindow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextWindow.d.ts","sourceRoot":"","sources":["../../providers/contextWindow.ts"],"names":[],"mappings":"AA4CA;;;;;sCAKsC;AACtC,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf
|
|
1
|
+
{"version":3,"file":"contextWindow.d.ts","sourceRoot":"","sources":["../../providers/contextWindow.ts"],"names":[],"mappings":"AA4CA;;;;;sCAKsC;AACtC,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;4FAOwF;IACxF,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;CAC3C;AASD;;qEAEqE;AACrE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAM3E;AAED;;;;;;;;;;;;8EAY8E;AAC9E,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,GACvD,qBAAqB,CAWvB"}
|
|
@@ -65,4 +65,29 @@ export function resolveContextWindow(modelId) {
|
|
|
65
65
|
return { window: KNOWN_WINDOWS[stripped], source: 'known' };
|
|
66
66
|
return { window: CONSERVATIVE_FALLBACK_WINDOW, source: 'fallback' };
|
|
67
67
|
}
|
|
68
|
+
/** Same resolution as `resolveContextWindow`, but checks a hydrated table
|
|
69
|
+
* FIRST (see @corenel/harness/core/pricing's `WindowTable`) -- the backend's
|
|
70
|
+
* own catalog, which knows about a model released after this file's
|
|
71
|
+
* `KNOWN_WINDOWS` was last hand-edited. This is a layer ON TOP of
|
|
72
|
+
* `resolveContextWindow`, not a replacement for it: `resolveContextWindow`
|
|
73
|
+
* itself stays synchronous and network-free (see this file's header) for
|
|
74
|
+
* callers with no hydrated data yet, e.g. before hydration has completed or
|
|
75
|
+
* when it never will (offline / signed-out -- `hydrated` is then `null` or
|
|
76
|
+
* empty and this falls straight through to the exact same static-map-then-
|
|
77
|
+
* fallback behavior).
|
|
78
|
+
*
|
|
79
|
+
* `hydrated` may be `null`/`undefined` (nothing fetched yet) or empty (fetch
|
|
80
|
+
* ran but returned nothing, e.g. no token) -- both fall through unchanged. */
|
|
81
|
+
export function resolveContextWindowWithHydration(modelId, hydrated) {
|
|
82
|
+
if (hydrated && hydrated.size > 0) {
|
|
83
|
+
const id = modelId.trim().toLowerCase();
|
|
84
|
+
for (const [key, window] of hydrated) {
|
|
85
|
+
const keyId = key.trim().toLowerCase();
|
|
86
|
+
if (keyId === id || stripDateSuffix(keyId) === stripDateSuffix(id)) {
|
|
87
|
+
return { window, source: 'hydrated' };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return resolveContextWindow(modelId);
|
|
92
|
+
}
|
|
68
93
|
//# sourceMappingURL=contextWindow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextWindow.js","sourceRoot":"","sources":["../../providers/contextWindow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;gDA2BgD;AAEhD;;wCAEwC;AACxC,MAAM,aAAa,GAA2B;IAC5C,mBAAmB,EAAE,MAAO;IAC5B,kBAAkB,EAAE,MAAO;IAC3B,iBAAiB,EAAE,MAAO;IAC1B,aAAa,EAAE,MAAO;IACtB,cAAc,EAAE,OAAS;IACzB,OAAO,EAAE,MAAO;IAChB,YAAY,EAAE,MAAO;IACrB,gBAAgB,EAAE,OAAS;IAC3B,kBA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,EAAE,UAAU,EAAE,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;8EAY8E;AAC9E,MAAM,UAAU,iCAAiC,CAC/C,OAAe,EACf,QAAwD;IAExD,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACxC,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACvC,IAAI,KAAK,KAAK,EAAE,IAAI,eAAe,CAAC,KAAK,CAAC,KAAK,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;gBACnE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** What a repo host has to answer. Injected; see the note above. */
|
|
2
|
+
export interface RepoFetch {
|
|
3
|
+
json: (url: string) => Promise<unknown>;
|
|
4
|
+
text: (url: string) => Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export interface RepoRef {
|
|
7
|
+
owner: string;
|
|
8
|
+
repo: string;
|
|
9
|
+
ref: string;
|
|
10
|
+
}
|
|
11
|
+
/** One skill folder found in a repo. */
|
|
12
|
+
export interface RepoSkill {
|
|
13
|
+
/** Folder name, which is the installed name unless its frontmatter says otherwise. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Path of the folder inside the repo. */
|
|
16
|
+
dir: string;
|
|
17
|
+
/** Every file under it, repo-relative. */
|
|
18
|
+
files: string[];
|
|
19
|
+
}
|
|
20
|
+
/** `github.com/owner/repo`, with or without scheme, `.git`, or a `/tree/<ref>`. */
|
|
21
|
+
export declare function parseRepoUrl(input: string): RepoRef | null;
|
|
22
|
+
/** Every skill folder in the repo: a directory holding SKILL.md or SKILL.prmd. */
|
|
23
|
+
export declare function discoverRepoSkills(ref: RepoRef, http: RepoFetch): Promise<RepoSkill[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Fetch the chosen skills and write them into the config workspace.
|
|
26
|
+
*
|
|
27
|
+
* Reports per skill rather than throwing the first failure: one unreachable
|
|
28
|
+
* file in one skill of fifteen is not a reason to lose the other fourteen, and
|
|
29
|
+
* a caller has to be able to say which ones landed.
|
|
30
|
+
*/
|
|
31
|
+
export declare function installRepoSkills(ref: RepoRef, skills: readonly RepoSkill[], http: RepoFetch): Promise<{
|
|
32
|
+
name: string;
|
|
33
|
+
ok: boolean;
|
|
34
|
+
error?: string;
|
|
35
|
+
}[]>;
|
|
36
|
+
//# sourceMappingURL=skillSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillSource.d.ts","sourceRoot":"","sources":["../skillSource.ts"],"names":[],"mappings":"AAyBA,oEAAoE;AACpE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,OAAO;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE;AAErE,wCAAwC;AACxC,MAAM,WAAW,SAAS;IACxB,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AASD,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAQ1D;AAUD,kFAAkF;AAClF,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CA4B5F;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,IAAI,EAAE,SAAS,GACd,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAgB1D"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* Installing skills from a repository.
|
|
2
|
+
*
|
|
3
|
+
* The existing install path takes a .pdpkg — one archive, one skill. Skills in
|
|
4
|
+
* the wild are not shipped that way: they are folders in a git repo, many per
|
|
5
|
+
* repo (obra/superpowers is `skills/<name>/SKILL.md` × 15, among 231 files of
|
|
6
|
+
* tests and docs). So this walks a repo instead and takes only the folders
|
|
7
|
+
* asked for.
|
|
8
|
+
*
|
|
9
|
+
* WHY NOT JUST DOWNLOAD THE ZIP. GitHub's zipball redirects to codeload, which
|
|
10
|
+
* answers `Access-Control-Allow-Origin: https://render.githubusercontent.com`
|
|
11
|
+
* -- the browser cannot read it. Measured, not assumed. What IS open to any
|
|
12
|
+
* origin is the tree API (one call, and the unauthenticated limit is 60/hour)
|
|
13
|
+
* and raw.githubusercontent (per file). So: one call to see what is there,
|
|
14
|
+
* then one per file of the skills selected.
|
|
15
|
+
*
|
|
16
|
+
* NOTHING IS ENABLED BY INSTALLING. A skill's instructions go into the system
|
|
17
|
+
* prompt, so arriving from a URL must not be the same as being trusted --
|
|
18
|
+
* isSkillEnabled is off for anything the person has not turned on, and this
|
|
19
|
+
* deliberately does not touch it.
|
|
20
|
+
*
|
|
21
|
+
* The HTTP is injected for the same reason the unzip is (see skills.ts): the
|
|
22
|
+
* kernel does not own a fetch, and a test should not need a network.
|
|
23
|
+
*/
|
|
24
|
+
import { installSkillFiles, safeName } from './skills.js';
|
|
25
|
+
/* Caps. A repo is someone else's, and "fetch every file under a folder" is an
|
|
26
|
+
* instruction a hostile or merely sprawling one can abuse. These are generous
|
|
27
|
+
* for a skill (the largest in superpowers is 8 files) and small enough that a
|
|
28
|
+
* mistake costs seconds, not a tab. */
|
|
29
|
+
const MAX_FILES_PER_SKILL = 40;
|
|
30
|
+
const MAX_BYTES_PER_FILE = 512 * 1024;
|
|
31
|
+
/** `github.com/owner/repo`, with or without scheme, `.git`, or a `/tree/<ref>`. */
|
|
32
|
+
export function parseRepoUrl(input) {
|
|
33
|
+
const trimmed = input.trim().replace(/\.git$/i, '').replace(/\/+$/, '');
|
|
34
|
+
if (!trimmed)
|
|
35
|
+
return null;
|
|
36
|
+
const m = /^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/\s]+)\/([^/\s]+)(?:\/tree\/([^/\s]+))?/i.exec(trimmed)
|
|
37
|
+
// Bare `owner/repo`, which is how people say it out loud.
|
|
38
|
+
?? /^([\w.-]+)\/([\w.-]+)$/.exec(trimmed);
|
|
39
|
+
if (!m)
|
|
40
|
+
return null;
|
|
41
|
+
return { owner: m[1], repo: m[2], ref: m[3] || 'HEAD' };
|
|
42
|
+
}
|
|
43
|
+
const treeUrl = (r) => `https://api.github.com/repos/${r.owner}/${r.repo}/git/trees/${encodeURIComponent(r.ref)}?recursive=1`;
|
|
44
|
+
const rawUrl = (r, path) => `https://raw.githubusercontent.com/${r.owner}/${r.repo}/${encodeURIComponent(r.ref === 'HEAD' ? 'HEAD' : r.ref)}/${path.split('/').map(encodeURIComponent).join('/')}`;
|
|
45
|
+
/** Every skill folder in the repo: a directory holding SKILL.md or SKILL.prmd. */
|
|
46
|
+
export async function discoverRepoSkills(ref, http) {
|
|
47
|
+
const body = await http.json(treeUrl(ref));
|
|
48
|
+
if (!body || !Array.isArray(body.tree)) {
|
|
49
|
+
// GitHub answers a missing repo or a spent rate limit with a `message`.
|
|
50
|
+
throw new Error(body?.message ? `GitHub: ${body.message}` : 'That repository did not return a file list.');
|
|
51
|
+
}
|
|
52
|
+
const blobs = body.tree.filter((e) => e.type === 'blob');
|
|
53
|
+
const dirs = new Map();
|
|
54
|
+
for (const entry of blobs) {
|
|
55
|
+
const lower = entry.path.toLowerCase();
|
|
56
|
+
if (!lower.endsWith('/skill.md') && !lower.endsWith('/skill.prmd'))
|
|
57
|
+
continue;
|
|
58
|
+
const dir = entry.path.slice(0, entry.path.lastIndexOf('/'));
|
|
59
|
+
const name = safeName(dir.slice(dir.lastIndexOf('/') + 1));
|
|
60
|
+
if (name)
|
|
61
|
+
dirs.set(dir, { name, dir, files: [] });
|
|
62
|
+
}
|
|
63
|
+
// Second pass so a skill collects its OWN files only -- a nested skill folder
|
|
64
|
+
// belongs to itself, not to its parent.
|
|
65
|
+
for (const entry of blobs) {
|
|
66
|
+
let owner;
|
|
67
|
+
for (const skill of dirs.values()) {
|
|
68
|
+
if (!entry.path.startsWith(`${skill.dir}/`))
|
|
69
|
+
continue;
|
|
70
|
+
if (!owner || skill.dir.length > owner.dir.length)
|
|
71
|
+
owner = skill;
|
|
72
|
+
}
|
|
73
|
+
if (owner && owner.files.length < MAX_FILES_PER_SKILL && (entry.size ?? 0) <= MAX_BYTES_PER_FILE) {
|
|
74
|
+
owner.files.push(entry.path);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return [...dirs.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Fetch the chosen skills and write them into the config workspace.
|
|
81
|
+
*
|
|
82
|
+
* Reports per skill rather than throwing the first failure: one unreachable
|
|
83
|
+
* file in one skill of fifteen is not a reason to lose the other fourteen, and
|
|
84
|
+
* a caller has to be able to say which ones landed.
|
|
85
|
+
*/
|
|
86
|
+
export async function installRepoSkills(ref, skills, http) {
|
|
87
|
+
const out = [];
|
|
88
|
+
for (const skill of skills) {
|
|
89
|
+
try {
|
|
90
|
+
const files = [];
|
|
91
|
+
for (const path of skill.files) {
|
|
92
|
+
files.push({ path: path.slice(skill.dir.length + 1), content: await http.text(rawUrl(ref, path)) });
|
|
93
|
+
}
|
|
94
|
+
if (!files.length)
|
|
95
|
+
throw new Error('no files were readable');
|
|
96
|
+
// Installed, NOT enabled: see the header.
|
|
97
|
+
out.push({ name: await installSkillFiles(files, skill.name), ok: true });
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
out.push({ name: skill.name, ok: false, error: e instanceof Error ? e.message : String(e) });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=skillSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillSource.js","sourceRoot":"","sources":["../skillSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAoBvD;;;uCAGuC;AACvC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,CAAC;AAEtC,mFAAmF;AACnF,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,CAAC,GAAG,qFAAqF,CAAC,IAAI,CAAC,OAAO,CAAC;QAC3G,0DAA0D;WACvD,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,OAAO,EAAE,KAAK,EAAE,CAAC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