@a5c-ai/agent-core 5.0.1-staging.9f7009ce → 5.0.1-staging.a2865ee1a2da
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/README.md +96 -7
- package/dist/agenticTools/background/state.d.ts +6 -4
- package/dist/agenticTools/background/state.d.ts.map +1 -1
- package/dist/agenticTools/background/state.js +9 -23
- package/dist/agenticTools/browser/tool.js +2 -2
- package/dist/agenticTools/config/state.d.ts +9 -9
- package/dist/agenticTools/config/state.d.ts.map +1 -1
- package/dist/agenticTools/config/state.js +14 -102
- package/dist/agenticTools/config/state.test.d.ts +2 -0
- package/dist/agenticTools/config/state.test.d.ts.map +1 -0
- package/dist/agenticTools/config/state.test.js +23 -0
- package/dist/agenticTools/config/tool.js +1 -1
- package/dist/agenticTools/discovery/tools.d.ts.map +1 -1
- package/dist/agenticTools/discovery/tools.js +6 -4
- package/dist/agenticTools/index.d.ts.map +1 -1
- package/dist/agenticTools/index.js +24 -2
- package/dist/agenticTools/shared/paths.d.ts.map +1 -1
- package/dist/agenticTools/shared/paths.js +2 -1
- package/dist/agenticTools/shared/process.d.ts +8 -0
- package/dist/agenticTools/shared/process.d.ts.map +1 -1
- package/dist/agenticTools/shared/process.js +24 -4
- package/dist/agenticTools/shared/results.d.ts.map +1 -1
- package/dist/agenticTools/shared/results.js +4 -2
- package/dist/agenticTools/tools/code.d.ts.map +1 -1
- package/dist/agenticTools/tools/code.js +168 -6
- package/dist/agenticTools/tools/delegation.d.ts.map +1 -1
- package/dist/agenticTools/tools/delegation.js +76 -0
- package/dist/agenticTools/tools/execution.d.ts.map +1 -1
- package/dist/agenticTools/tools/execution.js +118 -13
- package/dist/agenticTools/tools/fileSystem.d.ts.map +1 -1
- package/dist/agenticTools/tools/fileSystem.js +27 -4
- package/dist/agenticTools/tools/programmaticToolCalling.d.ts +4 -0
- package/dist/agenticTools/tools/programmaticToolCalling.d.ts.map +1 -0
- package/dist/agenticTools/tools/programmaticToolCalling.js +155 -0
- package/dist/agenticTools/types.d.ts +1 -1
- package/dist/agenticTools/types.d.ts.map +1 -1
- package/dist/backgroundProcessRegistry.d.ts +4 -60
- package/dist/backgroundProcessRegistry.d.ts.map +1 -1
- package/dist/backgroundProcessRegistry.js +7 -197
- package/dist/context/index.d.ts +5 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +12 -0
- package/dist/context/manager.d.ts +44 -0
- package/dist/context/manager.d.ts.map +1 -0
- package/dist/context/manager.js +115 -0
- package/dist/context/strategies/index.d.ts +4 -0
- package/dist/context/strategies/index.d.ts.map +1 -0
- package/dist/context/strategies/index.js +9 -0
- package/dist/context/strategies/priority.d.ts +29 -0
- package/dist/context/strategies/priority.d.ts.map +1 -0
- package/dist/context/strategies/priority.js +58 -0
- package/dist/context/strategies/sliding.d.ts +27 -0
- package/dist/context/strategies/sliding.d.ts.map +1 -0
- package/dist/context/strategies/sliding.js +62 -0
- package/dist/context/strategies/summary.d.ts +41 -0
- package/dist/context/strategies/summary.d.ts.map +1 -0
- package/dist/context/strategies/summary.js +75 -0
- package/dist/context/token-estimator.d.ts +25 -0
- package/dist/context/token-estimator.d.ts.map +1 -0
- package/dist/context/token-estimator.js +53 -0
- package/dist/context/types.d.ts +137 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/context/types.js +9 -0
- package/dist/deferredToolRegistry.d.ts +9 -0
- package/dist/deferredToolRegistry.d.ts.map +1 -1
- package/dist/deferredToolRegistry.test.js +28 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -1
- package/dist/loop/agent-loop.d.ts +55 -0
- package/dist/loop/agent-loop.d.ts.map +1 -0
- package/dist/loop/agent-loop.js +303 -0
- package/dist/loop/index.d.ts +6 -0
- package/dist/loop/index.d.ts.map +1 -0
- package/dist/loop/index.js +11 -0
- package/dist/loop/strategies/concurrent.d.ts +41 -0
- package/dist/loop/strategies/concurrent.d.ts.map +1 -0
- package/dist/loop/strategies/concurrent.js +86 -0
- package/dist/loop/strategies/group-chat.d.ts +44 -0
- package/dist/loop/strategies/group-chat.d.ts.map +1 -0
- package/dist/loop/strategies/group-chat.js +121 -0
- package/dist/loop/strategies/handoff.d.ts +50 -0
- package/dist/loop/strategies/handoff.d.ts.map +1 -0
- package/dist/loop/strategies/handoff.js +112 -0
- package/dist/loop/strategies/index.d.ts +9 -0
- package/dist/loop/strategies/index.d.ts.map +1 -0
- package/dist/loop/strategies/index.js +11 -0
- package/dist/loop/strategies/sequential.d.ts +19 -0
- package/dist/loop/strategies/sequential.d.ts.map +1 -0
- package/dist/loop/strategies/sequential.js +29 -0
- package/dist/loop/types.d.ts +144 -0
- package/dist/loop/types.d.ts.map +1 -0
- package/dist/loop/types.js +9 -0
- package/dist/session.d.ts +13 -3
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +693 -127
- package/dist/session.test.js +592 -185
- package/dist/subagent/index.d.ts +6 -0
- package/dist/subagent/index.d.ts.map +1 -0
- package/dist/subagent/index.js +7 -0
- package/dist/subagent/invoker.d.ts +34 -0
- package/dist/subagent/invoker.d.ts.map +1 -0
- package/dist/subagent/invoker.js +132 -0
- package/dist/subagent/oversight.d.ts +43 -0
- package/dist/subagent/oversight.d.ts.map +1 -0
- package/dist/subagent/oversight.js +63 -0
- package/dist/subagent/types.d.ts +141 -0
- package/dist/subagent/types.d.ts.map +1 -0
- package/dist/subagent/types.js +9 -0
- package/dist/synthesis/index.d.ts +4 -0
- package/dist/synthesis/index.d.ts.map +1 -0
- package/dist/synthesis/index.js +9 -0
- package/dist/synthesis/strategies/index.d.ts +4 -0
- package/dist/synthesis/strategies/index.d.ts.map +1 -0
- package/dist/synthesis/strategies/index.js +9 -0
- package/dist/synthesis/strategies/merge.d.ts +18 -0
- package/dist/synthesis/strategies/merge.d.ts.map +1 -0
- package/dist/synthesis/strategies/merge.js +104 -0
- package/dist/synthesis/strategies/rank.d.ts +25 -0
- package/dist/synthesis/strategies/rank.d.ts.map +1 -0
- package/dist/synthesis/strategies/rank.js +51 -0
- package/dist/synthesis/strategies/vote.d.ts +17 -0
- package/dist/synthesis/strategies/vote.d.ts.map +1 -0
- package/dist/synthesis/strategies/vote.js +59 -0
- package/dist/synthesis/synthesizer.d.ts +25 -0
- package/dist/synthesis/synthesizer.d.ts.map +1 -0
- package/dist/synthesis/synthesizer.js +38 -0
- package/dist/synthesis/types.d.ts +96 -0
- package/dist/synthesis/types.d.ts.map +1 -0
- package/dist/synthesis/types.js +8 -0
- package/dist/tools.test.js +355 -7
- package/dist/types.d.ts +175 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -0
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -5,16 +5,16 @@ Built-in programmatic session wrapper and agentic tool surface for Babysitter ru
|
|
|
5
5
|
<!-- docs-status:start -->
|
|
6
6
|
> Status: Public advanced/runtime package.
|
|
7
7
|
> Canonical docs home: [Package and Plugin Docs Map](../../docs/package-and-plugin-map.md).
|
|
8
|
-
> This README defines the package contract for runtime consumers and published dependents such as `@a5c-ai/
|
|
8
|
+
> This README defines the package contract for runtime consumers and published dependents such as `@a5c-ai/agent-platform`.
|
|
9
9
|
<!-- docs-status:end -->
|
|
10
10
|
|
|
11
11
|
## Package role
|
|
12
12
|
|
|
13
|
-
`@a5c-ai/agent-core` sits between `@a5c-ai/
|
|
13
|
+
`@a5c-ai/agent-core` sits between `@a5c-ai/agent-platform`, `@a5c-ai/agent-mux`, and `@a5c-ai/babysitter-sdk`:
|
|
14
14
|
|
|
15
15
|
- `createAgentCoreSession()` wraps an `@a5c-ai/agent-mux` client for in-process prompt execution.
|
|
16
16
|
- `createAgentCoreToolDefinitions()` assembles the built-in Babysitter-flavored tool surface that host runtimes can inject into planning, resume, or delegated-task flows.
|
|
17
|
-
- `@a5c-ai/
|
|
17
|
+
- `@a5c-ai/agent-platform` re-exports these APIs from `src/harness/index.ts`, uses `createAgentCoreSession()` for direct `agent-core` harness invocation in `src/harness/invoker.ts`, and injects tool definitions into plan-process and resume-run flows.
|
|
18
18
|
- `@a5c-ai/babysitter-sdk` still owns run directories, journals, task/effect lifecycle, and config defaults. `agent-core` does not replace the SDK orchestration layer.
|
|
19
19
|
|
|
20
20
|
This package is published as a runtime dependency surface for higher-level Babysitter runtimes. It is still an advanced/operator-facing building block rather than the primary entrypoint for new users.
|
|
@@ -37,9 +37,18 @@ import {
|
|
|
37
37
|
resetRunScopedConfig,
|
|
38
38
|
stripHtmlTags,
|
|
39
39
|
type AgentCoreEventListener,
|
|
40
|
+
type AgentCoreImageBase64PromptPart,
|
|
41
|
+
type AgentCoreImageUrlPromptPart,
|
|
42
|
+
type AgentCoreJsonSchema,
|
|
43
|
+
type AgentCoreOutputFormat,
|
|
44
|
+
type AgentCorePromptInput,
|
|
45
|
+
type AgentCorePromptOptions,
|
|
46
|
+
type AgentCorePromptPart,
|
|
40
47
|
type AgentCorePromptResult,
|
|
41
48
|
type AgentCoreSessionEvent,
|
|
42
49
|
type AgentCoreSessionOptions,
|
|
50
|
+
type AgentCoreStructuredOutputOptions,
|
|
51
|
+
type AgentCoreTextPromptPart,
|
|
43
52
|
type AgentCoreToolOptions,
|
|
44
53
|
type CustomToolDefinition,
|
|
45
54
|
type ToolResult,
|
|
@@ -64,8 +73,11 @@ Core handle methods:
|
|
|
64
73
|
|
|
65
74
|
- `initialize()`: currently a no-op placeholder for compatibility.
|
|
66
75
|
- `prompt(text, timeout?)`: starts a run, streams events to subscribers, and returns `{ output, duration, success, exitCode }`.
|
|
76
|
+
- `prompt(input, options?)`: accepts text or multimodal prompt parts and optional structured-output settings.
|
|
67
77
|
- `steer(text)`: sends immediate steering text while a prompt is active, or queues it for the next prompt.
|
|
68
78
|
- `followUp(text)`: queues a post-response follow-up when streaming, or appends it to the next prompt when idle.
|
|
79
|
+
- `getHistory()`: returns a defensive copy of persisted user/assistant turns for the session handle.
|
|
80
|
+
- `clearHistory()`: clears persisted user/assistant turns without changing listeners, options, or the current session id.
|
|
69
81
|
- `subscribe(listener)`: receives normalized `AgentCoreSessionEvent` payloads, including `session_start`.
|
|
70
82
|
- `abort()`: aborts the active run if one is in progress.
|
|
71
83
|
- `dispose()`: aborts the active run, clears listeners, and drops queued follow-ups.
|
|
@@ -75,6 +87,8 @@ Core handle methods:
|
|
|
75
87
|
Session behavior that matters to host integrations:
|
|
76
88
|
|
|
77
89
|
- Agent-core reuses the `sessionId` learned from prior runs, so later prompts continue the same agent-mux session when the backend supports it.
|
|
90
|
+
- Agent-core also keeps successful user/assistant turns on the session handle and includes bounded prior history in later direct provider prompts. System prompts are rebuilt from options for each request and are not stored in mutable history.
|
|
91
|
+
- Failed prompts, timed-out requests, aborted requests, and malformed streams do not append partial assistant output to history.
|
|
78
92
|
- Concurrent `prompt()` calls on the same handle are rejected.
|
|
79
93
|
- Event payloads are normalized before subscribers see them. Non-object payloads become `{ type: "unknown", value }`.
|
|
80
94
|
- Approval mode is `prompt` only when `uiContext` is present; otherwise agent-core uses `yolo`.
|
|
@@ -86,11 +100,71 @@ Session behavior that matters to host integrations:
|
|
|
86
100
|
| `workspace` | Forwarded to agent-mux as `cwd`. |
|
|
87
101
|
| `model` | Forwarded to agent-mux as `model`. |
|
|
88
102
|
| `timeout` | Forwarded to agent-mux as `timeout`. |
|
|
103
|
+
| `maxHistoryTurns` | Maximum persisted user/assistant history entries retained on the session handle. Defaults to 20. |
|
|
104
|
+
| `maxHistoryTokens` | Maximum estimated tokens from prior history sent with a prompt. Uses the package's provider/model-aware rough token estimator and drops oldest entries first. |
|
|
89
105
|
| `thinkingLevel` | Translated to agent-mux `thinkingEffort` (`minimal`/`low` -> `low`, `medium` -> `medium`, `high` -> `high`, `xhigh` -> `max`). |
|
|
90
106
|
| `systemPrompt` | Used as the base `systemPrompt`. |
|
|
91
107
|
| `appendSystemPrompt` | Appended to the final `systemPrompt` before dispatch. |
|
|
92
108
|
| `uiContext` | Switches run approval mode to `prompt`; when omitted, agent-core uses `yolo`. |
|
|
93
109
|
| `backend` | Selects the agent-mux adapter/backend forwarded as `agent`. |
|
|
110
|
+
| `outputFormat` | Optional structured-output mode: `text`, `json_object`, or `json_schema`. |
|
|
111
|
+
| `outputSchema` | JSON Schema used when `outputFormat` is `json_schema`. |
|
|
112
|
+
| `outputSchemaName` | Provider-visible schema name. Defaults to `agent_core_response`. |
|
|
113
|
+
| `outputSchemaStrict` | Provider strictness flag for schema-capable APIs. Defaults to `true` for `json_schema`. |
|
|
114
|
+
|
|
115
|
+
### Structured Output
|
|
116
|
+
|
|
117
|
+
Structured output is opt-in. Plain `prompt(text, timeout?)` remains the default and returns only the text output fields used by existing callers.
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
const session = createAgentCoreSession({
|
|
121
|
+
model: "gpt-5.5",
|
|
122
|
+
outputFormat: "json_schema",
|
|
123
|
+
outputSchemaName: "answer_payload",
|
|
124
|
+
outputSchema: {
|
|
125
|
+
type: "object",
|
|
126
|
+
required: ["answer"],
|
|
127
|
+
properties: {
|
|
128
|
+
answer: { type: "string" },
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const result = await session.prompt<{ answer: string }>("Answer as JSON");
|
|
134
|
+
if (result.success) {
|
|
135
|
+
console.log(result.parsed?.answer);
|
|
136
|
+
} else {
|
|
137
|
+
console.error(result.validationError ?? result.output);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
OpenAI-compatible and Azure endpoints receive `response_format` with either `{ type: "json_object" }` or a `json_schema` payload. Anthropic does not expose the same response-format field through this direct Messages API path, so agent-core injects a system instruction that requires JSON-only output and still parses/validates the returned text locally.
|
|
142
|
+
|
|
143
|
+
`json_object` requires the model to return a JSON object. `json_schema` requires `outputSchema` and validates the parsed object for common JSON Schema constraints used by this package contract (`type`, `required`, `properties`, `items`, and `enum`). Parse or schema failures return `success: false`, `exitCode: 1`, the raw `output`, and `validationError`.
|
|
144
|
+
|
|
145
|
+
Prompt-level options can override session defaults:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
const result = await session.prompt<{ ok: boolean }>("Return status", {
|
|
149
|
+
outputFormat: "json_object",
|
|
150
|
+
});
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Multimodal Input
|
|
154
|
+
|
|
155
|
+
`prompt()` accepts an array of prompt parts for text plus image URL/base64 input:
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
await session.prompt([
|
|
159
|
+
{ type: "text", text: "Describe the relevant details in these images." },
|
|
160
|
+
{ type: "image_url", imageUrl: "https://example.com/screenshot.png" },
|
|
161
|
+
{ type: "image_base64", mediaType: "image/png", data: rawBase64Png },
|
|
162
|
+
]);
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
OpenAI-compatible and Azure endpoints receive Chat Completions content parts using `text` and `image_url`. Base64 images are converted to `data:<mediaType>;base64,...` URLs for those providers. Anthropic receives Messages API content blocks with `image` sources using either `url` or `base64`.
|
|
166
|
+
|
|
167
|
+
Agent-core validates image URLs before dispatch (`http`/`https` only), requires `image/*` media types for base64 images, rejects data URLs in the base64 field, and caps raw base64 image payloads at 20 MiB. Image-bearing `ToolResult` support remains owned by #588; this API only covers direct session prompt input.
|
|
94
168
|
|
|
95
169
|
### Deprecated compatibility fields
|
|
96
170
|
|
|
@@ -98,7 +172,7 @@ These fields remain on `AgentCoreSessionOptions` for compatibility, but the curr
|
|
|
98
172
|
|
|
99
173
|
| Option | Status | Migration note |
|
|
100
174
|
| --- | --- | --- |
|
|
101
|
-
| `toolsMode` | Deprecated, ignored by agent-core | Use backend-native configuration, or the PI wrapper in `@a5c-ai/
|
|
175
|
+
| `toolsMode` | Deprecated, ignored by agent-core | Use backend-native configuration, or the PI wrapper in `@a5c-ai/agent-platform`, if you still need tool-surface control. |
|
|
102
176
|
| `customTools` | Deprecated, ignored by agent-core | Register host-side tools with `createAgentCoreToolDefinitions()` or use the PI wrapper for runtime custom-tool injection. |
|
|
103
177
|
| `isolated` | Deprecated, ignored by agent-core | Use the PI wrapper if you still need extension/skills isolation controls. |
|
|
104
178
|
| `ephemeral` | Deprecated, ignored by agent-core | Session persistence is determined by the selected agent-mux backend. |
|
|
@@ -106,7 +180,7 @@ These fields remain on `AgentCoreSessionOptions` for compatibility, but the curr
|
|
|
106
180
|
| `enableCompaction` | Deprecated, ignored by agent-core | Compaction behavior belongs to the selected backend/runtime. |
|
|
107
181
|
| `agentDir` | Deprecated, ignored by agent-core | Configure agent directories through the target backend instead. |
|
|
108
182
|
|
|
109
|
-
If you still need the PI-era controls above, use the PI wrapper exposed from `@a5c-ai/
|
|
183
|
+
If you still need the PI-era controls above, use the PI wrapper exposed from `@a5c-ai/agent-platform` rather than `@a5c-ai/agent-core`.
|
|
110
184
|
|
|
111
185
|
## Tool-definition API
|
|
112
186
|
|
|
@@ -118,6 +192,9 @@ If you still need the PI-era controls above, use the PI wrapper exposed from `@a
|
|
|
118
192
|
- delegation tools: `AskUserQuestion`, `task`, `skill`
|
|
119
193
|
- code tools: `calc`, `ast_grep`, `ast_edit`, `render_mermaid`, `notebook`
|
|
120
194
|
- background/discovery/web tools: `background_status`, `background_list`, `tool_search`, `tool_fetch`, `web_search`, `fetch_process`
|
|
195
|
+
- optional programmatic tool calling: `code_executor` when `programmaticToolCalling` is enabled
|
|
196
|
+
|
|
197
|
+
The `calc` tool evaluates a constrained arithmetic language only: numeric literals, parentheses, unary `+`/`-`, and `+`, `-`, `*`, `/`, `%`, and `**`. It rejects identifiers, function calls, property access, assignment, malformed expressions, overlong input, and non-finite results. It does not use `eval`, `Function`, shell execution, or external processes.
|
|
121
198
|
|
|
122
199
|
`AgentCoreToolOptions` controls how those definitions are wired into a host runtime:
|
|
123
200
|
|
|
@@ -127,6 +204,18 @@ If you still need the PI-era controls above, use the PI wrapper exposed from `@a
|
|
|
127
204
|
- `onToolUse`: observer callback fired after tool wrapping.
|
|
128
205
|
- `onBackgroundComplete`, `maxBackgroundProcesses`, `backgroundRegistry`: background-process lifecycle hooks and limits.
|
|
129
206
|
- `deferredToolRegistry`: enables `tool_search` and `tool_fetch`.
|
|
207
|
+
- `programmaticToolCalling`: opt-in Code Mode / Programmatic Tool Calling surface. When enabled, `code_executor` runs a bounded JavaScript async body with `tools.<name>(params)` and `callTool(name, params)` helpers for batching existing agent-core tools behind one model-level tool call.
|
|
208
|
+
|
|
209
|
+
Example:
|
|
210
|
+
|
|
211
|
+
```ts
|
|
212
|
+
const tools = createAgentCoreToolDefinitions({
|
|
213
|
+
workspace: process.cwd(),
|
|
214
|
+
interactive: false,
|
|
215
|
+
deferredToolRegistry,
|
|
216
|
+
programmaticToolCalling: { maxToolCalls: 10, timeout: 60_000 },
|
|
217
|
+
});
|
|
218
|
+
```
|
|
130
219
|
|
|
131
220
|
### Interactive and cancellation contract
|
|
132
221
|
|
|
@@ -179,7 +268,7 @@ Source disambiguation uses `(source, sourceQualifier, name)`, so duplicate tool
|
|
|
179
268
|
|
|
180
269
|
Current downstream integration boundaries in this repo:
|
|
181
270
|
|
|
182
|
-
- `@a5c-ai/
|
|
271
|
+
- `@a5c-ai/agent-platform`
|
|
183
272
|
- re-exports the session/tool APIs from `src/harness/index.ts`
|
|
184
273
|
- uses `createAgentCoreSession()` for the direct `agent-core` harness path in `src/harness/invoker.ts`
|
|
185
274
|
- injects `createAgentCoreToolDefinitions()` into plan-process and delegated-task flows in `src/harness/internal/createRun/planProcess/*`
|
|
@@ -189,7 +278,7 @@ Current downstream integration boundaries in this repo:
|
|
|
189
278
|
- `@a5c-ai/babysitter-sdk`
|
|
190
279
|
- provides config defaults/env wiring used by the `config` tool and remains the owner of orchestration/run-state semantics outside this package
|
|
191
280
|
|
|
192
|
-
In practice, use `agent-core` when you need an in-process runtime wrapper or bundled tool surface. Use `
|
|
281
|
+
In practice, use `agent-core` when you need an in-process runtime wrapper or bundled tool surface. Use `agent-platform` when you need the higher-level harness CLI/runtime entrypoints.
|
|
193
282
|
|
|
194
283
|
## Build, test, and CI
|
|
195
284
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Backwards-compatibility shim -- the canonical implementation now lives in
|
|
3
|
+
* `@a5c-ai/agent-runtime`. This re-export keeps internal agent-core consumers
|
|
4
|
+
* working without changes.
|
|
5
|
+
*/
|
|
6
|
+
export { getBackgroundRegistry, disposeBackgroundRegistry, } from "@a5c-ai/agent-runtime";
|
|
5
7
|
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/background/state.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/background/state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBackgroundRegistry =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (!registry) {
|
|
13
|
-
registry = new backgroundProcessRegistry_1.BackgroundProcessRegistry({ maxConcurrent: options.maxBackgroundProcesses });
|
|
14
|
-
scopedRegistries.set(options, registry);
|
|
15
|
-
}
|
|
16
|
-
return registry;
|
|
17
|
-
}
|
|
18
|
-
function disposeBackgroundRegistry(options) {
|
|
19
|
-
const registry = scopedRegistries.get(options);
|
|
20
|
-
if (!registry) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
registry.dispose();
|
|
24
|
-
scopedRegistries.delete(options);
|
|
25
|
-
}
|
|
3
|
+
exports.disposeBackgroundRegistry = exports.getBackgroundRegistry = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Backwards-compatibility shim -- the canonical implementation now lives in
|
|
6
|
+
* `@a5c-ai/agent-runtime`. This re-export keeps internal agent-core consumers
|
|
7
|
+
* working without changes.
|
|
8
|
+
*/
|
|
9
|
+
var agent_runtime_1 = require("@a5c-ai/agent-runtime");
|
|
10
|
+
Object.defineProperty(exports, "getBackgroundRegistry", { enumerable: true, get: function () { return agent_runtime_1.getBackgroundRegistry; } });
|
|
11
|
+
Object.defineProperty(exports, "disposeBackgroundRegistry", { enumerable: true, get: function () { return agent_runtime_1.disposeBackgroundRegistry; } });
|
|
@@ -25,8 +25,8 @@ function createBrowserTool() {
|
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-implied-eval, @typescript-eslint/no-unsafe-assignment
|
|
26
26
|
puppeteer = await new Function("id", "return import(id)")("puppeteer");
|
|
27
27
|
}
|
|
28
|
-
catch {
|
|
29
|
-
return (0, results_1.errorResult)(
|
|
28
|
+
catch (error) {
|
|
29
|
+
return (0, results_1.errorResult)(`puppeteer import failed: ${error instanceof Error ? error.message : String(error)}. Install with: npm install puppeteer`);
|
|
30
30
|
}
|
|
31
31
|
if (!browserInstance) {
|
|
32
32
|
browserInstance = await puppeteer.launch({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
9
|
-
export declare
|
|
1
|
+
export declare const resetRunScopedConfig: () => void;
|
|
2
|
+
export declare const isValidConfigKey: (key: string) => boolean;
|
|
3
|
+
export declare const validateConfigValue: (key: string, value: unknown) => string | null;
|
|
4
|
+
export declare const getConfigValue: (key: string) => unknown;
|
|
5
|
+
export declare const getConfigDefault: (key: string) => unknown;
|
|
6
|
+
export declare const listConfigKeys: () => string[];
|
|
7
|
+
export declare const getRunScopedConfigEntries: () => IterableIterator<[string, unknown]>;
|
|
8
|
+
export declare const setConfigValue: (key: string, value: unknown, scope: string) => void;
|
|
9
|
+
export declare const resetConfigValue: (key?: string) => void;
|
|
10
10
|
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/config/state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/config/state.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,oBAAoB,YAA6B,CAAC;AAC/D,eAAO,MAAM,gBAAgB,0BAAyB,CAAC;AACvD,eAAO,MAAM,mBAAmB,gDAA4B,CAAC;AAC7D,eAAO,MAAM,cAAc,0BAAuB,CAAC;AACnD,eAAO,MAAM,gBAAgB,0BAAyB,CAAC;AACvD,eAAO,MAAM,cAAc,gBAAuB,CAAC;AACnD,eAAO,MAAM,yBAAyB,2CAAkC,CAAC;AACzE,eAAO,MAAM,cAAc,sDAAuB,CAAC;AACnD,eAAO,MAAM,gBAAgB,wBAAyB,CAAC"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resetRunScopedConfig =
|
|
4
|
-
exports.isValidConfigKey = isValidConfigKey;
|
|
5
|
-
exports.validateConfigValue = validateConfigValue;
|
|
6
|
-
exports.getConfigValue = getConfigValue;
|
|
7
|
-
exports.getConfigDefault = getConfigDefault;
|
|
8
|
-
exports.listConfigKeys = listConfigKeys;
|
|
9
|
-
exports.getRunScopedConfigEntries = getRunScopedConfigEntries;
|
|
10
|
-
exports.setConfigValue = setConfigValue;
|
|
11
|
-
exports.resetConfigValue = resetConfigValue;
|
|
3
|
+
exports.resetConfigValue = exports.setConfigValue = exports.getRunScopedConfigEntries = exports.listConfigKeys = exports.getConfigDefault = exports.getConfigValue = exports.validateConfigValue = exports.isValidConfigKey = exports.resetRunScopedConfig = void 0;
|
|
12
4
|
const babysitter_sdk_1 = require("@a5c-ai/babysitter-sdk");
|
|
13
5
|
const EXTENDED_CONFIG_KEYS = new Set([
|
|
14
6
|
"model",
|
|
@@ -16,20 +8,6 @@ const EXTENDED_CONFIG_KEYS = new Set([
|
|
|
16
8
|
"breakpoint.autoApproveAfterN",
|
|
17
9
|
"breakpoint.presentAlwaysApprove",
|
|
18
10
|
]);
|
|
19
|
-
const BABYSITTER_CONFIG_KEYS = new Set([
|
|
20
|
-
"runsDir",
|
|
21
|
-
"maxIterations",
|
|
22
|
-
"qualityThreshold",
|
|
23
|
-
"timeout",
|
|
24
|
-
"logLevel",
|
|
25
|
-
"allowSecretLogs",
|
|
26
|
-
"hookTimeout",
|
|
27
|
-
"nodeTaskTimeout",
|
|
28
|
-
"clockStepMs",
|
|
29
|
-
"clockStartMs",
|
|
30
|
-
"layoutVersion",
|
|
31
|
-
"largeResultPreviewLimit",
|
|
32
|
-
]);
|
|
33
11
|
const CONFIG_KEY_TYPES = {
|
|
34
12
|
runsDir: "string",
|
|
35
13
|
maxIterations: "number",
|
|
@@ -46,82 +24,16 @@ const CONFIG_KEY_TYPES = {
|
|
|
46
24
|
model: "string",
|
|
47
25
|
provider: "string",
|
|
48
26
|
};
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
runScopedConfig.clear();
|
|
63
|
-
}
|
|
64
|
-
function isValidConfigKey(key) {
|
|
65
|
-
return BABYSITTER_CONFIG_KEYS.has(key)
|
|
66
|
-
|| EXTENDED_CONFIG_KEYS.has(key)
|
|
67
|
-
|| key.startsWith("compression.")
|
|
68
|
-
|| key.startsWith("breakpoint.");
|
|
69
|
-
}
|
|
70
|
-
function validateConfigValue(key, value) {
|
|
71
|
-
const expectedType = CONFIG_KEY_TYPES[key];
|
|
72
|
-
if (expectedType && typeof value !== expectedType) {
|
|
73
|
-
return `Expected '${key}' to be ${expectedType}, got ${typeof value}.`;
|
|
74
|
-
}
|
|
75
|
-
if (key === "logLevel" && typeof value === "string" && !VALID_LOG_LEVELS.has(value)) {
|
|
76
|
-
return `Invalid logLevel '${value}'. Must be one of: ${[...VALID_LOG_LEVELS].join(", ")}.`;
|
|
77
|
-
}
|
|
78
|
-
if (expectedType === "number" && typeof value === "number" && key !== "clockStartMs" && value <= 0) {
|
|
79
|
-
return `'${key}' must be a positive number.`;
|
|
80
|
-
}
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
function getConfigValue(key) {
|
|
84
|
-
if (runScopedConfig.has(key)) {
|
|
85
|
-
return runScopedConfig.get(key);
|
|
86
|
-
}
|
|
87
|
-
if (BABYSITTER_CONFIG_KEYS.has(key)) {
|
|
88
|
-
const config = (0, babysitter_sdk_1.getConfig)();
|
|
89
|
-
return config[key];
|
|
90
|
-
}
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
function getConfigDefault(key) {
|
|
94
|
-
if (BABYSITTER_CONFIG_KEYS.has(key)) {
|
|
95
|
-
return babysitter_sdk_1.DEFAULTS[key];
|
|
96
|
-
}
|
|
97
|
-
return undefined;
|
|
98
|
-
}
|
|
99
|
-
function listConfigKeys() {
|
|
100
|
-
return [...new Set([
|
|
101
|
-
...BABYSITTER_CONFIG_KEYS,
|
|
102
|
-
...EXTENDED_CONFIG_KEYS,
|
|
103
|
-
...runScopedConfig.keys(),
|
|
104
|
-
])];
|
|
105
|
-
}
|
|
106
|
-
function getRunScopedConfigEntries() {
|
|
107
|
-
return runScopedConfig.entries();
|
|
108
|
-
}
|
|
109
|
-
function setConfigValue(key, value, scope) {
|
|
110
|
-
if (scope === "global") {
|
|
111
|
-
const envKey = CONFIG_KEY_TO_ENV[key];
|
|
112
|
-
if (envKey) {
|
|
113
|
-
process.env[envKey] = String(value);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
process.env[`BABYSITTER_${key.replace(/\./g, "_").toUpperCase()}`] = String(value);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
runScopedConfig.set(key, value);
|
|
120
|
-
}
|
|
121
|
-
function resetConfigValue(key) {
|
|
122
|
-
if (key) {
|
|
123
|
-
runScopedConfig.delete(key);
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
runScopedConfig.clear();
|
|
127
|
-
}
|
|
27
|
+
const state = (0, babysitter_sdk_1.createScopedRuntimeConfigState)({
|
|
28
|
+
configKeyTypes: CONFIG_KEY_TYPES,
|
|
29
|
+
extendedConfigKeys: EXTENDED_CONFIG_KEYS,
|
|
30
|
+
});
|
|
31
|
+
exports.resetRunScopedConfig = state.resetRunScopedConfig;
|
|
32
|
+
exports.isValidConfigKey = state.isValidConfigKey;
|
|
33
|
+
exports.validateConfigValue = state.validateConfigValue;
|
|
34
|
+
exports.getConfigValue = state.getConfigValue;
|
|
35
|
+
exports.getConfigDefault = state.getConfigDefault;
|
|
36
|
+
exports.listConfigKeys = state.listConfigKeys;
|
|
37
|
+
exports.getRunScopedConfigEntries = state.getRunScopedConfigEntries;
|
|
38
|
+
exports.setConfigValue = state.setConfigValue;
|
|
39
|
+
exports.resetConfigValue = state.resetConfigValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.test.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/config/state.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const state_1 = require("./state");
|
|
5
|
+
(0, vitest_1.describe)("agent-core config state", () => {
|
|
6
|
+
(0, vitest_1.it)("does not write global config scope into process.env", () => {
|
|
7
|
+
const previous = process.env.BABYSITTER_LOG_LEVEL;
|
|
8
|
+
delete process.env.BABYSITTER_LOG_LEVEL;
|
|
9
|
+
try {
|
|
10
|
+
(0, state_1.resetConfigValue)();
|
|
11
|
+
(0, state_1.setConfigValue)("logLevel", "debug", "global");
|
|
12
|
+
(0, vitest_1.expect)(process.env.BABYSITTER_LOG_LEVEL).toBeUndefined();
|
|
13
|
+
(0, vitest_1.expect)((0, state_1.getConfigValue)("logLevel")).toBe("debug");
|
|
14
|
+
}
|
|
15
|
+
finally {
|
|
16
|
+
(0, state_1.resetConfigValue)();
|
|
17
|
+
if (previous === undefined)
|
|
18
|
+
delete process.env.BABYSITTER_LOG_LEVEL;
|
|
19
|
+
else
|
|
20
|
+
process.env.BABYSITTER_LOG_LEVEL = previous;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -19,7 +19,7 @@ function createConfigTool() {
|
|
|
19
19
|
key: typebox_1.Type.Optional(typebox_1.Type.String({ description: "Config key path (dot notation for nested, e.g. 'compression.enabled')" })),
|
|
20
20
|
value: typebox_1.Type.Optional(typebox_1.Type.Unknown({ description: "New value for set action" })),
|
|
21
21
|
scope: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("run"), typebox_1.Type.Literal("global")], {
|
|
22
|
-
description: "Scope: 'run' (default
|
|
22
|
+
description: "Scope: 'run' (default) or 'global' process-scoped config",
|
|
23
23
|
})),
|
|
24
24
|
}),
|
|
25
25
|
execute: (_toolCallId, params) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/discovery/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGzE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,GAAG,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/discovery/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGzE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,GAAG,oBAAoB,EAAE,CA4ExF"}
|
|
@@ -14,9 +14,9 @@ function createDiscoveryTools(options) {
|
|
|
14
14
|
max_results: typebox_1.Type.Optional(typebox_1.Type.Number({ description: "Maximum results to return (default 20)" })),
|
|
15
15
|
}),
|
|
16
16
|
execute: (_toolCallId, params) => {
|
|
17
|
-
const registry = options.deferredToolRegistry;
|
|
17
|
+
const registry = options.toolRegistry ?? options.deferredToolRegistry;
|
|
18
18
|
if (!registry) {
|
|
19
|
-
return (0, results_1.errorResult)("Tool search is not available — no
|
|
19
|
+
return (0, results_1.errorResult)("Tool search is not available — no unified tool registry configured.");
|
|
20
20
|
}
|
|
21
21
|
const query = String(params.query ?? "");
|
|
22
22
|
const maxResults = typeof params.max_results === "number" ? params.max_results : 20;
|
|
@@ -29,6 +29,7 @@ function createDiscoveryTools(options) {
|
|
|
29
29
|
description: tool.description,
|
|
30
30
|
source: tool.source,
|
|
31
31
|
sourceQualifier: tool.sourceQualifier,
|
|
32
|
+
metadata: tool.metadata,
|
|
32
33
|
})),
|
|
33
34
|
});
|
|
34
35
|
},
|
|
@@ -43,9 +44,9 @@ function createDiscoveryTools(options) {
|
|
|
43
44
|
source_qualifier: typebox_1.Type.Optional(typebox_1.Type.String({ description: "Source qualifier (e.g. MCP server name)" })),
|
|
44
45
|
}),
|
|
45
46
|
execute: async (_toolCallId, params) => {
|
|
46
|
-
const registry = options.deferredToolRegistry;
|
|
47
|
+
const registry = options.toolRegistry ?? options.deferredToolRegistry;
|
|
47
48
|
if (!registry) {
|
|
48
|
-
return (0, results_1.errorResult)("Tool fetch is not available — no
|
|
49
|
+
return (0, results_1.errorResult)("Tool fetch is not available — no unified tool registry configured.");
|
|
49
50
|
}
|
|
50
51
|
const toolName = String(params.name ?? "");
|
|
51
52
|
const validSources = new Set(["builtin", "mcp", "plugin", "custom"]);
|
|
@@ -62,6 +63,7 @@ function createDiscoveryTools(options) {
|
|
|
62
63
|
description: resolved.description,
|
|
63
64
|
source: resolved.source,
|
|
64
65
|
sourceQualifier: resolved.sourceQualifier,
|
|
66
|
+
metadata: resolved.metadata,
|
|
65
67
|
inputSchema: resolved.schema.inputSchema,
|
|
66
68
|
outputSchema: resolved.schema.outputSchema,
|
|
67
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agenticTools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agenticTools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAoBxE,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,kBAAkB,GAAG,oBAAoB,EAAE,CAiClG;AAED,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAWzF;AAED,eAAO,MAAM,4BAA4B,uCAAiC,CAAC"}
|
|
@@ -14,9 +14,11 @@ const code_1 = require("./tools/code");
|
|
|
14
14
|
const delegation_1 = require("./tools/delegation");
|
|
15
15
|
const execution_1 = require("./tools/execution");
|
|
16
16
|
const fileSystem_1 = require("./tools/fileSystem");
|
|
17
|
+
const programmaticToolCalling_1 = require("./tools/programmaticToolCalling");
|
|
17
18
|
const toolDefinitionScopes = new WeakMap();
|
|
19
|
+
const toolDefinitionOwners = new WeakMap();
|
|
18
20
|
function createAgentCoreToolDefinitions(options) {
|
|
19
|
-
const
|
|
21
|
+
const baseTools = [
|
|
20
22
|
...(0, fileSystem_1.createFileSystemTools)(options),
|
|
21
23
|
...(0, execution_1.createExecutionTools)(options),
|
|
22
24
|
(0, tool_1.createBrowserTool)(),
|
|
@@ -27,15 +29,35 @@ function createAgentCoreToolDefinitions(options) {
|
|
|
27
29
|
...(0, tools_2.createDiscoveryTools)(options),
|
|
28
30
|
...(0, tools_3.createWebTools)(),
|
|
29
31
|
].map((tool) => (0, results_1.wrapToolDefinition)(tool, options.onToolUse));
|
|
32
|
+
options.toolRegistry?.registerAll?.(baseTools.map((tool) => ({
|
|
33
|
+
name: tool.name,
|
|
34
|
+
description: tool.description,
|
|
35
|
+
parameters: tool.parameters,
|
|
36
|
+
source: "builtin",
|
|
37
|
+
metadata: tool.metadata,
|
|
38
|
+
})));
|
|
39
|
+
const tools = (0, programmaticToolCalling_1.shouldEnableProgrammaticToolCalling)(options)
|
|
40
|
+
? [
|
|
41
|
+
...baseTools,
|
|
42
|
+
(0, results_1.wrapToolDefinition)((0, programmaticToolCalling_1.createProgrammaticToolCallingTool)(options, baseTools), options.onToolUse),
|
|
43
|
+
]
|
|
44
|
+
: baseTools;
|
|
30
45
|
toolDefinitionScopes.set(tools, options);
|
|
46
|
+
for (const tool of tools) {
|
|
47
|
+
toolDefinitionOwners.set(tool, options);
|
|
48
|
+
}
|
|
31
49
|
return tools;
|
|
32
50
|
}
|
|
33
51
|
function disposeAgentCoreToolDefinitions(definitions) {
|
|
34
|
-
const options = toolDefinitionScopes.get(definitions)
|
|
52
|
+
const options = toolDefinitionScopes.get(definitions)
|
|
53
|
+
?? definitions.map((definition) => toolDefinitionOwners.get(definition)).find(Boolean);
|
|
35
54
|
if (!options) {
|
|
36
55
|
return;
|
|
37
56
|
}
|
|
38
57
|
(0, state_1.disposeBackgroundRegistry)(options);
|
|
39
58
|
toolDefinitionScopes.delete(definitions);
|
|
59
|
+
for (const definition of definitions) {
|
|
60
|
+
toolDefinitionOwners.delete(definition);
|
|
61
|
+
}
|
|
40
62
|
}
|
|
41
63
|
exports.createAgenticToolDefinitions = createAgentCoreToolDefinitions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/shared/paths.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAU7E;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIvE;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2BnD;AAED,wBAAgB,OAAO,CACrB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,OAAO,EACtB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAAE,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/shared/paths.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAU7E;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIvE;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2BnD;AAED,wBAAgB,OAAO,CACrB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,OAAO,EACtB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAAE,GAChB,IAAI,CA4BN"}
|
|
@@ -93,7 +93,8 @@ function walkDir(directory, includeHidden, limit, results) {
|
|
|
93
93
|
try {
|
|
94
94
|
entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
95
95
|
}
|
|
96
|
-
catch {
|
|
96
|
+
catch (e) {
|
|
97
|
+
process.stderr.write(`[agent-core] walkDir: cannot read ${directory}: ${e instanceof Error ? e.message : String(e)}\n`);
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
100
|
for (const entry of entries) {
|
|
@@ -2,11 +2,19 @@ export declare const DEFAULT_BASH_TIMEOUT = 120000;
|
|
|
2
2
|
export declare const DEFAULT_SEARCH_TIMEOUT = 30000;
|
|
3
3
|
export declare const MAX_READ_LINES = 10000;
|
|
4
4
|
export declare function getRgPath(): string;
|
|
5
|
+
export declare function resolveShellCommand(env?: NodeJS.ProcessEnv): {
|
|
6
|
+
shell: string;
|
|
7
|
+
argsFor(command: string): string[];
|
|
8
|
+
};
|
|
5
9
|
export declare function spawnAsync(command: string, args: string[], options: {
|
|
6
10
|
cwd?: string;
|
|
7
11
|
env?: Record<string, string>;
|
|
8
12
|
timeout?: number;
|
|
9
13
|
shell?: boolean;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
maxOutputBytes?: number;
|
|
16
|
+
onStdout?: (chunk: string) => void | Promise<void>;
|
|
17
|
+
onStderr?: (chunk: string) => void | Promise<void>;
|
|
10
18
|
}): Promise<{
|
|
11
19
|
stdout: string;
|
|
12
20
|
stderr: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/shared/process.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,SAAU,CAAC;AAC5C,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,cAAc,QAAS,CAAC;AAKrC,wBAAgB,SAAS,IAAI,MAAM,CAgBlC;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IACP,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../src/agenticTools/shared/process.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,SAAU,CAAC;AAC5C,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,cAAc,QAAS,CAAC;AAKrC,wBAAgB,SAAS,IAAI,MAAM,CAgBlC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACpC,CAaA;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IACP,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD,GACA,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAsE/D"}
|