imprint-mcp 0.6.6 → 0.7.1

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +340 -16
  3. package/package.json +2 -2
  4. package/prompts/audit-agent.md +25 -4
  5. package/prompts/auth-compile-agent.md +195 -34
  6. package/prompts/build-planning.md +3 -3
  7. package/prompts/compile-agent.md +932 -180
  8. package/prompts/component-recovery.md +40 -0
  9. package/prompts/live-verifier-agent.md +10 -3
  10. package/prompts/master-teach-api-researcher.md +813 -0
  11. package/prompts/master-teach-baseline-mvp-review.md +217 -0
  12. package/prompts/master-teach-completion-review.md +188 -0
  13. package/prompts/master-teach-decision.md +910 -0
  14. package/prompts/master-teach-focused-planner.md +777 -0
  15. package/prompts/master-teach-parameter-advisor.md +58 -0
  16. package/prompts/master-teach-recording-evidence.md +19 -0
  17. package/prompts/master-teach-refine-plan.md +7 -0
  18. package/prompts/master-teach-tool-advisor.md +130 -0
  19. package/prompts/playbook-compilation.md +45 -54
  20. package/prompts/prereq-builder.md +28 -6
  21. package/prompts/prereq-planner.md +2 -2
  22. package/prompts/tool-candidate-detection.md +70 -39
  23. package/prompts/tool-planning.md +3 -3
  24. package/src/cli.ts +212 -164
  25. package/src/imprint/agent-tool.ts +15 -0
  26. package/src/imprint/agent.ts +49 -44
  27. package/src/imprint/api-research-agent.ts +933 -0
  28. package/src/imprint/audit.ts +84 -15
  29. package/src/imprint/auth-browser-discovery.ts +276 -0
  30. package/src/imprint/auth-compile-agent.ts +610 -251
  31. package/src/imprint/auth-compile-tools.ts +233 -73
  32. package/src/imprint/auth-discovery-evidence.ts +81 -0
  33. package/src/imprint/auth-plan.ts +28 -0
  34. package/src/imprint/auth-verifier.ts +239 -36
  35. package/src/imprint/authentication-interaction.ts +137 -0
  36. package/src/imprint/backend-ladder.ts +711 -395
  37. package/src/imprint/body-structure.ts +656 -0
  38. package/src/imprint/build-plan.ts +35 -345
  39. package/src/imprint/cdp-browser-fetch.ts +926 -82
  40. package/src/imprint/cdp-jar-cache.ts +7 -12
  41. package/src/imprint/chromium.ts +93 -29
  42. package/src/imprint/claude-cli-compile.ts +278 -320
  43. package/src/imprint/codex-cli-compile.ts +529 -350
  44. package/src/imprint/codex-sdk-turn.ts +102 -0
  45. package/src/imprint/compile-agent-types.ts +58 -15
  46. package/src/imprint/compile-agent.ts +222 -274
  47. package/src/imprint/compile-done-sentinel.ts +211 -0
  48. package/src/imprint/compile-provider-control.ts +401 -0
  49. package/src/imprint/compile-provider-recovery.ts +142 -0
  50. package/src/imprint/compile-strategy.ts +5 -0
  51. package/src/imprint/compile-tool-executor.ts +783 -0
  52. package/src/imprint/compile-tools.ts +1727 -3096
  53. package/src/imprint/compile-verification.ts +11 -1
  54. package/src/imprint/compile.ts +110 -29
  55. package/src/imprint/compiler-log.ts +28 -0
  56. package/src/imprint/compiler-process.ts +440 -0
  57. package/src/imprint/component-recovery.ts +120 -0
  58. package/src/imprint/concurrency.ts +43 -58
  59. package/src/imprint/cookie-jar.ts +117 -7
  60. package/src/imprint/credential-extract.ts +10 -90
  61. package/src/imprint/credential-lock.ts +146 -0
  62. package/src/imprint/credential-observation.ts +261 -0
  63. package/src/imprint/credential-store.ts +247 -44
  64. package/src/imprint/emit.ts +18 -2
  65. package/src/imprint/evidence-inspection.ts +55 -0
  66. package/src/imprint/freeform-redact.ts +34 -234
  67. package/src/imprint/import-module-fresh.ts +30 -0
  68. package/src/imprint/live-component-recovery.ts +73 -0
  69. package/src/imprint/live-finesse-runner.ts +299 -0
  70. package/src/imprint/live-verifier.ts +299 -358
  71. package/src/imprint/llm.ts +467 -422
  72. package/src/imprint/log.ts +15 -8
  73. package/src/imprint/login.ts +9 -0
  74. package/src/imprint/master-teach-agent-contracts.ts +912 -0
  75. package/src/imprint/master-teach-agents.ts +3065 -0
  76. package/src/imprint/master-teach-checks.ts +348 -0
  77. package/src/imprint/master-teach-controller.ts +7702 -0
  78. package/src/imprint/master-teach-plan.ts +1410 -0
  79. package/src/imprint/master-teach-prompt-projections.ts +349 -0
  80. package/src/imprint/master-teach-store.ts +961 -0
  81. package/src/imprint/mcp-cdp-sessions.ts +60 -0
  82. package/src/imprint/mcp-compile-server.ts +64 -1001
  83. package/src/imprint/mcp-live-verifier-server.ts +246 -190
  84. package/src/imprint/mcp-server.ts +46 -57
  85. package/src/imprint/native-agent-pass.ts +260 -0
  86. package/src/imprint/native-agent-usage.ts +141 -0
  87. package/src/imprint/native-teach-agents.ts +619 -0
  88. package/src/imprint/param-grounding.ts +488 -347
  89. package/src/imprint/playbook-runner.ts +254 -63
  90. package/src/imprint/prereq-builder.ts +55 -543
  91. package/src/imprint/private-file.ts +18 -0
  92. package/src/imprint/probe-backends.ts +129 -33
  93. package/src/imprint/provider-retry.ts +501 -0
  94. package/src/imprint/provider-terminal.ts +214 -0
  95. package/src/imprint/recording-request.ts +290 -1
  96. package/src/imprint/recording-verification.ts +444 -0
  97. package/src/imprint/redact.ts +33 -749
  98. package/src/imprint/refine-worker.ts +326 -0
  99. package/src/imprint/refine.ts +241 -0
  100. package/src/imprint/replay-capture.ts +41 -12
  101. package/src/imprint/replay-evidence.ts +1007 -0
  102. package/src/imprint/research-response-evidence.ts +45 -0
  103. package/src/imprint/runtime.ts +867 -138
  104. package/src/imprint/sensitive-keys.ts +0 -6
  105. package/src/imprint/session-merge.ts +103 -7
  106. package/src/imprint/stealth-chromium.ts +67 -7
  107. package/src/imprint/stealth-fetch.ts +25 -8
  108. package/src/imprint/stealth-token-cache.ts +16 -16
  109. package/src/imprint/teach-browser-resources.ts +88 -0
  110. package/src/imprint/teach-plan.ts +0 -242
  111. package/src/imprint/teach-research-memory.ts +229 -0
  112. package/src/imprint/teach-stage-progress.ts +38 -0
  113. package/src/imprint/teach-state.ts +47 -625
  114. package/src/imprint/teach.ts +12 -3699
  115. package/src/imprint/terminal-user-prompt.ts +42 -0
  116. package/src/imprint/tool-candidates.ts +58 -210
  117. package/src/imprint/tool-loader.ts +3 -0
  118. package/src/imprint/tool-plan.ts +1 -134
  119. package/src/imprint/tracing.ts +24 -7
  120. package/src/imprint/types.ts +113 -21
  121. package/src/imprint/user-interaction.ts +836 -0
  122. package/src/imprint/endpoint-key.ts +0 -23
