@botiverse/oar 0.0.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.
- package/LICENSE +202 -0
- package/README.md +13 -0
- package/dist/contracts/account-usage.d.ts +33 -0
- package/dist/contracts/account-usage.d.ts.map +1 -0
- package/dist/contracts/account-usage.js +2 -0
- package/dist/contracts/account-usage.js.map +1 -0
- package/dist/contracts/installation.d.ts +27 -0
- package/dist/contracts/installation.d.ts.map +1 -0
- package/dist/contracts/installation.js +2 -0
- package/dist/contracts/installation.js.map +1 -0
- package/dist/contracts/runtime.d.ts +12 -0
- package/dist/contracts/runtime.d.ts.map +1 -0
- package/dist/contracts/runtime.js +4 -0
- package/dist/contracts/runtime.js.map +1 -0
- package/dist/contracts/session.d.ts +188 -0
- package/dist/contracts/session.d.ts.map +1 -0
- package/dist/contracts/session.js +2 -0
- package/dist/contracts/session.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/installation.d.ts +15 -0
- package/dist/installation.d.ts.map +1 -0
- package/dist/installation.js +60 -0
- package/dist/installation.js.map +1 -0
- package/dist/observe/agent-status.d.ts +39 -0
- package/dist/observe/agent-status.d.ts.map +1 -0
- package/dist/observe/agent-status.js +31 -0
- package/dist/observe/agent-status.js.map +1 -0
- package/dist/observe/aggregate-events.d.ts +15 -0
- package/dist/observe/aggregate-events.d.ts.map +1 -0
- package/dist/observe/aggregate-events.js +70 -0
- package/dist/observe/aggregate-events.js.map +1 -0
- package/dist/observe/index.d.ts +17 -0
- package/dist/observe/index.d.ts.map +1 -0
- package/dist/observe/index.js +13 -0
- package/dist/observe/index.js.map +1 -0
- package/dist/observe/observe-agent.d.ts +38 -0
- package/dist/observe/observe-agent.d.ts.map +1 -0
- package/dist/observe/observe-agent.js +61 -0
- package/dist/observe/observe-agent.js.map +1 -0
- package/dist/observe/stall-observer.d.ts +19 -0
- package/dist/observe/stall-observer.d.ts.map +1 -0
- package/dist/observe/stall-observer.js +36 -0
- package/dist/observe/stall-observer.js.map +1 -0
- package/dist/observe/tool-activity.d.ts +21 -0
- package/dist/observe/tool-activity.d.ts.map +1 -0
- package/dist/observe/tool-activity.js +87 -0
- package/dist/observe/tool-activity.js.map +1 -0
- package/dist/registry.d.ts +10 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +30 -0
- package/dist/registry.js.map +1 -0
- package/dist/runtimes/claude/account-usage.d.ts +29 -0
- package/dist/runtimes/claude/account-usage.d.ts.map +1 -0
- package/dist/runtimes/claude/account-usage.js +179 -0
- package/dist/runtimes/claude/account-usage.js.map +1 -0
- package/dist/runtimes/claude/context-usage.d.ts +10 -0
- package/dist/runtimes/claude/context-usage.d.ts.map +1 -0
- package/dist/runtimes/claude/context-usage.js +23 -0
- package/dist/runtimes/claude/context-usage.js.map +1 -0
- package/dist/runtimes/claude/index.d.ts +9 -0
- package/dist/runtimes/claude/index.d.ts.map +1 -0
- package/dist/runtimes/claude/index.js +13 -0
- package/dist/runtimes/claude/index.js.map +1 -0
- package/dist/runtimes/claude/installation.d.ts +2 -0
- package/dist/runtimes/claude/installation.d.ts.map +1 -0
- package/dist/runtimes/claude/installation.js +3 -0
- package/dist/runtimes/claude/installation.js.map +1 -0
- package/dist/runtimes/claude/projection.d.ts +46 -0
- package/dist/runtimes/claude/projection.d.ts.map +1 -0
- package/dist/runtimes/claude/projection.js +110 -0
- package/dist/runtimes/claude/projection.js.map +1 -0
- package/dist/runtimes/claude/session.d.ts +3 -0
- package/dist/runtimes/claude/session.d.ts.map +1 -0
- package/dist/runtimes/claude/session.js +166 -0
- package/dist/runtimes/claude/session.js.map +1 -0
- package/dist/runtimes/codex/account-usage.d.ts +40 -0
- package/dist/runtimes/codex/account-usage.d.ts.map +1 -0
- package/dist/runtimes/codex/account-usage.js +185 -0
- package/dist/runtimes/codex/account-usage.js.map +1 -0
- package/dist/runtimes/codex/app-server-client.d.ts +17 -0
- package/dist/runtimes/codex/app-server-client.d.ts.map +1 -0
- package/dist/runtimes/codex/app-server-client.js +68 -0
- package/dist/runtimes/codex/app-server-client.js.map +1 -0
- package/dist/runtimes/codex/context-usage.d.ts +10 -0
- package/dist/runtimes/codex/context-usage.d.ts.map +1 -0
- package/dist/runtimes/codex/context-usage.js +16 -0
- package/dist/runtimes/codex/context-usage.js.map +1 -0
- package/dist/runtimes/codex/index.d.ts +9 -0
- package/dist/runtimes/codex/index.d.ts.map +1 -0
- package/dist/runtimes/codex/index.js +13 -0
- package/dist/runtimes/codex/index.js.map +1 -0
- package/dist/runtimes/codex/installation.d.ts +2 -0
- package/dist/runtimes/codex/installation.d.ts.map +1 -0
- package/dist/runtimes/codex/installation.js +17 -0
- package/dist/runtimes/codex/installation.js.map +1 -0
- package/dist/runtimes/codex/item-detail.d.ts +4 -0
- package/dist/runtimes/codex/item-detail.d.ts.map +1 -0
- package/dist/runtimes/codex/item-detail.js +47 -0
- package/dist/runtimes/codex/item-detail.js.map +1 -0
- package/dist/runtimes/codex/projection.d.ts +28 -0
- package/dist/runtimes/codex/projection.d.ts.map +1 -0
- package/dist/runtimes/codex/projection.js +98 -0
- package/dist/runtimes/codex/projection.js.map +1 -0
- package/dist/runtimes/codex/reasoning.d.ts +4 -0
- package/dist/runtimes/codex/reasoning.d.ts.map +1 -0
- package/dist/runtimes/codex/reasoning.js +23 -0
- package/dist/runtimes/codex/reasoning.js.map +1 -0
- package/dist/runtimes/codex/session.d.ts +3 -0
- package/dist/runtimes/codex/session.d.ts.map +1 -0
- package/dist/runtimes/codex/session.js +199 -0
- package/dist/runtimes/codex/session.js.map +1 -0
- package/dist/runtimes/pi/index.d.ts +12 -0
- package/dist/runtimes/pi/index.d.ts.map +1 -0
- package/dist/runtimes/pi/index.js +15 -0
- package/dist/runtimes/pi/index.js.map +1 -0
- package/dist/runtimes/pi/installation.d.ts +10 -0
- package/dist/runtimes/pi/installation.d.ts.map +1 -0
- package/dist/runtimes/pi/installation.js +33 -0
- package/dist/runtimes/pi/installation.js.map +1 -0
- package/dist/runtimes/pi/projection.d.ts +39 -0
- package/dist/runtimes/pi/projection.d.ts.map +1 -0
- package/dist/runtimes/pi/projection.js +112 -0
- package/dist/runtimes/pi/projection.js.map +1 -0
- package/dist/runtimes/pi/session.d.ts +11 -0
- package/dist/runtimes/pi/session.d.ts.map +1 -0
- package/dist/runtimes/pi/session.js +201 -0
- package/dist/runtimes/pi/session.js.map +1 -0
- package/dist/runtimes/pi/tool-detail.d.ts +4 -0
- package/dist/runtimes/pi/tool-detail.d.ts.map +1 -0
- package/dist/runtimes/pi/tool-detail.js +14 -0
- package/dist/runtimes/pi/tool-detail.js.map +1 -0
- package/dist/shared/diagnostic-text.d.ts +2 -0
- package/dist/shared/diagnostic-text.d.ts.map +1 -0
- package/dist/shared/diagnostic-text.js +15 -0
- package/dist/shared/diagnostic-text.js.map +1 -0
- package/dist/shared/executable/index.d.ts +8 -0
- package/dist/shared/executable/index.d.ts.map +1 -0
- package/dist/shared/executable/index.js +5 -0
- package/dist/shared/executable/index.js.map +1 -0
- package/dist/shared/executable/process.d.ts +27 -0
- package/dist/shared/executable/process.d.ts.map +1 -0
- package/dist/shared/executable/process.js +77 -0
- package/dist/shared/executable/process.js.map +1 -0
- package/dist/shared/executable/resolve.d.ts +16 -0
- package/dist/shared/executable/resolve.d.ts.map +1 -0
- package/dist/shared/executable/resolve.js +63 -0
- package/dist/shared/executable/resolve.js.map +1 -0
- package/dist/shared/executable/run.d.ts +13 -0
- package/dist/shared/executable/run.d.ts.map +1 -0
- package/dist/shared/executable/run.js +26 -0
- package/dist/shared/executable/run.js.map +1 -0
- package/dist/shared/executable/version.d.ts +6 -0
- package/dist/shared/executable/version.d.ts.map +1 -0
- package/dist/shared/executable/version.js +17 -0
- package/dist/shared/executable/version.js.map +1 -0
- package/dist/shared/failure-class.d.ts +8 -0
- package/dist/shared/failure-class.d.ts.map +1 -0
- package/dist/shared/failure-class.js +24 -0
- package/dist/shared/failure-class.js.map +1 -0
- package/dist/shared/installation.d.ts +9 -0
- package/dist/shared/installation.d.ts.map +1 -0
- package/dist/shared/installation.js +53 -0
- package/dist/shared/installation.js.map +1 -0
- package/dist/shared/instant.d.ts +4 -0
- package/dist/shared/instant.d.ts.map +1 -0
- package/dist/shared/instant.js +4 -0
- package/dist/shared/instant.js.map +1 -0
- package/dist/shared/json.d.ts +10 -0
- package/dist/shared/json.d.ts.map +1 -0
- package/dist/shared/json.js +29 -0
- package/dist/shared/json.js.map +1 -0
- package/dist/shared/seal-session.d.ts +8 -0
- package/dist/shared/seal-session.d.ts.map +1 -0
- package/dist/shared/seal-session.js +24 -0
- package/dist/shared/seal-session.js.map +1 -0
- package/dist/shared/session-kernel.d.ts +25 -0
- package/dist/shared/session-kernel.d.ts.map +1 -0
- package/dist/shared/session-kernel.js +64 -0
- package/dist/shared/session-kernel.js.map +1 -0
- package/package.json +47 -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 [yyyy] [name of copyright owner]
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @botiverse/oar
|
|
2
|
+
|
|
3
|
+
Provider-independent TypeScript contracts and built-in implementations for observing agent runtimes.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { runtimes } from "@botiverse/oar";
|
|
7
|
+
|
|
8
|
+
const codex = runtimes.require("codex");
|
|
9
|
+
const installation = await codex.installation?.probe();
|
|
10
|
+
const usage = await codex.accountUsage?.read();
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The command-line interface is a separate package: `@botiverse/oar-cli`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AvailableInstallation } from "./installation.js";
|
|
2
|
+
declare const utcInstantBrand: unique symbol;
|
|
3
|
+
/**
|
|
4
|
+
* An absolute UTC instant in the canonical ISO 8601 form produced by
|
|
5
|
+
* `Date.prototype.toISOString()`, for example `2026-08-22T09:59:00.000Z`.
|
|
6
|
+
*/
|
|
7
|
+
export type UtcInstant = string & {
|
|
8
|
+
readonly [utcInstantBrand]: true;
|
|
9
|
+
};
|
|
10
|
+
export interface AccountUsageWindow {
|
|
11
|
+
/** Human-readable, runtime-provided name of the usage bucket. */
|
|
12
|
+
readonly label: string;
|
|
13
|
+
/** Consumed fraction normalized to the inclusive range from 0 to 1. */
|
|
14
|
+
readonly usedRatio: number;
|
|
15
|
+
/** Next reset as a UTC instant; omitted when the runtime does not report one. */
|
|
16
|
+
readonly resetsAt?: UtcInstant;
|
|
17
|
+
}
|
|
18
|
+
export type AccountUsageSnapshot = {
|
|
19
|
+
readonly kind: "available";
|
|
20
|
+
readonly plan?: string;
|
|
21
|
+
readonly rateLimited: boolean;
|
|
22
|
+
readonly windows: readonly AccountUsageWindow[];
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: "reauth_required";
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: "unsupported";
|
|
27
|
+
};
|
|
28
|
+
export interface AccountUsageReadOptions {
|
|
29
|
+
readonly timeoutMs?: number;
|
|
30
|
+
}
|
|
31
|
+
export type AccountUsageReader = (installation: AvailableInstallation, options?: AccountUsageReadOptions) => Promise<AccountUsageSnapshot>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=account-usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-usage.d.ts","sourceRoot":"","sources":["../../src/contracts/account-usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,CAAC,MAAM,eAAe,EAAE,OAAO,MAAM,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,MAAM,oBAAoB,GAC5B;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACjD,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GACpC;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAErC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,kBAAkB,GAAG,CAC/B,YAAY,EAAE,qBAAqB,EACnC,OAAO,CAAC,EAAE,uBAAuB,KAC9B,OAAO,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-usage.js","sourceRoot":"","sources":["../../src/contracts/account-usage.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** A verified machine-installed executable: the probed command and its reported version. */
|
|
2
|
+
export interface ExecutableInstallation {
|
|
3
|
+
readonly kind: "available";
|
|
4
|
+
readonly via: "executable";
|
|
5
|
+
readonly command: string;
|
|
6
|
+
readonly version?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A runtime compiled into the embedding application; availability needs no
|
|
10
|
+
* probe target. Deliberately versionless: the embedder pins the sdk version,
|
|
11
|
+
* so unlike an uncontrolled machine-installed CLI there is nothing to advise
|
|
12
|
+
* the user to upgrade.
|
|
13
|
+
*/
|
|
14
|
+
export interface BundledInstallation {
|
|
15
|
+
readonly kind: "available";
|
|
16
|
+
readonly via: "bundled";
|
|
17
|
+
}
|
|
18
|
+
export type AvailableInstallation = ExecutableInstallation | BundledInstallation;
|
|
19
|
+
export type InstallationSnapshot = AvailableInstallation | {
|
|
20
|
+
readonly kind: "not_found";
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: "unsupported";
|
|
23
|
+
readonly reason: string;
|
|
24
|
+
};
|
|
25
|
+
/** A local-only installation observation. Implementations must not perform account or usage I/O. */
|
|
26
|
+
export type InstallationProbe = () => Promise<InstallationSnapshot>;
|
|
27
|
+
//# sourceMappingURL=installation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/contracts/installation.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GAAG,mBAAmB,CAAC;AAEjF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEN,oGAAoG;AACpG,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../src/contracts/installation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AccountUsageReader } from "./account-usage.js";
|
|
2
|
+
import type { InstallationProbe } from "./installation.js";
|
|
3
|
+
import type { StartSession } from "./session.js";
|
|
4
|
+
/** One provider-independent runtime adoption unit. */
|
|
5
|
+
export interface Runtime {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly session: StartSession;
|
|
8
|
+
readonly installation?: InstallationProbe;
|
|
9
|
+
readonly accountUsage?: AccountUsageReader;
|
|
10
|
+
}
|
|
11
|
+
export declare function defineRuntime<const T extends Runtime>(runtime: T): T;
|
|
12
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/contracts/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,sDAAsD;AACtD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,kBAAkB,CAAC;CAC5C;AAED,wBAAgB,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAEpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/contracts/runtime.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,aAAa,CAA0B,OAAU;IAC/D,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import type { AvailableInstallation } from "./installation.js";
|
|
2
|
+
/**
|
|
3
|
+
* Session/Turn contract v1. Behavior invariants live as comments on the
|
|
4
|
+
* member they constrain; each "must/never" has (or gets) a sea-trial case.
|
|
5
|
+
*
|
|
6
|
+
* Scope notes that fit no single member:
|
|
7
|
+
* - Ownership is the object reference; no in-process lease. Multi-controller
|
|
8
|
+
* arbitration belongs to the application layer.
|
|
9
|
+
* - Sessions run YOLO by default: adapters disable interactive permission
|
|
10
|
+
* gates (claude --dangerously-skip-permissions, codex approvalPolicy
|
|
11
|
+
* never, pi pre-trusted cwd) AND default sandboxes off (codex
|
|
12
|
+
* danger-full-access; claude/pi have none). In embedded use nobody sits
|
|
13
|
+
* at an approval prompt — a gate is a hang, not safety. A host wanting
|
|
14
|
+
* isolation opts in (OAR_CODEX_SANDBOX), and codex's exec follows the
|
|
15
|
+
* USER's config-level sandbox_mode on real logins, which OAR never
|
|
16
|
+
* overrides.
|
|
17
|
+
* - v1 defers resume/persistence, interactive permission settlement, and any
|
|
18
|
+
* remote/multi-consumer model.
|
|
19
|
+
* - pi emits session-scoped events (compaction_start/end, queue_update) that
|
|
20
|
+
* belong to no turn; representing those is a deliberate v2 decision
|
|
21
|
+
* (nullable turnId vs a second event scope). Until then adapters drop them.
|
|
22
|
+
*/
|
|
23
|
+
export interface SessionOptions {
|
|
24
|
+
/** Working directory the runtime operates in. */
|
|
25
|
+
readonly cwd: string;
|
|
26
|
+
/** Runtime-native model identifier; the runtime's default when omitted. */
|
|
27
|
+
readonly model?: string;
|
|
28
|
+
/** Resume the runtime-native session identified by a previous Session.id. */
|
|
29
|
+
readonly resume?: string;
|
|
30
|
+
/** Extra environment overlaid on the host env for the processes THIS session spawns. Subprocess runtimes: the runtime process itself (tools inherit). In-process runtimes: only the agent's tool subprocesses — provider config needs the runtime's native channel there. CAVEAT for PATH-like entries: a runtime that runs tools through a login shell (codex: zsh/bash -lc) lets profile scripts reorder or rebuild PATH — probed: codex demotes injected entries on Linux and macOS path_helper/.zprofile can drop them. Injected CLIs should be invoked by ABSOLUTE path. */
|
|
31
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
32
|
+
/** REPLACE the runtime's built-in system prompt (claude --system-prompt, codex thread baseInstructions, pi resource-loader systemPrompt). Survives runtime compaction — pinned per vendor. */
|
|
33
|
+
readonly systemPrompt?: string;
|
|
34
|
+
/** APPEND to the runtime's built-in system prompt, keeping its harness behavior intact (claude --append-system-prompt, codex developerInstructions, pi appendSystemPrompt). Survives runtime compaction — pinned per vendor. */
|
|
35
|
+
readonly appendSystemPrompt?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Execution capability entrypoint; composition probes installation first.
|
|
39
|
+
* Rejects only on operational failure (spawn/load/auth errors carry the
|
|
40
|
+
* runtime's message).
|
|
41
|
+
*/
|
|
42
|
+
export type StartSession = (installation: AvailableInstallation, options: SessionOptions) => Promise<Session>;
|
|
43
|
+
/**
|
|
44
|
+
* The SPI face: what an adapter actually builds. Today every member is also
|
|
45
|
+
* public, so the API face extends this; if an SPI-internal member ever
|
|
46
|
+
* appears, the extends breaks into an explicit mapping inside sealSession —
|
|
47
|
+
* that seam is already the only place the two faces meet.
|
|
48
|
+
*/
|
|
49
|
+
export interface AdapterSession {
|
|
50
|
+
readonly id: string;
|
|
51
|
+
prompt(input: string): PromptResult;
|
|
52
|
+
subscribe(observer: SessionObserver): Unsubscribe;
|
|
53
|
+
readonly queue?: TurnQueue;
|
|
54
|
+
contextUsage?(): ContextUsage | null;
|
|
55
|
+
dispose(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Current context fullness — borrowed from pi's shape because it already
|
|
59
|
+
* models the hard case: `tokens` is null when unknown (right after compaction,
|
|
60
|
+
* before the next model response), and `percent` follows. NOT a running sum of
|
|
61
|
+
* usage deltas; the latest authoritative snapshot the runtime reported.
|
|
62
|
+
*/
|
|
63
|
+
export interface ContextUsage {
|
|
64
|
+
readonly tokens: number | null;
|
|
65
|
+
readonly contextWindow: number | null;
|
|
66
|
+
readonly percent: number | null;
|
|
67
|
+
}
|
|
68
|
+
/** The API face: the SPI plus surfaces sealSession derives. */
|
|
69
|
+
export interface Session extends AdapterSession {
|
|
70
|
+
/**
|
|
71
|
+
* DERIVED, not adapter-implemented: steer when the runtime can, fall back to
|
|
72
|
+
* queueing, always report where the input landed. `rejected` means the input
|
|
73
|
+
* was NOT taken over and the caller still owns it.
|
|
74
|
+
*/
|
|
75
|
+
steerOrQueue(turn: Turn, input: string): Promise<SteerOrQueueResult>;
|
|
76
|
+
}
|
|
77
|
+
export type SteerOrQueueResult = {
|
|
78
|
+
readonly landed: "steered";
|
|
79
|
+
} | {
|
|
80
|
+
readonly landed: "queued";
|
|
81
|
+
} | {
|
|
82
|
+
readonly landed: "rejected";
|
|
83
|
+
readonly reason: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Queue input to run as a future turn. `add` follows the same weak
|
|
87
|
+
* delivery-obligation transfer as steer's accepted: the adapter (or runtime)
|
|
88
|
+
* now owns not losing it; whether that survives a process restart is what
|
|
89
|
+
* `durable` reports honestly (codex: runtime-persisted; claude/pi: held in
|
|
90
|
+
* this process only).
|
|
91
|
+
*/
|
|
92
|
+
export interface TurnQueue {
|
|
93
|
+
readonly durable: boolean;
|
|
94
|
+
add(input: string): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
export type PromptResult = {
|
|
97
|
+
readonly kind: "turn";
|
|
98
|
+
readonly turn: Turn;
|
|
99
|
+
} | {
|
|
100
|
+
readonly kind: "busy";
|
|
101
|
+
};
|
|
102
|
+
export type SessionObserver = (event: SessionEvent) => void;
|
|
103
|
+
export type Unsubscribe = () => void;
|
|
104
|
+
export interface Turn {
|
|
105
|
+
readonly id: string;
|
|
106
|
+
readonly outcome: Promise<TurnOutcome>;
|
|
107
|
+
abort(): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Mid-turn input; absent when the runtime cannot inject into an active turn.
|
|
110
|
+
* `accepted` is ONE deliberately weak promise, identical on every runtime:
|
|
111
|
+
* the adapter has taken over this input and the caller's delivery
|
|
112
|
+
* obligation ENDS — do not resubmit. Taking over means the adapter now owns
|
|
113
|
+
* not losing it (e.g. holding it through runtime-autonomous compaction);
|
|
114
|
+
* failure to take over is a typed not_steerable or a thrown operational
|
|
115
|
+
* error, never a silent drop. No guarantee it lands in the current turn,
|
|
116
|
+
* that the model attends to it, or that any business outcome happened. How
|
|
117
|
+
* acceptance happens (stdin write, native enqueue, a runtime-side steer
|
|
118
|
+
* ack) is adapter-internal and adapter-tested, never an application-facing
|
|
119
|
+
* difference. Input written during
|
|
120
|
+
* runtime-autonomous compaction is HELD, not lost; codex Compact/Review
|
|
121
|
+
* turns reject with not_steerable instead. Where input landed is the event
|
|
122
|
+
* stream's job: same turnId, or a fresh turn_started when a runtime
|
|
123
|
+
* auto-queues past a turn that just ended (that spontaneous turn has events
|
|
124
|
+
* but no control handle yet).
|
|
125
|
+
*/
|
|
126
|
+
readonly steer?: (input: string) => Promise<SteerResult>;
|
|
127
|
+
}
|
|
128
|
+
/** Coarse failure classification so applications can react (re-login, back off, report a bug) without parsing vendor error prose. Best-effort: adapters map what the runtime reveals; "unknown" is an honest answer. */
|
|
129
|
+
export type FailureClass = "auth" | "quota" | "invalid_request" | "overloaded" | "provider" | "runtime_exited" | "unknown";
|
|
130
|
+
export type TurnOutcome = {
|
|
131
|
+
readonly kind: "completed";
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: "aborted";
|
|
134
|
+
} | {
|
|
135
|
+
readonly kind: "failed";
|
|
136
|
+
readonly reason: string;
|
|
137
|
+
readonly failure: FailureClass;
|
|
138
|
+
};
|
|
139
|
+
export type SteerResult = {
|
|
140
|
+
readonly kind: "accepted";
|
|
141
|
+
} | {
|
|
142
|
+
readonly kind: "not_steerable";
|
|
143
|
+
readonly reason: string;
|
|
144
|
+
};
|
|
145
|
+
/** Envelope + minimal body; runtime-specific detail waits for real demand. */
|
|
146
|
+
export type SessionEvent = SessionEventEnvelope & SessionEventBody;
|
|
147
|
+
export interface SessionEventEnvelope {
|
|
148
|
+
readonly sessionId: string;
|
|
149
|
+
readonly turnId: string;
|
|
150
|
+
/** Monotonic per session; total order for trace alignment. */
|
|
151
|
+
readonly seq: number;
|
|
152
|
+
/** Unix epoch milliseconds stamped at adapter ingress — same clock as Date.now(), so fold×clock consumers (stallOf) compose directly. */
|
|
153
|
+
readonly receivedAt: number;
|
|
154
|
+
}
|
|
155
|
+
export type ReasoningContent = {
|
|
156
|
+
readonly kind: "text";
|
|
157
|
+
readonly text: string;
|
|
158
|
+
} | {
|
|
159
|
+
readonly kind: "redacted";
|
|
160
|
+
} | {
|
|
161
|
+
readonly kind: "empty";
|
|
162
|
+
};
|
|
163
|
+
export type SessionEventBody = {
|
|
164
|
+
readonly kind: "turn_started";
|
|
165
|
+
} | {
|
|
166
|
+
readonly kind: "text_delta";
|
|
167
|
+
readonly text: string;
|
|
168
|
+
}
|
|
169
|
+
/** A reasoning output item; its lifecycle remains observable without readable contents. */
|
|
170
|
+
| {
|
|
171
|
+
readonly kind: "reasoning";
|
|
172
|
+
readonly content: ReasoningContent;
|
|
173
|
+
} | {
|
|
174
|
+
readonly kind: "tool_call_started";
|
|
175
|
+
readonly callId: string;
|
|
176
|
+
readonly tool: string;
|
|
177
|
+
/** Best-effort human-readable invocation detail when the runtime exposes it. */
|
|
178
|
+
readonly input?: string;
|
|
179
|
+
} | {
|
|
180
|
+
readonly kind: "tool_call_ended";
|
|
181
|
+
readonly callId: string;
|
|
182
|
+
/** Best-effort human-readable result detail when the runtime exposes it. */
|
|
183
|
+
readonly output?: string;
|
|
184
|
+
} | {
|
|
185
|
+
readonly kind: "turn_ended";
|
|
186
|
+
readonly outcome: TurnOutcome;
|
|
187
|
+
};
|
|
188
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/contracts/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,ijBAAijB;IACjjB,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,8LAA8L;IAC9L,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,gOAAgO;IAChO,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,YAAY,EAAE,qBAAqB,EACnC,OAAO,EAAE,cAAc,KACpB,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC;IACpC,SAAS,CAAC,QAAQ,EAAE,e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egistry } from "./registry.js";
|
|
2
|
+
export type { AccountUsageReader, AccountUsageReadOptions, AccountUsageSnapshot, AccountUsageWindow, UtcInstant, } from "./contracts/account-usage.js";
|
|
3
|
+
export type { AvailableInstallation, BundledInstallation, ExecutableInstallation, InstallationProbe, InstallationSnapshot, } from "./contracts/installation.js";
|
|
4
|
+
export type { Runtime } from "./contracts/runtime.js";
|
|
5
|
+
export type { AdapterSession, PromptResult, ReasoningContent, Session, SessionEvent, SessionEventBody, SessionEventEnvelope, SessionObserver, SessionOptions, StartSession, SteerOrQueueResult, SteerResult, Turn, TurnOutcome, TurnQueue, Unsubscribe, } from "./contracts/session.js";
|
|
6
|
+
export { defineRuntime } from "./contracts/runtime.js";
|
|
7
|
+
export { utcInstantFromDate } from "./shared/instant.js";
|
|
8
|
+
export { RuntimeRegistry, createRuntimeRegistry } from "./registry.js";
|
|
9
|
+
export { aggregateDeltas } from "./observe/aggregate-events.js";
|
|
10
|
+
export { initialStatus, reduceStatus, stallOf, } from "./observe/agent-status.js";
|
|
11
|
+
export type { AgentStatus, RunningPhase } from "./observe/agent-status.js";
|
|
12
|
+
export { observeStalls } from "./observe/stall-observer.js";
|
|
13
|
+
export type { StallInfo } from "./observe/stall-observer.js";
|
|
14
|
+
export { observeAgent, simpleStateOf } from "./observe/observe-agent.js";
|
|
15
|
+
export { classifyTool, toolActionLabel } from "./observe/tool-activity.js";
|
|
16
|
+
export type { ToolAction, ToolActionKind } from "./observe/tool-activity.js";
|
|
17
|
+
export type { AgentObserver, AgentView, ObserveAgentOptions } from "./observe/observe-agent.js";
|
|
18
|
+
export { claudeRuntime } from "./runtimes/claude/index.js";
|
|
19
|
+
export { claudeSession } from "./runtimes/claude/session.js";
|
|
20
|
+
export { claudeInstallation } from "./runtimes/claude/installation.js";
|
|
21
|
+
export { codexRuntime } from "./runtimes/codex/index.js";
|
|
22
|
+
export { codexSession } from "./runtimes/codex/session.js";
|
|
23
|
+
export { codexInstallation } from "./runtimes/codex/installation.js";
|
|
24
|
+
export { piRuntime } from "./runtimes/pi/index.js";
|
|
25
|
+
export { piSession } from "./runtimes/pi/session.js";
|
|
26
|
+
export { piInstallation } from "./runtimes/pi/installation.js";
|
|
27
|
+
export declare const runtimes: RuntimeRegistry;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKhD,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,SAAS,EACT,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,OAAO,GACR,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC3E,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC7E,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,eAAO,MAAM,QAAQ,iBAAgE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RuntimeRegistry } from "./registry.js";
|
|
2
|
+
import { claudeRuntime } from "./runtimes/claude/index.js";
|
|
3
|
+
import { codexRuntime } from "./runtimes/codex/index.js";
|
|
4
|
+
import { piRuntime } from "./runtimes/pi/index.js";
|
|
5
|
+
export { defineRuntime } from "./contracts/runtime.js";
|
|
6
|
+
export { utcInstantFromDate } from "./shared/instant.js";
|
|
7
|
+
export { RuntimeRegistry, createRuntimeRegistry } from "./registry.js";
|
|
8
|
+
export { aggregateDeltas } from "./observe/aggregate-events.js";
|
|
9
|
+
export { initialStatus, reduceStatus, stallOf, } from "./observe/agent-status.js";
|
|
10
|
+
export { observeStalls } from "./observe/stall-observer.js";
|
|
11
|
+
export { observeAgent, simpleStateOf } from "./observe/observe-agent.js";
|
|
12
|
+
export { classifyTool, toolActionLabel } from "./observe/tool-activity.js";
|
|
13
|
+
export { claudeRuntime } from "./runtimes/claude/index.js";
|
|
14
|
+
export { claudeSession } from "./runtimes/claude/session.js";
|
|
15
|
+
export { claudeInstallation } from "./runtimes/claude/installation.js";
|
|
16
|
+
export { codexRuntime } from "./runtimes/codex/index.js";
|
|
17
|
+
export { codexSession } from "./runtimes/codex/session.js";
|
|
18
|
+
export { codexInstallation } from "./runtimes/codex/installation.js";
|
|
19
|
+
export { piRuntime } from "./runtimes/pi/index.js";
|
|
20
|
+
export { piSession } from "./runtimes/pi/session.js";
|
|
21
|
+
export { piInstallation } from "./runtimes/pi/installation.js";
|
|
22
|
+
export const runtimes = new RuntimeRegistry([claudeRuntime, codexRuntime, piRuntime]);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAmCnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,OAAO,GACR,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG3E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Installation } from "./contracts/installation.js";
|
|
2
|
+
interface ReadinessProbe {
|
|
3
|
+
readonly args: readonly string[];
|
|
4
|
+
readonly unsupportedReason: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ExecutableInstallationDefinition {
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly command: string;
|
|
9
|
+
readonly explicit?: string | undefined;
|
|
10
|
+
readonly fallbacks?: readonly string[];
|
|
11
|
+
readonly readiness?: ReadinessProbe;
|
|
12
|
+
}
|
|
13
|
+
export declare function createExecutableInstallation(definition: ExecutableInstallationDefinition): Installation;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=installation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../src/installation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAwB,MAAM,6BAA6B,CAAC;AAGtF,UAAU,cAAc;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;CACrC;AA2BD,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,gCAAgC,GAC3C,YAAY,CAoCd"}
|