@botiverse/oar 0.21.0 → 0.21.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/dist/observe/app-requests.d.ts +20 -0
- package/dist/observe/app-requests.d.ts.map +1 -0
- package/dist/observe/app-requests.js +41 -0
- package/dist/observe/app-requests.js.map +1 -0
- package/dist/observe/index.d.ts +2 -0
- package/dist/observe/index.d.ts.map +1 -1
- package/dist/observe/index.js +1 -0
- package/dist/observe/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a runtime→app request asks for, read off its `type`: the `type` of an
|
|
3
|
+
* `app_request` event, view part or pending request (the runtime's native
|
|
4
|
+
* method or subtype of a `toApp` request). Each runtime names the same ask
|
|
5
|
+
* differently (ACP `session/request_permission`, codex
|
|
6
|
+
* `item/commandExecution/requestApproval`, claude `can_use_tool`); only OAR
|
|
7
|
+
* knows the mapping, so it lives here, as `classifyTool`'s does. Pure: the
|
|
8
|
+
* request record stays the source of truth.
|
|
9
|
+
*
|
|
10
|
+
* - `approval`: may the agent go ahead with an action (a tool call, a command, a file change)?
|
|
11
|
+
* - `question`: the agent, or an MCP server through it, asks the user for input.
|
|
12
|
+
* - `service`: a client call the adapter serves itself (an ACP terminal or file); no person is asked.
|
|
13
|
+
* - `unknown`: a type OAR does not recognise. The set is OPEN (runtimes add
|
|
14
|
+
* methods), so an unrecognised type is `unknown` rather than force-fit, and a
|
|
15
|
+
* host keeps showing it.
|
|
16
|
+
*/
|
|
17
|
+
export type AppRequestKind = "approval" | "question" | "service" | "unknown";
|
|
18
|
+
/** Classify a runtime→app request by its `type` (an `app_request`'s method or subtype). */
|
|
19
|
+
export declare function appRequestKind(type: string): AppRequestKind;
|
|
20
|
+
//# sourceMappingURL=app-requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-requests.d.ts","sourceRoot":"","sources":["../../src/observe/app-requests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AA0C7E,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE3D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type → kind. The names are distinct across runtimes, so the type alone
|
|
3
|
+
* decides. Where each name comes from:
|
|
4
|
+
* - ACP (kimi, grok, antigravity): the client methods of
|
|
5
|
+
* `@agentclientprotocol/sdk` 1.4.0 (`methods.client`); shared/acp/client-app.ts
|
|
6
|
+
* serves the permission and terminal ones and records each as a `toApp`
|
|
7
|
+
* request. OAR advertises no `fs` capability and serves no elicitation, so
|
|
8
|
+
* no recorded request carries those yet.
|
|
9
|
+
* - codex: the app-server's server requests, which the adapter records under
|
|
10
|
+
* their method (codex/session.ts), as `codex app-server
|
|
11
|
+
* generate-json-schema` lists them in 0.160.0. The legacy
|
|
12
|
+
* `execCommandApproval` / `applyPatchApproval` answer only turns started
|
|
13
|
+
* through the v1 APIs, which OAR does not use.
|
|
14
|
+
* - claude: the `control_request` subtypes claude 2.1.288 sends its host,
|
|
15
|
+
* recorded under the subtype (claude/projection.ts).
|
|
16
|
+
* - morph (community): the approval a task waits on (community/morph/tracker.ts).
|
|
17
|
+
*/
|
|
18
|
+
const KINDS = new Map([
|
|
19
|
+
["session/request_permission", "approval"],
|
|
20
|
+
["elicitation/create", "question"],
|
|
21
|
+
["terminal/create", "service"],
|
|
22
|
+
["terminal/output", "service"],
|
|
23
|
+
["terminal/wait_for_exit", "service"],
|
|
24
|
+
["terminal/kill", "service"],
|
|
25
|
+
["terminal/release", "service"],
|
|
26
|
+
["fs/read_text_file", "service"],
|
|
27
|
+
["fs/write_text_file", "service"],
|
|
28
|
+
["item/commandExecution/requestApproval", "approval"],
|
|
29
|
+
["item/fileChange/requestApproval", "approval"],
|
|
30
|
+
["item/permissions/requestApproval", "approval"],
|
|
31
|
+
["item/tool/requestUserInput", "question"],
|
|
32
|
+
["mcpServer/elicitation/request", "question"],
|
|
33
|
+
["can_use_tool", "approval"],
|
|
34
|
+
["elicitation", "question"],
|
|
35
|
+
["approval", "approval"],
|
|
36
|
+
]);
|
|
37
|
+
/** Classify a runtime→app request by its `type` (an `app_request`'s method or subtype). */
|
|
38
|
+
export function appRequestKind(type) {
|
|
39
|
+
return KINDS.get(type) ?? "unknown";
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=app-requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-requests.js","sourceRoot":"","sources":["../../src/observe/app-requests.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,KAAK,GAAwC,IAAI,GAAG,CAAyB;IACjF,CAAC,4BAA4B,EAAE,UAAU,CAAC;IAC1C,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAClC,CAAC,iBAAiB,EAAE,SAAS,CAAC;IAC9B,CAAC,iBAAiB,EAAE,SAAS,CAAC;IAC9B,CAAC,wBAAwB,EAAE,SAAS,CAAC;IACrC,CAAC,eAAe,EAAE,SAAS,CAAC;IAC5B,CAAC,kBAAkB,EAAE,SAAS,CAAC;IAC/B,CAAC,mBAAmB,EAAE,SAAS,CAAC;IAChC,CAAC,oBAAoB,EAAE,SAAS,CAAC;IAEjC,CAAC,uCAAuC,EAAE,UAAU,CAAC;IACrD,CAAC,iCAAiC,EAAE,UAAU,CAAC;IAC/C,CAAC,kCAAkC,EAAE,UAAU,CAAC;IAChD,CAAC,4BAA4B,EAAE,UAAU,CAAC;IAC1C,CAAC,+BAA+B,EAAE,UAAU,CAAC;IAE7C,CAAC,cAAc,EAAE,UAAU,CAAC;IAC5B,CAAC,aAAa,EAAE,UAAU,CAAC;IAE3B,CAAC,UAAU,EAAE,UAAU,CAAC;CACzB,CAAC,CAAC;AAEH,2FAA2F;AAC3F,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;AACtC,CAAC"}
|
package/dist/observe/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export type { AgentObserver, AgentView, ObserveAgentOptions } from "./observe-ag
|
|
|
16
16
|
export { classifyTool, toolActionLabel } from "./tool-activity.js";
|
|
17
17
|
export { groupToolActivity, toolGroupSummary } from "./tool-groups.js";
|
|
18
18
|
export { toolResultText } from "./tool-output.js";
|
|
19
|
+
export { appRequestKind } from "./app-requests.js";
|
|
20
|
+
export type { AppRequestKind } from "./app-requests.js";
|
|
19
21
|
export type { ToolAction, ToolActionKind } from "./tool-activity.js";
|
|
20
22
|
export type { ReasoningPart, ToolGroup, ToolGroupSegment, ToolPart } from "./tool-groups.js";
|
|
21
23
|
export { awaitIdle, awaitTurnEnd, promptAndWait, turnEndAfter } from "./turns.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observe/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACrF,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnF,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE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;AACxE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChF,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACjH,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,EACN,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,UAAU,EACV,cAAc,GACf,MAAM,mBAAmB,CAAC"}
|
package/dist/observe/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { observeAgent, simpleStateOf } from "./observe-agent.js";
|
|
|
12
12
|
export { classifyTool, toolActionLabel } from "./tool-activity.js";
|
|
13
13
|
export { groupToolActivity, toolGroupSummary } from "./tool-groups.js";
|
|
14
14
|
export { toolResultText } from "./tool-output.js";
|
|
15
|
+
export { appRequestKind } from "./app-requests.js";
|
|
15
16
|
export { awaitIdle, awaitTurnEnd, promptAndWait, turnEndAfter } from "./turns.js";
|
|
16
17
|
export { contextUsageOf, effortOf, modelOf, usageOf } from "./usage.js";
|
|
17
18
|
export { applyTaskEvent, initialTasks, reduceTasks, tasksOf } from "./tasks.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/observe/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,aA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;AAGhF,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGjH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,EACN,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botiverse/oar",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "A programming interface for all agent harnesses: provider-independent contracts for controlling and observing agent runtimes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|