@@ -0,0 +1,40 @@
1
+ # Recover an owned component before changing a consumer contract
2
+
3
+ You own one focused recovery decision for a failed check. The failure may come
4
+ from authentication, a prerequisite, a shared module, or the caller's own
5
+ artifact. Inspect the supplied facts and declared owners; the error code or a
6
+ filename alone does not establish cause. Site names never select recovery.
7
+
8
+ Return exactly one decision:
9
+
10
+ - `{"action":"authenticate","plan":{...},"reason":"..."}` uses the attached
11
+ recording-grounded auth owner. Choose the appropriate listed context and
12
+ supplied credential/request declarations. The auth owner decides actions and
13
+ first checks or restores usable access in the retained browser before
14
+ restarting login. A recovered session returns to the unchanged consumer check.
15
+ Only observed current login/challenge evidence warrants another credential or
16
+ factor action. Obtain fresh human input when required; never invent or reuse
17
+ approval.
18
+ - `{"action":"recover_component","componentId":"supplied id","reason":"..."}`
19
+ sends the exact failure to that declared component owner. Choose it only when
20
+ the evidence supports a component-local repair without changing the accepted
21
+ consumer contract. A prerequisite owner can rebuild its existing procedure;
22
+ dependent calls then bind fresh producer results. An explicitly registered
23
+ shared-module owner repairs and verifies that module through its normal host.
24
+ - `{"action":"return_failure","reason":"..."}` requests broader master
25
+ investigation when ownership or cause is unclear, or the contract, strategy,
26
+ dependency graph, or scope needs changing.
27
+
28
+ Return the decision directly, without an interaction envelope. Do not edit data
29
+ artifacts yourself, invent owner identifiers, or assign all failures to auth.
30
+ The host preserves each failed attempt and dispatches only to the chosen owner.
31
+ Successful state recovery immediately retries the existing caller. Artifact
32
+ repair preserves the accepted plan and rebuilds only the selected owner, then
33
+ rechecks affected dependencies and consumer calls. Repair completion never
34
+ substitutes for a passing consumer result.
35
+
36
+ Use `previousRecoveries` and prior observations to reconsider repeated rejection;
37
+ do not blindly repeat an unchanged repair. There is no fixed retry cap. Shared
38
+ recovery is scoped to the explicit owner id, not a guessed similarity between
39
+ sites, tool names, messages, cookies, or paths. If a component has no declared
40
+ owner, return the failure rather than guessing who may modify it.
@@ -9,9 +9,16 @@ tool-level input parameters, parsed ToolResult, backend, and attempt metadata.
9
9
  Treat those parsed outputs as the primary evidence. Suite and call labels are for
10
10
  navigation only; do not manufacture or cite evidence IDs.
11
11
 
12
- You also receive read-only artifact context: the generated workflow, parser,
13
- parser tests, integration suite, current playbook when one exists, and this
14
- tool's build-plan contract. Use it to interpret live results and catch concrete
12
+ You also receive read-only artifact context: the generated workflow, request
13
+ transform and its tests when one exists, parser, parser tests, integration
14
+ suite, current playbook when one exists, and this tool's build-plan contract.
15
+ Workflow request bodies are templates. When `requestTransformModule` exists, the
16
+ transform can replace the final outgoing URL, headers, or body. Never infer the
17
+ emitted request bytes from the workflow template alone: inspect the transform
18
+ and its tests, then use backend-preparation `requestStageFacts` as factual
19
+ execution receipts. A passed send stage proves that request reached transport;
20
+ a later transform failure does not mean earlier requests used their templates.
21
+ Use this context to interpret live results and catch concrete
15
22
  contradictions such as a producer/consumer type mismatch, a required recorded
16
23
  header omitted from the workflow, a synthetic-only positive parser test, or an
17
24
  integration suite that cannot construct its producer inputs. Artifact context