@aisy/core 0.1.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/LICENSE +202 -0
- package/dist/agent-loop/index.d.ts +4 -0
- package/dist/agent-loop/index.d.ts.map +1 -0
- package/dist/agent-loop/index.js +352 -0
- package/dist/agent-loop/index.js.map +1 -0
- package/dist/agent-loop/types.d.ts +183 -0
- package/dist/agent-loop/types.d.ts.map +1 -0
- package/dist/agent-loop/types.js +3 -0
- package/dist/agent-loop/types.js.map +1 -0
- package/dist/bin/aisy.d.ts +3 -0
- package/dist/bin/aisy.d.ts.map +1 -0
- package/dist/bin/aisy.js +14 -0
- package/dist/bin/aisy.js.map +1 -0
- package/dist/cli/index.d.ts +17 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +114 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/context-engine/index.d.ts +4 -0
- package/dist/context-engine/index.d.ts.map +1 -0
- package/dist/context-engine/index.js +126 -0
- package/dist/context-engine/index.js.map +1 -0
- package/dist/context-engine/types.d.ts +54 -0
- package/dist/context-engine/types.d.ts.map +1 -0
- package/dist/context-engine/types.js +4 -0
- package/dist/context-engine/types.js.map +1 -0
- package/dist/eval/index.d.ts +20 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +128 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/types.d.ts +62 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +17 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/gateway/index.d.ts +5 -0
- package/dist/gateway/index.d.ts.map +1 -0
- package/dist/gateway/index.js +288 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/types.d.ts +194 -0
- package/dist/gateway/types.d.ts.map +1 -0
- package/dist/gateway/types.js +94 -0
- package/dist/gateway/types.js.map +1 -0
- package/dist/goals/index.d.ts +11 -0
- package/dist/goals/index.d.ts.map +1 -0
- package/dist/goals/index.js +21 -0
- package/dist/goals/index.js.map +1 -0
- package/dist/goals/types.d.ts +47 -0
- package/dist/goals/types.d.ts.map +1 -0
- package/dist/goals/types.js +5 -0
- package/dist/goals/types.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +215 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/types.d.ts +148 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +4 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/memory/index.d.ts +6 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +419 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/types.d.ts +131 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +33 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/nightly/index.d.ts +4 -0
- package/dist/nightly/index.d.ts.map +1 -0
- package/dist/nightly/index.js +470 -0
- package/dist/nightly/index.js.map +1 -0
- package/dist/nightly/types.d.ts +326 -0
- package/dist/nightly/types.d.ts.map +1 -0
- package/dist/nightly/types.js +3 -0
- package/dist/nightly/types.js.map +1 -0
- package/dist/observability/index.d.ts +11 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +396 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/types.d.ts +139 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/observability/types.js +4 -0
- package/dist/observability/types.js.map +1 -0
- package/dist/onboarding/index.d.ts +16 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/index.js +787 -0
- package/dist/onboarding/index.js.map +1 -0
- package/dist/onboarding/interactive.d.ts +23 -0
- package/dist/onboarding/interactive.d.ts.map +1 -0
- package/dist/onboarding/interactive.js +45 -0
- package/dist/onboarding/interactive.js.map +1 -0
- package/dist/onboarding/types.d.ts +388 -0
- package/dist/onboarding/types.d.ts.map +1 -0
- package/dist/onboarding/types.js +35 -0
- package/dist/onboarding/types.js.map +1 -0
- package/dist/orchestration/index.d.ts +8 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +706 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/types.d.ts +391 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +30 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/personality/index.d.ts +65 -0
- package/dist/personality/index.d.ts.map +1 -0
- package/dist/personality/index.js +339 -0
- package/dist/personality/index.js.map +1 -0
- package/dist/personality/types.d.ts +103 -0
- package/dist/personality/types.d.ts.map +1 -0
- package/dist/personality/types.js +15 -0
- package/dist/personality/types.js.map +1 -0
- package/dist/provider/index.d.ts +4 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +236 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/provider/types.d.ts +180 -0
- package/dist/provider/types.d.ts.map +1 -0
- package/dist/provider/types.js +4 -0
- package/dist/provider/types.js.map +1 -0
- package/dist/runtime/agent-cards.d.ts +14 -0
- package/dist/runtime/agent-cards.d.ts.map +1 -0
- package/dist/runtime/agent-cards.js +90 -0
- package/dist/runtime/agent-cards.js.map +1 -0
- package/dist/runtime/agent-runner.d.ts +30 -0
- package/dist/runtime/agent-runner.d.ts.map +1 -0
- package/dist/runtime/agent-runner.js +37 -0
- package/dist/runtime/agent-runner.js.map +1 -0
- package/dist/runtime/budget.d.ts +15 -0
- package/dist/runtime/budget.d.ts.map +1 -0
- package/dist/runtime/budget.js +24 -0
- package/dist/runtime/budget.js.map +1 -0
- package/dist/runtime/delegation-driver.d.ts +11 -0
- package/dist/runtime/delegation-driver.d.ts.map +1 -0
- package/dist/runtime/delegation-driver.js +132 -0
- package/dist/runtime/delegation-driver.js.map +1 -0
- package/dist/runtime/exact-cache.d.ts +10 -0
- package/dist/runtime/exact-cache.d.ts.map +1 -0
- package/dist/runtime/exact-cache.js +30 -0
- package/dist/runtime/exact-cache.js.map +1 -0
- package/dist/runtime/execute-tool.d.ts +29 -0
- package/dist/runtime/execute-tool.d.ts.map +1 -0
- package/dist/runtime/execute-tool.js +80 -0
- package/dist/runtime/execute-tool.js.map +1 -0
- package/dist/runtime/guardian.d.ts +9 -0
- package/dist/runtime/guardian.d.ts.map +1 -0
- package/dist/runtime/guardian.js +41 -0
- package/dist/runtime/guardian.js.map +1 -0
- package/dist/runtime/hook-gate.d.ts +17 -0
- package/dist/runtime/hook-gate.d.ts.map +1 -0
- package/dist/runtime/hook-gate.js +56 -0
- package/dist/runtime/hook-gate.js.map +1 -0
- package/dist/runtime/memory-adapter.d.ts +6 -0
- package/dist/runtime/memory-adapter.d.ts.map +1 -0
- package/dist/runtime/memory-adapter.js +38 -0
- package/dist/runtime/memory-adapter.js.map +1 -0
- package/dist/runtime/nightly-adapters.d.ts +48 -0
- package/dist/runtime/nightly-adapters.d.ts.map +1 -0
- package/dist/runtime/nightly-adapters.js +139 -0
- package/dist/runtime/nightly-adapters.js.map +1 -0
- package/dist/runtime/nightly-generator.d.ts +10 -0
- package/dist/runtime/nightly-generator.d.ts.map +1 -0
- package/dist/runtime/nightly-generator.js +335 -0
- package/dist/runtime/nightly-generator.js.map +1 -0
- package/dist/runtime/onboarding-node.d.ts +6 -0
- package/dist/runtime/onboarding-node.d.ts.map +1 -0
- package/dist/runtime/onboarding-node.js +356 -0
- package/dist/runtime/onboarding-node.js.map +1 -0
- package/dist/runtime/provider-anthropic.d.ts +43 -0
- package/dist/runtime/provider-anthropic.d.ts.map +1 -0
- package/dist/runtime/provider-anthropic.js +148 -0
- package/dist/runtime/provider-anthropic.js.map +1 -0
- package/dist/runtime/provider-cli.d.ts +18 -0
- package/dist/runtime/provider-cli.d.ts.map +1 -0
- package/dist/runtime/provider-cli.js +73 -0
- package/dist/runtime/provider-cli.js.map +1 -0
- package/dist/runtime/provider-openai.d.ts +30 -0
- package/dist/runtime/provider-openai.d.ts.map +1 -0
- package/dist/runtime/provider-openai.js +114 -0
- package/dist/runtime/provider-openai.js.map +1 -0
- package/dist/runtime/providers.d.ts +43 -0
- package/dist/runtime/providers.d.ts.map +1 -0
- package/dist/runtime/providers.js +72 -0
- package/dist/runtime/providers.js.map +1 -0
- package/dist/runtime/sandbox-bash.d.ts +21 -0
- package/dist/runtime/sandbox-bash.d.ts.map +1 -0
- package/dist/runtime/sandbox-bash.js +51 -0
- package/dist/runtime/sandbox-bash.js.map +1 -0
- package/dist/runtime/scoped-tool-executor.d.ts +10 -0
- package/dist/runtime/scoped-tool-executor.d.ts.map +1 -0
- package/dist/runtime/scoped-tool-executor.js +30 -0
- package/dist/runtime/scoped-tool-executor.js.map +1 -0
- package/dist/runtime/session-log.d.ts +6 -0
- package/dist/runtime/session-log.d.ts.map +1 -0
- package/dist/runtime/session-log.js +54 -0
- package/dist/runtime/session-log.js.map +1 -0
- package/dist/runtime/settings.d.ts +24 -0
- package/dist/runtime/settings.d.ts.map +1 -0
- package/dist/runtime/settings.js +29 -0
- package/dist/runtime/settings.js.map +1 -0
- package/dist/runtime/spawn-plan.d.ts +13 -0
- package/dist/runtime/spawn-plan.d.ts.map +1 -0
- package/dist/runtime/spawn-plan.js +107 -0
- package/dist/runtime/spawn-plan.js.map +1 -0
- package/dist/runtime/spend.d.ts +41 -0
- package/dist/runtime/spend.d.ts.map +1 -0
- package/dist/runtime/spend.js +0 -0
- package/dist/runtime/spend.js.map +1 -0
- package/dist/runtime/sub-agent-runner.d.ts +19 -0
- package/dist/runtime/sub-agent-runner.d.ts.map +1 -0
- package/dist/runtime/sub-agent-runner.js +47 -0
- package/dist/runtime/sub-agent-runner.js.map +1 -0
- package/dist/safety/grants.d.ts +7 -0
- package/dist/safety/grants.d.ts.map +1 -0
- package/dist/safety/grants.js +53 -0
- package/dist/safety/grants.js.map +1 -0
- package/dist/safety/index.d.ts +72 -0
- package/dist/safety/index.d.ts.map +1 -0
- package/dist/safety/index.js +464 -0
- package/dist/safety/index.js.map +1 -0
- package/dist/safety/types.d.ts +254 -0
- package/dist/safety/types.d.ts.map +1 -0
- package/dist/safety/types.js +3 -0
- package/dist/safety/types.js.map +1 -0
- package/dist/skills/index.d.ts +4 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +463 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/types.d.ts +177 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +3 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/testing/clock.d.ts +8 -0
- package/dist/testing/clock.d.ts.map +1 -0
- package/dist/testing/clock.js +13 -0
- package/dist/testing/clock.js.map +1 -0
- package/dist/testing/effect-verifier.d.ts +15 -0
- package/dist/testing/effect-verifier.d.ts.map +1 -0
- package/dist/testing/effect-verifier.js +27 -0
- package/dist/testing/effect-verifier.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +5 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/provider-fake.d.ts +14 -0
- package/dist/testing/provider-fake.d.ts.map +1 -0
- package/dist/testing/provider-fake.js +18 -0
- package/dist/testing/provider-fake.js.map +1 -0
- package/dist/testing/sandbox-stub.d.ts +15 -0
- package/dist/testing/sandbox-stub.d.ts.map +1 -0
- package/dist/testing/sandbox-stub.js +15 -0
- package/dist/testing/sandbox-stub.js.map +1 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +0 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/types.d.ts +138 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +4 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/triggers/index.d.ts +4 -0
- package/dist/triggers/index.d.ts.map +1 -0
- package/dist/triggers/index.js +187 -0
- package/dist/triggers/index.js.map +1 -0
- package/dist/triggers/types.d.ts +74 -0
- package/dist/triggers/types.d.ts.map +1 -0
- package/dist/triggers/types.js +5 -0
- package/dist/triggers/types.js.map +1 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 veeskelad — Aisy Harness
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentLoop, AgentLoopDeps } from './types.js';
|
|
2
|
+
export type { AgentLoop, AgentLoopDeps, ContextSpan, FrozenSnapshot, HookCtx, HookGate, LogEntry, LoopGuardian, MemoryPort, ModelRequest, ModelResponse, Plan, PlanStep, ProviderAdapter, ProviderError, Provenance, SessionLog, ToolCall, TurnInput, TurnResult, TurnState, VerificationTrace, VerificationTraceExit, VerificationTraceFile, VerificationTraceHTTP, VerificationTraceSQL, Clock, } from './types.js';
|
|
3
|
+
export declare function makeAgentLoop(deps: AgentLoopDeps): AgentLoop;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent-loop/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EAUd,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,GACN,MAAM,YAAY,CAAA;AAuGnB,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,CA8R5D"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
/** Internal control-flow signal: unwinds to runTurn's boundary, never escapes it. */
|
|
3
|
+
class Halt extends Error {
|
|
4
|
+
reason;
|
|
5
|
+
constructor(reason) {
|
|
6
|
+
super(`halt: ${reason}`);
|
|
7
|
+
this.reason = reason;
|
|
8
|
+
this.name = 'Halt';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Plan linter — deterministic rules R1–R5 (spec 01 §4.4, ADR-0026)
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
const TRACE_KINDS = new Set(['file', 'sql', 'http', 'exit']);
|
|
15
|
+
/** R3: exit probes that assert nothing about the world. */
|
|
16
|
+
const VACUOUS_ARGV0 = new Set(['echo', 'true', ':', 'printf']);
|
|
17
|
+
/** R4: traces that read back the plan's own assertion. */
|
|
18
|
+
const SELF_REFERENTIAL_FILES = ['PLAN.md', 'TODO.md'];
|
|
19
|
+
/** R2: tool-name hints for irreversible (Tier ≥ 2) operations. */
|
|
20
|
+
const IRREVERSIBLE_TOOL_HINTS = ['rm', 'drop', 'force_push', 'send_money'];
|
|
21
|
+
function lintPlan(plan) {
|
|
22
|
+
for (const step of plan.steps) {
|
|
23
|
+
const trace = step.trace;
|
|
24
|
+
// R1 — missing trace
|
|
25
|
+
if (!trace)
|
|
26
|
+
return { ok: false, rule: 'R1' };
|
|
27
|
+
// R5 — out-of-enum kind
|
|
28
|
+
if (!TRACE_KINDS.has(trace.kind))
|
|
29
|
+
return { ok: false, rule: 'R5' };
|
|
30
|
+
// R3 — vacuous trace
|
|
31
|
+
if (trace.kind === 'exit' && VACUOUS_ARGV0.has(trace.argv[0] ?? '')) {
|
|
32
|
+
return { ok: false, rule: 'R3' };
|
|
33
|
+
}
|
|
34
|
+
if (trace.kind === 'http' &&
|
|
35
|
+
// loopback / unspecified hosts: IPv4 (127.0.0.1, 0.0.0.0), localhost, IPv6 (::1, [::1]).
|
|
36
|
+
/localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\]|(?:^|[:/@])::1(?:$|[:/])/.test(trace.url) &&
|
|
37
|
+
['GET', 'HEAD'].includes(trace.method.toUpperCase())) {
|
|
38
|
+
return { ok: false, rule: 'R3' };
|
|
39
|
+
}
|
|
40
|
+
// R4 — self-referential trace
|
|
41
|
+
if (trace.kind === 'file' &&
|
|
42
|
+
SELF_REFERENTIAL_FILES.some(f => trace.path === f || trace.path.endsWith(`/${f}`))) {
|
|
43
|
+
return { ok: false, rule: 'R4' };
|
|
44
|
+
}
|
|
45
|
+
// R2 — unflagged irreversible
|
|
46
|
+
if (!step.irreversible &&
|
|
47
|
+
step.tools.some(t => IRREVERSIBLE_TOOL_HINTS.some(h => t.toLowerCase().includes(h)))) {
|
|
48
|
+
return { ok: false, rule: 'R2' };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return { ok: true };
|
|
52
|
+
}
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Helpers
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
/**
|
|
57
|
+
* Deterministic sha256 over the JSON of the payload (spec §4.2). djb2 was 32-bit
|
|
58
|
+
* and collision-prone, which is unsafe for a payload-identity hash in a
|
|
59
|
+
* tamper-evident log; sha256 removes the practical collision risk.
|
|
60
|
+
*/
|
|
61
|
+
function payloadHash(payload) {
|
|
62
|
+
return createHash('sha256').update(JSON.stringify(payload) ?? '', 'utf8').digest('hex');
|
|
63
|
+
}
|
|
64
|
+
/** Within-session forget protocol trigger — operator-typed, deterministic. */
|
|
65
|
+
const FORGET_RE = /^forget[:\s]+(.+)$/i;
|
|
66
|
+
function coldStartSnapshot(takenAt) {
|
|
67
|
+
return { prefixBytes: new Uint8Array(0), prefixHash: 'cold-start', breakpoints: [], takenAt };
|
|
68
|
+
}
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// makeAgentLoop
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
export function makeAgentLoop(deps) {
|
|
73
|
+
const sessions = new Map();
|
|
74
|
+
const maxReplans = deps.maxReplans ?? 2;
|
|
75
|
+
let seq = 0;
|
|
76
|
+
const log = (kind, payload) => {
|
|
77
|
+
deps.sessionLog.append({
|
|
78
|
+
seq: ++seq,
|
|
79
|
+
ts: deps.clock.now(),
|
|
80
|
+
kind,
|
|
81
|
+
payloadHash: payloadHash(payload),
|
|
82
|
+
payload,
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const session = (id) => {
|
|
86
|
+
let s = sessions.get(id);
|
|
87
|
+
if (!s) {
|
|
88
|
+
s = { snapshot: null, coldStart: false, loaded: false, narrowed: false, totalReplans: 0, totalToolCalls: 0, quarantinedRefs: new Set() };
|
|
89
|
+
sessions.set(id, s);
|
|
90
|
+
}
|
|
91
|
+
return s;
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
async runTurn(input) {
|
|
95
|
+
const s = session(input.sessionId);
|
|
96
|
+
// Resume: replay the durable log to find the next un-verified step.
|
|
97
|
+
const resumed = deps.sessionLog.resume(input.sessionId);
|
|
98
|
+
const startStep = resumed?.status === 'in-progress' ? resumed.nextStepIndex : 0;
|
|
99
|
+
log('turn.start', { sessionId: input.sessionId });
|
|
100
|
+
// Frozen snapshot — read once per session (ADR-0007); within-session
|
|
101
|
+
// writes never mutate it. Cold start degrades to a minimal prefix.
|
|
102
|
+
if (!s.loaded) {
|
|
103
|
+
try {
|
|
104
|
+
s.snapshot = await deps.memory.snapshot();
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
s.snapshot = coldStartSnapshot(deps.clock.now());
|
|
108
|
+
s.coldStart = true;
|
|
109
|
+
}
|
|
110
|
+
s.loaded = true;
|
|
111
|
+
log('snapshot.frozen', { prefixHash: s.snapshot.prefixHash, coldStart: s.coldStart });
|
|
112
|
+
}
|
|
113
|
+
const snapshot = s.snapshot;
|
|
114
|
+
// ADR-0019: at most 4 cache breakpoints survive prompt assembly.
|
|
115
|
+
const breakpoints = snapshot.breakpoints.slice(0, 4);
|
|
116
|
+
log('prompt.assembled', { prefixHash: snapshot.prefixHash, breakpoints: breakpoints.length });
|
|
117
|
+
// ADR-0027: provenance is code-assigned at ingestion and never read from
|
|
118
|
+
// model output. Narrowing clears ONLY on a clean operator turn — a turn
|
|
119
|
+
// with no operator span (e.g. tool-only) keeps the prior narrowed state.
|
|
120
|
+
if (input.spans.some(sp => sp.provenance === 'untrusted')) {
|
|
121
|
+
s.narrowed = true;
|
|
122
|
+
}
|
|
123
|
+
else if (input.spans.some(sp => sp.provenance === 'operator')) {
|
|
124
|
+
s.narrowed = false;
|
|
125
|
+
}
|
|
126
|
+
// Within-session forget protocol — deterministic, code-only. An
|
|
127
|
+
// operator-typed forget is human-confirmed (resurrection-guard keys on it).
|
|
128
|
+
for (const span of input.spans) {
|
|
129
|
+
if (span.provenance !== 'operator')
|
|
130
|
+
continue;
|
|
131
|
+
const m = FORGET_RE.exec(span.text.trim());
|
|
132
|
+
if (m?.[1]) {
|
|
133
|
+
const ref = m[1].trim();
|
|
134
|
+
await deps.memory.forget(ref, true);
|
|
135
|
+
// §5.1 step 2: quarantine the ref for the rest of the session so it can never be
|
|
136
|
+
// surfaced, quoted, or laundered into a tool argument — even from the frozen prefix.
|
|
137
|
+
s.quarantinedRefs.add(ref);
|
|
138
|
+
log('forget.requested', { ref });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Accumulate provider usage across (possibly multiple) model calls.
|
|
142
|
+
let usageIn = 0;
|
|
143
|
+
let usageOut = 0;
|
|
144
|
+
let usageDollars = 0;
|
|
145
|
+
const callModel = async () => {
|
|
146
|
+
// Eng-7 durability: the recorded intent is fsync'd BEFORE the dispatch.
|
|
147
|
+
log('step.intent', { kind: 'model-call' });
|
|
148
|
+
try {
|
|
149
|
+
const r = await deps.provider.complete({
|
|
150
|
+
sessionId: input.sessionId,
|
|
151
|
+
prefixBytes: snapshot.prefixBytes,
|
|
152
|
+
spans: input.spans,
|
|
153
|
+
}, input.signal);
|
|
154
|
+
if (r.usage) {
|
|
155
|
+
usageIn += r.usage.inputTokens;
|
|
156
|
+
usageOut += r.usage.outputTokens;
|
|
157
|
+
usageDollars += r.usage.dollars;
|
|
158
|
+
}
|
|
159
|
+
// ADR-0051 mid-turn budget: consult the injected probe with the turn's
|
|
160
|
+
// running usage; a positive verdict halts before any further dispatch.
|
|
161
|
+
if (deps.budgetCheck) {
|
|
162
|
+
const capped = await deps.budgetCheck({
|
|
163
|
+
sessionId: input.sessionId,
|
|
164
|
+
inputTokens: usageIn,
|
|
165
|
+
outputTokens: usageOut,
|
|
166
|
+
dollars: usageDollars,
|
|
167
|
+
});
|
|
168
|
+
if (capped)
|
|
169
|
+
throw new Halt('budget-capped');
|
|
170
|
+
}
|
|
171
|
+
return r;
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
// A Halt raised in the try (budget) is control flow, not an error — re-throw as-is.
|
|
175
|
+
if (err instanceof Halt)
|
|
176
|
+
throw err;
|
|
177
|
+
// A /stop abort surfaces as a fetch/spawn rejection; map it to a clean
|
|
178
|
+
// halt so the transport stays quiet (the /stop handler already acked).
|
|
179
|
+
if (input.signal?.aborted)
|
|
180
|
+
throw new Halt('stopped');
|
|
181
|
+
if (err.kind === 'all-exhausted') {
|
|
182
|
+
log('provider.exhausted', {});
|
|
183
|
+
throw new Halt('all-providers-down');
|
|
184
|
+
}
|
|
185
|
+
throw err;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
// §5.3 cap precedence #2: a re-plan resets the Guardian window but never
|
|
189
|
+
// the monotonic totalReplans budget (anti-evasion).
|
|
190
|
+
const enterReplan = (haltReason) => {
|
|
191
|
+
deps.guardian.note('replan');
|
|
192
|
+
s.totalReplans++;
|
|
193
|
+
log('replan.entered', { totalReplans: s.totalReplans });
|
|
194
|
+
if (s.totalReplans > maxReplans)
|
|
195
|
+
throw new Halt(haltReason);
|
|
196
|
+
};
|
|
197
|
+
const dispatch = async (call) => {
|
|
198
|
+
// ADR-0051: /stop interrupts between tool calls too, not only at model calls.
|
|
199
|
+
if (input.signal?.aborted)
|
|
200
|
+
throw new Halt('stopped');
|
|
201
|
+
s.totalToolCalls++;
|
|
202
|
+
if (deps.maxTotalToolCalls !== undefined && s.totalToolCalls > deps.maxTotalToolCalls) {
|
|
203
|
+
throw new Halt('cap-exceeded');
|
|
204
|
+
}
|
|
205
|
+
// §5.3 cap precedence #1: Guardian evaluated on EVERY dispatch, before the call runs.
|
|
206
|
+
const verdictG = deps.guardian.observe(call);
|
|
207
|
+
if (verdictG.trip) {
|
|
208
|
+
log('guardian.tripped', { period: verdictG.period, tool: call.name });
|
|
209
|
+
throw new Halt('loop-guardian');
|
|
210
|
+
}
|
|
211
|
+
const ctx = {
|
|
212
|
+
provenance: call.sourceSpanProvenance ?? 'operator',
|
|
213
|
+
narrowed: s.narrowed,
|
|
214
|
+
};
|
|
215
|
+
const verdict = await deps.hookGate.pre(call, ctx);
|
|
216
|
+
if (verdict === 'deny' || verdict === 'ask') {
|
|
217
|
+
log('tool.gated', { tool: call.name, verdict });
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const effective = typeof verdict === 'object' ? verdict.modify : call;
|
|
221
|
+
// ADR-0027 motivated-call block: args derived from an untrusted span
|
|
222
|
+
// never dispatch while narrowed — code-enforced, even past an 'allow'.
|
|
223
|
+
if (s.narrowed && effective.sourceSpanProvenance === 'untrusted') {
|
|
224
|
+
log('tool.blocked', { tool: effective.name, reason: 'untrusted-args' });
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
// §5.1 step 2: a forgotten ref must never be laundered into a tool argument this
|
|
228
|
+
// session — code-enforced quarantine, independent of provenance or any 'allow' gate.
|
|
229
|
+
if (s.quarantinedRefs.size > 0) {
|
|
230
|
+
const argsStr = JSON.stringify(effective.args) ?? '';
|
|
231
|
+
for (const ref of s.quarantinedRefs) {
|
|
232
|
+
if (argsStr.includes(ref)) {
|
|
233
|
+
log('tool.blocked', { tool: effective.name, reason: 'quarantined-ref' });
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
log('step.intent', { tool: effective.name });
|
|
239
|
+
const result = deps.executeTool ? await deps.executeTool(effective) : undefined;
|
|
240
|
+
log('step.result', { tool: effective.name });
|
|
241
|
+
await deps.hookGate.post(effective, result);
|
|
242
|
+
};
|
|
243
|
+
const runProbe = async (trace) => deps.probeRunner ? await deps.probeRunner(trace) : true;
|
|
244
|
+
const clarification = (response) => {
|
|
245
|
+
log('clarification.raised', { interpretations: response.interpretationCount });
|
|
246
|
+
return { reply: response.reply, state: 'awaiting-clarification' };
|
|
247
|
+
};
|
|
248
|
+
try {
|
|
249
|
+
let response = await callModel();
|
|
250
|
+
// Plan-lint loop: a failing plan forces a re-plan, never a downgraded gate.
|
|
251
|
+
let plan;
|
|
252
|
+
for (;;) {
|
|
253
|
+
// Deterministic ambiguity floor (ADR-0026): >1 interpretation always
|
|
254
|
+
// halts for clarification; the advisory score can never lower it.
|
|
255
|
+
if ((response.interpretationCount ?? 0) > 1)
|
|
256
|
+
return clarification(response);
|
|
257
|
+
plan = response.plan;
|
|
258
|
+
if (!plan)
|
|
259
|
+
break;
|
|
260
|
+
const lint = lintPlan(plan);
|
|
261
|
+
log('plan.linted', lint.ok ? { ok: true } : { ok: false, rule: lint.rule });
|
|
262
|
+
if (lint.ok)
|
|
263
|
+
break;
|
|
264
|
+
// §5.3/§7: a re-plan that overflows the monotonic budget halts with cap-exceeded
|
|
265
|
+
// regardless of the proximate trigger; the lint rule is preserved in plan.linted.
|
|
266
|
+
enterReplan('cap-exceeded');
|
|
267
|
+
response = await callModel();
|
|
268
|
+
}
|
|
269
|
+
// Tier-3 gate (ADR-0026/ADR-0011): irreversible plan waits for approval. The token
|
|
270
|
+
// is bound to this exact plan's hash so a swapped plan cannot reuse a prior token
|
|
271
|
+
// (§5, AC-01-17). Absent or mismatched token → awaiting-approval, zero dispatch.
|
|
272
|
+
if (plan && plan.steps.some(st => st.irreversible)) {
|
|
273
|
+
const planHash = payloadHash(plan);
|
|
274
|
+
if (input.approvalToken !== planHash) {
|
|
275
|
+
log('plan.gate', { tier: 3 });
|
|
276
|
+
return { reply: response.reply, state: 'awaiting-approval', planHash };
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (plan) {
|
|
280
|
+
// Execute plan steps from the resume point; a step closes only on a
|
|
281
|
+
// passing external probe (ADR-0017), never on the model's say-so.
|
|
282
|
+
// Plan steps carry tool names only; argument elaboration happens at
|
|
283
|
+
// the Tools layer (04) — here the dispatch gate is what matters.
|
|
284
|
+
let i = startStep;
|
|
285
|
+
while (plan && i < plan.steps.length) {
|
|
286
|
+
const step = plan.steps[i];
|
|
287
|
+
for (const tool of step.tools) {
|
|
288
|
+
await dispatch({ name: tool, args: {} });
|
|
289
|
+
}
|
|
290
|
+
if (await runProbe(step.trace)) {
|
|
291
|
+
log('step.verified', { stepIndex: i });
|
|
292
|
+
i++;
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
log('step.failed', { stepIndex: i });
|
|
296
|
+
enterReplan('cap-exceeded');
|
|
297
|
+
response = await callModel();
|
|
298
|
+
if ((response.interpretationCount ?? 0) > 1)
|
|
299
|
+
return clarification(response);
|
|
300
|
+
if (response.plan) {
|
|
301
|
+
const lint = lintPlan(response.plan);
|
|
302
|
+
log('plan.linted', lint.ok ? { ok: true } : { ok: false, rule: lint.rule });
|
|
303
|
+
if (!lint.ok)
|
|
304
|
+
throw new Halt('plan-lint-failed');
|
|
305
|
+
plan = response.plan;
|
|
306
|
+
// A replanned plan is a wholly new execution context: restart at step 0 so a
|
|
307
|
+
// shorter new plan is never silently skipped (the resume cursor only applies
|
|
308
|
+
// to the initial plan load).
|
|
309
|
+
i = 0;
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
// Re-plan carried no plan: exit plan mode rather than retrying
|
|
313
|
+
// the already-failed plan; the new response continues free-form.
|
|
314
|
+
plan = undefined;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (!plan) {
|
|
320
|
+
for (const call of response.toolCalls ?? []) {
|
|
321
|
+
await dispatch(call);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
log('turn.end', { state: 'ok' });
|
|
325
|
+
return {
|
|
326
|
+
reply: response.reply,
|
|
327
|
+
state: 'ok',
|
|
328
|
+
narrowed: s.narrowed,
|
|
329
|
+
...(usageIn > 0 || usageOut > 0
|
|
330
|
+
? { usage: { inputTokens: usageIn, outputTokens: usageOut, dollars: usageDollars } }
|
|
331
|
+
: {}),
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
catch (err) {
|
|
335
|
+
if (err instanceof Halt) {
|
|
336
|
+
log('turn.end', { state: 'halted', haltReason: err.reason });
|
|
337
|
+
return {
|
|
338
|
+
reply: '',
|
|
339
|
+
state: 'halted',
|
|
340
|
+
haltReason: err.reason,
|
|
341
|
+
narrowed: s.narrowed,
|
|
342
|
+
...(usageIn > 0 || usageOut > 0
|
|
343
|
+
? { usage: { inputTokens: usageIn, outputTokens: usageOut, dollars: usageDollars } }
|
|
344
|
+
: {}),
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
throw err;
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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