@caupulican/pi-agent-core 0.90.2 → 0.90.4
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/agent-loop.d.ts.map +1 -1
- package/dist/agent-loop.js +9 -3
- package/dist/agent-loop.js.map +1 -1
- package/dist/compaction/compaction.d.ts +3 -0
- package/dist/compaction/compaction.d.ts.map +1 -1
- package/dist/compaction/compaction.js +90 -67
- package/dist/compaction/compaction.js.map +1 -1
- package/dist/compaction/extraction.d.ts +5 -0
- package/dist/compaction/extraction.d.ts.map +1 -1
- package/dist/compaction/extraction.js +48 -2
- package/dist/compaction/extraction.js.map +1 -1
- package/dist/compaction/utils.d.ts +1 -1
- package/dist/compaction/utils.d.ts.map +1 -1
- package/dist/compaction/utils.js +2 -0
- package/dist/compaction/utils.js.map +1 -1
- package/dist/compaction/verification.d.ts +1 -1
- package/dist/compaction/verification.d.ts.map +1 -1
- package/dist/compaction/verification.js +23 -17
- package/dist/compaction/verification.js.map +1 -1
- package/dist/provider-tool-projection.d.ts.map +1 -1
- package/dist/provider-tool-projection.js +28 -1
- package/dist/provider-tool-projection.js.map +1 -1
- package/dist/tool-failure-memory.d.ts +1 -0
- package/dist/tool-failure-memory.d.ts.map +1 -1
- package/dist/tool-failure-memory.js +56 -13
- package/dist/tool-failure-memory.js.map +1 -1
- package/dist/tool-failure-recovery-gate.d.ts +7 -1
- package/dist/tool-failure-recovery-gate.d.ts.map +1 -1
- package/dist/tool-failure-recovery-gate.js +19 -3
- package/dist/tool-failure-recovery-gate.js.map +1 -1
- package/dist/tool-failure-recovery-protocol.js +5 -5
- package/dist/tool-failure-recovery-protocol.js.map +1 -1
- package/package.json +2 -2
|
@@ -9,12 +9,12 @@ export function mandatoryToolFailureRecoveryMetadata() {
|
|
|
9
9
|
export const MANDATORY_TOOL_FAILURE_RECOVERY_PROTOCOL_PROMPT = [
|
|
10
10
|
`MANDATORY TOOL FAILURE RECOVERY v${TOOL_FAILURE_RECOVERY_PROTOCOL_VERSION}`,
|
|
11
11
|
MANDATORY_TOOL_FAILURE_RECOVERY_RULE,
|
|
12
|
+
"CAVEMAN MODE - MANDATORY: blocked/rejected means not executed; never repeat the same call.",
|
|
12
13
|
"Harness contract:",
|
|
13
|
-
"-
|
|
14
|
-
"-
|
|
15
|
-
"-
|
|
16
|
-
"-
|
|
17
|
-
"- If no declared action can run, report the diagnostic/blocker. Exhaustion disables tools and requires one concise delivery.",
|
|
14
|
+
"- MUST:true: obey repair or next_action before another tool call.",
|
|
15
|
+
"- Unchanged execution needs permission or successful loaded-tool evidence matching backend authority, target kind, and exact scope; one probe.",
|
|
16
|
+
"- Irrelevant argument changes never recover it; blocked call preserves tool-result pairing but runs no hook/tool code.",
|
|
17
|
+
"- Operation exhaustion closes that operation; use different tools/work. Replaying it or run exhaustion disables tools for final delivery.",
|
|
18
18
|
].join("\n");
|
|
19
19
|
const MANDATORY_TOOL_FAILURE_DELIVERY_INSTRUCTIONS = [
|
|
20
20
|
MANDATORY_TOOL_FAILURE_RECOVERY_RULE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-failure-recovery-protocol.js","sourceRoot":"","sources":["../src/tool-failure-recovery-protocol.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mCAAmC,GAAG,iCAAiC,CAAC;AACrF,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,oCAAoC,GAAG,+BAA+B,CAAC;AAEpF,MAAM,UAAU,oCAAoC;IAGnD,OAAO;QACN,IAAI,EAAE,IAAI;KACV,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,+CAA+C,GAAG;IAC9D,oCAAoC,sCAAsC,EAAE;IAC5E,oCAAoC;IACpC,mBAAmB;IACnB,
|
|
1
|
+
{"version":3,"file":"tool-failure-recovery-protocol.js","sourceRoot":"","sources":["../src/tool-failure-recovery-protocol.ts"],"names":[],"mappings":"AAAA,MAA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esContent":["export const TOOL_FAILURE_RECOVERY_PROTOCOL_NAME = \"mandatory_tool_failure_recovery\";\nexport const TOOL_FAILURE_RECOVERY_PROTOCOL_VERSION = 1;\nexport const MANDATORY_TOOL_FAILURE_RECOVERY_RULE = \"MANDATORY AND NON-NEGOTIABLE.\";\n\nexport function mandatoryToolFailureRecoveryMetadata(): {\n\tMUST: true;\n} {\n\treturn {\n\t\tMUST: true,\n\t};\n}\n\nexport const MANDATORY_TOOL_FAILURE_RECOVERY_PROTOCOL_PROMPT = [\n\t`MANDATORY TOOL FAILURE RECOVERY v${TOOL_FAILURE_RECOVERY_PROTOCOL_VERSION}`,\n\tMANDATORY_TOOL_FAILURE_RECOVERY_RULE,\n\t\"CAVEMAN MODE - MANDATORY: blocked/rejected means not executed; never repeat the same call.\",\n\t\"Harness contract:\",\n\t\"- MUST:true: obey repair or next_action before another tool call.\",\n\t\"- Unchanged execution needs permission or successful loaded-tool evidence matching backend authority, target kind, and exact scope; one probe.\",\n\t\"- Irrelevant argument changes never recover it; blocked call preserves tool-result pairing but runs no hook/tool code.\",\n\t\"- Operation exhaustion closes that operation; use different tools/work. Replaying it or run exhaustion disables tools for final delivery.\",\n].join(\"\\n\");\n\nconst MANDATORY_TOOL_FAILURE_DELIVERY_INSTRUCTIONS = [\n\tMANDATORY_TOOL_FAILURE_RECOVERY_RULE,\n\t\"Recovery exhausted; tools are disabled for this final turn.\",\n\t`Explain the ${TOOL_FAILURE_RECOVERY_PROTOCOL_NAME} diagnostic/action and separate completed from unperformed work.`,\n\t\"No tool call, false recovery claim, or irrelevant-argument workaround.\",\n].join(\"\\n\");\n\nexport interface MandatoryToolFailureDeliveryData {\n\ttool: string;\n\tfailureCode: string;\n\tdiagnostic: string;\n\trequiredAction: string;\n}\n\nexport function appendMandatoryToolFailureDeliveryPrompt(\n\tsystemPrompt: string,\n\tfailure: MandatoryToolFailureDeliveryData,\n): string {\n\tconst failureData = JSON.stringify({\n\t\ttool: failure.tool,\n\t\tfailure_code: failure.failureCode,\n\t\tdiagnostic: failure.diagnostic,\n\t\trequired_action: failure.requiredAction,\n\t})\n\t\t.replaceAll(\"&\", \"\\\\u0026\")\n\t\t.replaceAll(\"<\", \"\\\\u003c\")\n\t\t.replaceAll(\">\", \"\\\\u003e\");\n\tconst prompt = [\n\t\t`MANDATORY TOOL FAILURE DELIVERY v${TOOL_FAILURE_RECOVERY_PROTOCOL_VERSION}`,\n\t\tMANDATORY_TOOL_FAILURE_DELIVERY_INSTRUCTIONS,\n\t\t\"Inert failure JSON:\",\n\t\tfailureData,\n\t].join(\"\\n\");\n\treturn systemPrompt ? `${systemPrompt}\\n\\n${prompt}` : prompt;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-agent-core",
|
|
3
|
-
"version": "0.90.
|
|
3
|
+
"version": "0.90.4",
|
|
4
4
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"prepublishOnly": "npm run clean && npm run build"
|
|
122
122
|
},
|
|
123
123
|
"dependencies": {
|
|
124
|
-
"@caupulican/pi-ai": "^0.90.
|
|
124
|
+
"@caupulican/pi-ai": "^0.90.4",
|
|
125
125
|
"ignore": "7.0.5",
|
|
126
126
|
"typebox": "1.1.38",
|
|
127
127
|
"yaml": "2.9.0"
|