stitchkit 0.119.0 → 0.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/README.md +10 -7
- package/dist/agent-runtime/coding-discovery.d.ts +25 -0
- package/dist/agent-runtime/coding-discovery.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-automaton.d.ts +37 -0
- package/dist/agent-runtime/coding-search-automaton.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-case-fold.d.ts +4 -0
- package/dist/agent-runtime/coding-search-case-fold.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-class-ranges.d.ts +10 -0
- package/dist/agent-runtime/coding-search-class-ranges.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-contract.d.ts +86 -0
- package/dist/agent-runtime/coding-search-contract.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-limits.d.ts +13 -0
- package/dist/agent-runtime/coding-search-limits.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-matcher.d.ts +33 -0
- package/dist/agent-runtime/coding-search-matcher.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-output.d.ts +5 -0
- package/dist/agent-runtime/coding-search-output.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-regex-syntax.d.ts +39 -0
- package/dist/agent-runtime/coding-search-regex-syntax.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-unit-classes.d.ts +31 -0
- package/dist/agent-runtime/coding-search-unit-classes.d.ts.map +1 -0
- package/dist/agent-runtime/coding-shell-process.d.ts +1 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +8 -3
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-files.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts +1 -11
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-paths.d.ts +6 -2
- package/dist/agent-runtime/coding-tool-paths.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-refusals.d.ts +6 -0
- package/dist/agent-runtime/coding-tool-refusals.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search.d.ts +113 -0
- package/dist/agent-runtime/coding-tool-search.d.ts.map +1 -0
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/contained-scan-budget.d.ts +32 -0
- package/dist/agent-runtime/contained-scan-budget.d.ts.map +1 -0
- package/dist/agent-runtime/contained-scan-contract.d.ts +52 -0
- package/dist/agent-runtime/contained-scan-contract.d.ts.map +1 -0
- package/dist/agent-runtime/contained-scan.d.ts +48 -13
- package/dist/agent-runtime/contained-scan.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox.d.ts +5 -1
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/workspace-glob.d.ts +6 -0
- package/dist/agent-runtime/workspace-glob.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +7 -7
- package/dist/entrypoints/agent-runtime/harness.js +5 -5
- package/dist/entrypoints/agent-runtime/realtime.js +3 -3
- package/dist/entrypoints/agent-runtime/sandbox.js +8 -8
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +9 -9
- package/dist/entrypoints/agent-runtime/sqlite/node.js +9 -9
- package/dist/entrypoints/agent-runtime/testing.js +9 -9
- package/dist/entrypoints/agent-runtime.js +16 -14
- package/dist/entrypoints/application/diagnostic-journal.js +3 -3
- package/dist/entrypoints/application/directory-inbox.js +5 -5
- package/dist/entrypoints/application.js +6 -6
- package/dist/entrypoints/cli/publish.js +5 -5
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/contract.js +4 -4
- package/dist/entrypoints/files.js +4 -4
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +2 -2
- package/dist/entrypoints/node.js +1 -1
- package/dist/entrypoints/process/owner-loss.js +2 -1
- package/dist/entrypoints/process.js +4 -4
- package/dist/entrypoints/remote.js +1 -1
- package/dist/entrypoints/server.js +12 -12
- package/dist/entrypoints/telegram/screens.js +5 -5
- package/dist/entrypoints/telegram.js +8 -8
- package/dist/entrypoints/testing.js +2 -2
- package/dist/entrypoints/tools/agent.d.ts +9 -0
- package/dist/entrypoints/tools/agent.d.ts.map +1 -0
- package/dist/entrypoints/tools/agent.js +16 -0
- package/dist/entrypoints/tools/connections.js +4 -4
- package/dist/entrypoints/tools/mcp.js +104 -4
- package/dist/entrypoints/tools/toolkit.d.ts +9 -0
- package/dist/entrypoints/tools/toolkit.d.ts.map +1 -0
- package/dist/entrypoints/tools/toolkit.js +40 -0
- package/dist/entrypoints/tools.d.ts +0 -10
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +25 -69
- package/dist/{index-s0qjs6ee.js → index-0fra8xvy.js} +9 -81
- package/dist/{index-rxcgp4b9.js → index-10rg78vf.js} +1 -1
- package/dist/index-1psbyyhj.js +21 -0
- package/dist/index-3prvb42w.js +30 -0
- package/dist/{index-ba7are04.js → index-4tyt1qya.js} +1 -1
- package/dist/index-568w258r.js +76 -0
- package/dist/{index-fqd4yqwd.js → index-6j15ktag.js} +1 -1
- package/dist/{index-zrdcmg6j.js → index-72xtvcvr.js} +40 -6
- package/dist/{index-6a69xzrx.js → index-7zwtbak8.js} +5 -46
- package/dist/{index-fcqj44mb.js → index-8ryydawp.js} +4 -4
- package/dist/{index-q968hy6y.js → index-aqmadanx.js} +2 -2
- package/dist/{index-s20s2mad.js → index-bgcwxhxh.js} +16 -14
- package/dist/index-bph35vpy.js +77 -0
- package/dist/{index-arjmb6de.js → index-eeahxwvg.js} +60 -76
- package/dist/{index-57gqaq8b.js → index-f6pw75e1.js} +1 -1
- package/dist/{index-f4njz9j0.js → index-gq3fnq3f.js} +1 -1
- package/dist/{index-ynrf908v.js → index-gtx3eknx.js} +1 -1
- package/dist/index-h1j71dr1.js +48 -0
- package/dist/{index-nn9qvkww.js → index-j95jp7ee.js} +45 -9
- package/dist/{index-mgb7r8b8.js → index-jswst0h3.js} +1 -1
- package/dist/{index-bbvc59gw.js → index-knmnj11j.js} +9 -180
- package/dist/{index-2kbysk9s.js → index-m5m9rmvt.js} +2 -0
- package/dist/{index-g444vfz2.js → index-nwm3ww60.js} +1 -1
- package/dist/{index-yk4g8805.js → index-pq7rkwkk.js} +1 -30
- package/dist/index-qaqxdbxf.js +2857 -0
- package/dist/{index-x8d9fdeg.js → index-qctbzmg9.js} +8 -4
- package/dist/index-s9a0fjh3.js +305 -0
- package/dist/index-sb9dr3tq.js +14 -0
- package/dist/{index-tvtacc9a.js → index-zyc64nbh.js} +1 -34
- package/dist/internal/contained-directory.d.ts +1 -1
- package/dist/internal/contained-directory.d.ts.map +1 -1
- package/dist/internal/contained-files.d.ts +18 -51
- package/dist/internal/contained-files.d.ts.map +1 -1
- package/dist/internal/contained-read.d.ts +17 -0
- package/dist/internal/contained-read.d.ts.map +1 -0
- package/dist/internal/darwin-binding.d.ts +3 -1
- package/dist/internal/darwin-binding.d.ts.map +1 -1
- package/dist/process/bun-child.d.ts.map +1 -1
- package/dist/process/command-owner.d.ts.map +1 -1
- package/dist/process/group.d.ts +2 -0
- package/dist/process/group.d.ts.map +1 -1
- package/dist/process/launch.d.ts +1 -0
- package/dist/process/launch.d.ts.map +1 -1
- package/dist/process/owned-child.d.ts.map +1 -1
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/process/owner-loss-protocol.d.ts +1 -0
- package/dist/process/owner-loss-protocol.d.ts.map +1 -1
- package/llms/agent-runtime-coding-tools.txt +9 -9
- package/llms/agent-runtime-harness.txt +4 -3
- package/llms/agent-runtime-sandbox.txt +1 -1
- package/llms/agent-runtime.2.txt +20 -2
- package/llms/agent-runtime.3.txt +4 -46
- package/llms/agent-runtime.4.txt +113 -0
- package/llms/agent-runtime.txt +70 -37
- package/llms/application.3.txt +5 -2
- package/llms/cli.txt +1 -1
- package/llms/contract.txt +1 -1
- package/llms/process.txt +3 -1
- package/llms/server.5.txt +2 -0
- package/llms/stitchkit.txt +15 -9
- package/llms/testing.txt +4 -6
- package/llms/tools-agent.txt +24 -0
- package/llms/tools-mcp.txt +71 -6
- package/llms/tools-toolkit.txt +23 -0
- package/llms/tools.2.txt +6 -3
- package/llms/tools.3.txt +8 -77
- package/llms/tools.txt +8 -8
- package/llms/{upgrading-0.106.0-0.119.0.txt → upgrading-0.106.0-0.121.0.txt} +84 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +360 -139
- package/llms.txt +11 -9
- package/native/darwin-arm64.node +0 -0
- package/native/darwin-x64.node +0 -0
- package/native-assets.json +4 -4
- package/package.json +10 -2
- package/dist/index-1k18qzqa.js +0 -1478
- package/dist/index-6f49krb5.js +0 -107
- package/dist/{index-2dfvv1jg.js → index-2fc1k9k2.js} +0 -0
- package/dist/{index-qndsr7f0.js → index-5efrpfmj.js} +3 -3
- /package/dist/{index-cyxp8rbf.js → index-mtwh9hyp.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,74 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.121.0] - 2026-11-09
|
|
19
|
+
|
|
20
|
+
### ⚠️ Breaking changes
|
|
21
|
+
|
|
22
|
+
**Who must act:** hosts that build a complete `AgentCodingToolLimits` value, read exact `list_directory`, `glob` or `search_files` outputs, rely on a symlink `run_command` cwd or on `glob` returning no paths for a missing `path`, or send search regexes with named backreferences or counted repetition above 1,000. A host mounting the coding tools with partial limits and ordinary queries changes nothing. See the [migration](docs/guide/upgrading.md#bounded-coding-search).
|
|
23
|
+
|
|
24
|
+
- `stitchkit/agent-runtime/coding-tools` — **search reports its coverage and bounds traversal before reading.**
|
|
25
|
+
`search_files` prunes incompatible glob branches before authorization/open, streams matches,
|
|
26
|
+
honors cancellation and bounds directory opens, entries, total content bytes, elapsed time and
|
|
27
|
+
the entire serialized result. `coverage` distinguishes a complete empty result from denied,
|
|
28
|
+
unreadable, cancelled or limited work. Directory errors carry a relative path, operation and code.
|
|
29
|
+
Regex searches keep JavaScript syntax, modifiers and Annex B forms. A line whose backtracking
|
|
30
|
+
work, with repetition capped at the line's length, stays within 2^24 steps runs natively; any
|
|
31
|
+
other line runs on a cached linear automaton that observes the deadline inside the line (ten to
|
|
32
|
+
forty times slower than native matching, with no catastrophic case). Named backreferences,
|
|
33
|
+
counted repetition above 1,000 and, for patterns that need the automaton, more than 16,384 automaton states,
|
|
34
|
+
65,536 construction steps or 4,194,304 overlapping character-set memberships now refuse beside numbered backreferences and
|
|
35
|
+
lookaround; an invalid pattern's refusal carries the engine's reason.
|
|
36
|
+
Before: `{ query: '(?<w>a)\\k<w>', regex: true }` → after: `{ query: '(a)a', regex: true }`.
|
|
37
|
+
A `glob` path or `run_command` cwd that is missing, a file or a symlink refuses with
|
|
38
|
+
`NOT_FOUND`/`BAD_REQUEST` and a hint, as `list_directory` does; a missing `glob` path used to
|
|
39
|
+
return no paths.
|
|
40
|
+
Hosts constructing a full
|
|
41
|
+
`AgentCodingToolLimits` value add the five search ceilings; partial `limits` use finite defaults.
|
|
42
|
+
[ADR 0285](docs/decisions/0285-search-bounds-the-work-before-reading.md),
|
|
43
|
+
[migration](docs/guide/upgrading.md#bounded-coding-search).
|
|
44
|
+
List and glob use the same budgets and coverage, including bounded canonical spelling checks;
|
|
45
|
+
list raw enumeration respects maxListEntries and glob patterns have a 4,096-unit ceiling.
|
|
46
|
+
Every filesystem tool pins root before either policy; an ordinary command enters its pinned
|
|
47
|
+
cwd through the descriptor's `/proc` link on Linux and through an isolated fchdir guard on
|
|
48
|
+
macOS. Symlink cwd descendants refuse; custom sandbox launchers own cwd capture.
|
|
49
|
+
**Affects:** `stitchkit/agent-runtime/coding-tools` createAgentCodingTools, AgentCodingToolLimitsSchema, AgentCodingToolLimits, behaviour
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- `stitchkit/process` — **`timeoutMs` counts from the moment the command started.** A guarded
|
|
54
|
+
command (`ownerLoss: 'terminate'`) starts its guard first; that start, tens of milliseconds, used
|
|
55
|
+
the command's own budget, so a short budget timed out a command that never got to run. The
|
|
56
|
+
guard's start is now bounded by `timeoutMs` or 5 seconds, whichever is longer.
|
|
57
|
+
**Affects:** `stitchkit/process` behaviour
|
|
58
|
+
- API reference export tables are checked against each actual entrypoint in both directions.
|
|
59
|
+
|
|
60
|
+
## [0.120.0] - 2026-11-05
|
|
61
|
+
|
|
62
|
+
### ⚠️ Breaking changes
|
|
63
|
+
|
|
64
|
+
**Who must act:** code importing the MCP server, `mountAgent` or `createToolkit` from `stitchkit/tools`. Code that imports only the registry, tool names, runtime and native tools, the invoker, the OAuth provider or the durability engine from `stitchkit/tools` changes nothing. See the [migration](docs/guide/upgrading.md#tools-barrel-subpaths).
|
|
65
|
+
|
|
66
|
+
- `stitchkit/tools` — **the tools barrel loads no optional peer; MCP, the agent mount and the toolkit have their own subpaths.**
|
|
67
|
+
An application serving its operations over HTTP and CLI could not import `listToolNames` without
|
|
68
|
+
installing `@modelcontextprotocol/server` and `ai`: the barrel re-exported the MCP server factories,
|
|
69
|
+
`mountAgent` and `createToolkit`, and ESM resolution of the entry needed both optional peers. Import
|
|
70
|
+
the MCP server — `createMcpHandler`, `createMcpHttpRoute`, `buildMcpServer`, `mountMcp`,
|
|
71
|
+
`mountMcpResource`, `validateMcpSchemas`, `createStdioMcpServer`, `bindStdioProcessSignals`, the
|
|
72
|
+
catalog stamp and MCP Apps helpers and their config types — from `stitchkit/tools/mcp`, which already
|
|
73
|
+
exported them; `mountAgent`, `AgentMountConfig` and `AgentContext` from the new
|
|
74
|
+
`stitchkit/tools/agent` (the `ai` peer); `createToolkit` and `Toolkit` from the new
|
|
75
|
+
`stitchkit/tools/toolkit` (both peers). A build check walks the built `stitchkit/tools` graph and fails
|
|
76
|
+
on any optional peer import. `// before: import { createMcpHandler, mountAgent } from 'stitchkit/tools'`
|
|
77
|
+
→ `// after: import { createMcpHandler } from 'stitchkit/tools/mcp'; import { mountAgent } from 'stitchkit/tools/agent'`.
|
|
78
|
+
[ADR 0284](docs/decisions/0284-the-tools-barrel-loads-no-optional-peer.md);
|
|
79
|
+
[migration](docs/guide/upgrading.md#tools-barrel-subpaths).
|
|
80
|
+
**Affects:** `stitchkit/tools` createMcpHandler, createMcpHttpRoute, buildMcpServer, mountMcp, mountMcpResource, validateMcpSchemas, createStdioMcpServer, bindStdioProcessSignals, inlineMcpAppBundle, mcpCatalogMeta, readMcpCatalogStamp, EXT_APPS_BUNDLE_PLACEHOLDER, MCP_CATALOG_META_KEY, RESOURCE_MIME_TYPE, McpServer, McpHandlerConfig, McpHttpConfig, McpHttpHandler, McpHttpSecurityConfig, McpLegacyPolicy, McpMountConfig, McpServerBuildConfig, McpServerSharedConfig, DirectMcpSurfaceConfig, FiniteMcpSurfaceConfig, McpSurfaceDefinition, McpSurfaceRegistry, McpSchemaValidationConfig, ValidateMcpSchemasConfig, IncompatibleSchemaPolicy, McpStdioHandle, StdioMcpServerConfig, StdioAuthConfig, StdioCloseTarget, StdioProcessSignalsOptions, StdioProcessSignalsBinding, StdioProcessSignalsErrorPhase, McpCatalogStamp, McpResourceDef, McpAppResourceMeta, McpAppCsp, mountAgent, AgentMountConfig, AgentContext, createToolkit, Toolkit
|
|
81
|
+
|
|
82
|
+
### Added
|
|
83
|
+
|
|
84
|
+
- `stitchkit/tools/agent` — `mountAgent` with only Zod and the `ai` peer; `stitchkit/tools/toolkit` — `createToolkit`, the one subpath that needs both the MCP server SDK and `ai`. Both start evolving.
|
|
85
|
+
|
|
18
86
|
## [0.119.0] - 2026-11-04
|
|
19
87
|
|
|
20
88
|
### ⚠️ Breaking changes
|
package/README.md
CHANGED
|
@@ -86,7 +86,8 @@ Server code imports server entrypoints:
|
|
|
86
86
|
```ts
|
|
87
87
|
import { createServer, createHandler, implement } from 'stitchkit/server'
|
|
88
88
|
import { createSocketIOServer, createAuthHook } from 'stitchkit/server'
|
|
89
|
-
import { createMcpHandler
|
|
89
|
+
import { createMcpHandler } from 'stitchkit/tools/mcp'
|
|
90
|
+
import { mountAgent } from 'stitchkit/tools/agent'
|
|
90
91
|
import { createAgentRuntime, defineAgentProtocol } from 'stitchkit/agent-runtime'
|
|
91
92
|
import { createBunSqliteAgentRuntimeStore } from 'stitchkit/agent-runtime/sqlite/bun'
|
|
92
93
|
import { createApplication, defineManagedResource } from 'stitchkit/application'
|
|
@@ -115,7 +116,9 @@ Credential-free replay, scripted provider failures and deterministic race
|
|
|
115
116
|
controls live in `stitchkit/agent-runtime/testing` for Bun and Node tests.
|
|
116
117
|
The separately installed `stitchkit-tui` package adds a maintained Bun/OpenTUI host over those
|
|
117
118
|
headless contracts; its `stitchkit-tui/core` entrypoint exposes renderer-neutral terminal state
|
|
118
|
-
without React, OpenTUI or agent-runtime imports
|
|
119
|
+
without React, OpenTUI or agent-runtime imports, and `stitchkit-tui/widgets` builds any terminal
|
|
120
|
+
application on it — tables, pickers, forms, charts, meters, dialogs — with no agent runtime
|
|
121
|
+
(`bunx stitchkit-tui-gallery` shows them all). Neither enters the core dependency graph.
|
|
119
122
|
|
|
120
123
|
## Managed application kernel
|
|
121
124
|
|
|
@@ -249,7 +252,7 @@ size is the server's call — the contract's `limit` default — never the clien
|
|
|
249
252
|
### 5. MCP tools (for Claude, Cursor, etc.)
|
|
250
253
|
|
|
251
254
|
```ts
|
|
252
|
-
import { createMcpHandler, createMcpHttpRoute } from 'stitchkit/tools'
|
|
255
|
+
import { createMcpHandler, createMcpHttpRoute } from 'stitchkit/tools/mcp'
|
|
253
256
|
|
|
254
257
|
const mcp = createMcpHandler({
|
|
255
258
|
serverInfo: { name: 'my-app', version: '1.0.0' },
|
|
@@ -268,7 +271,7 @@ createServer({
|
|
|
268
271
|
### 6. AI Agent tools
|
|
269
272
|
|
|
270
273
|
```ts
|
|
271
|
-
import { mountAgent } from 'stitchkit/tools'
|
|
274
|
+
import { mountAgent } from 'stitchkit/tools/agent'
|
|
272
275
|
import { generateText } from 'ai'
|
|
273
276
|
|
|
274
277
|
const tools = mountAgent(service, { context: { userId: 'agent-1' } })
|
|
@@ -437,14 +440,14 @@ peer — an install pulls in only what the project actually uses.
|
|
|
437
440
|
|------------|------|--------------|
|
|
438
441
|
| `ky` | bundled, runtime | The HTTP client behind the typed client — ~13 KB, `fetch`-based, with retry, hooks and timeouts built in. The only thing stitchkit installs for you. |
|
|
439
442
|
| `zod` | peer, **required** | Schemas are the single source of truth. A peer so your app and stitchkit share **one** `zod` instance — `z.infer` types and `instanceof` checks break across two copies. |
|
|
440
|
-
| `@modelcontextprotocol/server` | peer, optional | MCP server surfaces in `stitchkit/tools`; SDK v2, protocol `2026-07-28`. |
|
|
443
|
+
| `@modelcontextprotocol/server` | peer, optional | MCP server surfaces in `stitchkit/tools/mcp` and `stitchkit/tools/toolkit`; SDK v2, protocol `2026-07-28`. |
|
|
441
444
|
| `@modelcontextprotocol/client` | development dependency, optional | Only consumers that run MCP client integration tests or build an MCP host. |
|
|
442
445
|
| `@modelcontextprotocol/ext-apps` | peer, optional | Only MCP Apps (`ui://` resources and UI metadata). |
|
|
443
|
-
| `ai` | peer, optional | `stitchkit/tools`
|
|
446
|
+
| `ai` | peer, optional | agent tools in `stitchkit/tools/agent` and `stitchkit/tools/toolkit`, and the optional server-only `stitchkit/agent-runtime`. |
|
|
444
447
|
| Headless harness | optional surface | `stitchkit/agent-runtime/harness`; uses the same optional `ai` peer and canonical runtime. |
|
|
445
448
|
| Agent coding tools | optional surface | `stitchkit/agent-runtime/coding-tools`; peer-free, host-authorized direct file and shell tools. |
|
|
446
449
|
| Agent runtime testing | optional test surface | `stitchkit/agent-runtime/testing`; peer-free local fault server, replay and race fixtures. |
|
|
447
|
-
| `stitchkit-tui` | separate optional package | Renderer-neutral `./core` state plus a Bun/OpenTUI terminal controller, commands, model/session pickers and authenticated local attachment over a caller-composed harness. |
|
|
450
|
+
| `stitchkit-tui` | separate optional package | Renderer-neutral `./core` state, `./widgets` for terminal applications, plus a Bun/OpenTUI terminal controller, commands, model/session pickers and authenticated local attachment over a caller-composed harness. |
|
|
448
451
|
| `@openrouter/ai-sdk-provider` | peer, optional | Only `stitchkit/agent-runtime/openrouter`; neutral runtime imports do not resolve it. |
|
|
449
452
|
| SQLite | runtime built-in, optional | `bun:sqlite` through `stitchkit/agent-runtime/sqlite/bun`, or `node:sqlite` on Node ≥ 22.5 through the Node leaf. |
|
|
450
453
|
| `grammy` | peer, optional | Only `stitchkit/application/grammy` at run time, and the declarations of `stitchkit/telegram/screens` and `stitchkit/telegram/grammy`; the neutral application kernel does not resolve it. |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ContainedFileHandle } from '../internal/contained-handle.js';
|
|
2
|
+
import type { AgentCodingToolConfig, AgentCodingToolLimits } from './coding-tool-contract.js';
|
|
3
|
+
import { ContainedScanBudget } from './contained-scan-budget.js';
|
|
4
|
+
export declare function discoveryRun(config: AgentCodingToolConfig, limits: AgentCodingToolLimits, path: string, include: string, symlinks: 'skip' | 'list'): {
|
|
5
|
+
budget: ContainedScanBudget;
|
|
6
|
+
coverage: {
|
|
7
|
+
complete: boolean;
|
|
8
|
+
reasons: ("cancelled" | "denied" | "max-bytes" | "max-depth" | "max-directories" | "max-entries" | "max-file-bytes" | "max-files" | "max-line-bytes" | "max-output-bytes" | "max-results" | "timeout" | "unreadable")[];
|
|
9
|
+
scope: {
|
|
10
|
+
path: string;
|
|
11
|
+
include: string;
|
|
12
|
+
excludedDirectories: "configured" | "default";
|
|
13
|
+
symlinks: "list" | "skip";
|
|
14
|
+
};
|
|
15
|
+
visitedDirectories: number;
|
|
16
|
+
visitedEntries: number;
|
|
17
|
+
readBytes: number;
|
|
18
|
+
elapsedMs: number;
|
|
19
|
+
};
|
|
20
|
+
run(caller: AbortSignal | undefined, work: (root: ContainedFileHandle) => Promise<void>): Promise<void>;
|
|
21
|
+
refresh(): void;
|
|
22
|
+
};
|
|
23
|
+
/** Admission precedes retention; names cannot multiply the serialized output limit. */
|
|
24
|
+
export declare function discoveryCollector(output: unknown, budget: ContainedScanBudget, maximum: number): (item: unknown) => void;
|
|
25
|
+
//# sourceMappingURL=coding-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-discovery.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-discovery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE3F,OAAO,EAAE,mBAAmB,EAAe,MAAM,yBAAyB,CAAC;AAG3E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,qBAAqB,EAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GAAG,MAAM;;;;;;;;;;;;;;;;gBA2Bb,WAAW,GAAG,SAAS,QACzB,CAAC,IAAI,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC;;EAyCvD;AAED,uFAAuF;AACvF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,MAAM,UAQD,OAAO,UAMtB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type RegexAssertion, type RegexNode, type UnitAtom } from './coding-search-regex-syntax.js';
|
|
2
|
+
/** Unrolled counted repetition and alternation stay below this many automaton states. */
|
|
3
|
+
export declare const MAX_REGEX_STATES = 16384;
|
|
4
|
+
type State = {
|
|
5
|
+
kind: 'unit';
|
|
6
|
+
atom: UnitAtom;
|
|
7
|
+
next: number;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'split';
|
|
10
|
+
next: number[];
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'assert';
|
|
13
|
+
at: RegexAssertion;
|
|
14
|
+
next: number;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'accept';
|
|
17
|
+
};
|
|
18
|
+
export declare function buildAutomaton(tree: RegexNode, check: () => void): {
|
|
19
|
+
states: State[];
|
|
20
|
+
start: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A compiled search expression. Matching walks the line once; each step is a cached
|
|
24
|
+
* transition of the lazily built deterministic automaton, keyed by the unit's class. A cache
|
|
25
|
+
* miss costs the state's own units plus the start atoms matching that class, so a line costs at
|
|
26
|
+
* most states × UTF-16 units, the cache stays within its state and transition ceilings, and
|
|
27
|
+
* every step can observe the caller's deadline.
|
|
28
|
+
*/
|
|
29
|
+
export interface SearchRegex {
|
|
30
|
+
test(text: string): boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function lazyMatcher({ states, start }: {
|
|
33
|
+
states: State[];
|
|
34
|
+
start: number;
|
|
35
|
+
}, check: () => void): SearchRegex;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=coding-search-automaton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-automaton.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-automaton.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,QAAQ,EAEd,MAAM,8BAA8B,CAAC;AAGtC,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,QAAS,CAAC;AAOvC,KAAK,KAAK,GACN;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,MAAM,IAAI,GAChB;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CA6CpC;AAuBD;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAwBD,wBAAgB,WAAW,CACzB,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACrD,KAAK,EAAE,MAAM,IAAI,GAChB,WAAW,CAiLb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-case-fold.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-case-fold.ts"],"names":[],"mappings":"AAiCA,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAGnD;AAKD,wBAAgB,UAAU,IAAI,SAAS,MAAM,EAAE,CAG9C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact unit ranges of a bracket class without the `u` flag, including escapes inside it, so
|
|
3
|
+
* the automaton partitions the alphabet instead of asking the engine per unit. Every result is
|
|
4
|
+
* checked against the engine at each range boundary and midpoint; any doubt leaves the class to
|
|
5
|
+
* the engine.
|
|
6
|
+
*/
|
|
7
|
+
export type UnitRanges = [number, number][];
|
|
8
|
+
/** The exact ranges of a bracket class, or undefined when only the engine can answer. */
|
|
9
|
+
export declare function classRanges(source: string, ignoreCase?: boolean): UnitRanges | undefined;
|
|
10
|
+
//# sourceMappingURL=coding-search-class-ranges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-class-ranges.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-class-ranges.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;AA4I5C,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,UAAQ,GAAG,UAAU,GAAG,SAAS,CAiBtF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SearchInputSchema: z.ZodObject<{
|
|
3
|
+
query: z.ZodString;
|
|
4
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
5
|
+
content: "content";
|
|
6
|
+
path: "path";
|
|
7
|
+
}>>;
|
|
8
|
+
regex: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
context: z.ZodDefault<z.ZodInt>;
|
|
10
|
+
include: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type SearchInput = z.infer<typeof SearchInputSchema>;
|
|
13
|
+
export declare const SearchMatchSchema: z.ZodObject<{
|
|
14
|
+
path: z.ZodString;
|
|
15
|
+
line: z.ZodOptional<z.ZodInt>;
|
|
16
|
+
text: z.ZodOptional<z.ZodString>;
|
|
17
|
+
before: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
after: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
export type SearchMatch = z.infer<typeof SearchMatchSchema>;
|
|
21
|
+
export declare const SearchOutputSchema: z.ZodObject<{
|
|
22
|
+
matches: z.ZodArray<z.ZodObject<{
|
|
23
|
+
path: z.ZodString;
|
|
24
|
+
line: z.ZodOptional<z.ZodInt>;
|
|
25
|
+
text: z.ZodOptional<z.ZodString>;
|
|
26
|
+
before: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
after: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
truncated: z.ZodBoolean;
|
|
30
|
+
scannedFiles: z.ZodInt;
|
|
31
|
+
skippedDirectories: z.ZodInt;
|
|
32
|
+
skippedSymlinks: z.ZodInt;
|
|
33
|
+
denied: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
34
|
+
path: z.ZodString;
|
|
35
|
+
kind: z.ZodEnum<{
|
|
36
|
+
directory: "directory";
|
|
37
|
+
file: "file";
|
|
38
|
+
other: "other";
|
|
39
|
+
symlink: "symlink";
|
|
40
|
+
}>;
|
|
41
|
+
}, z.core.$strict>>>;
|
|
42
|
+
deniedTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
path: z.ZodString;
|
|
45
|
+
operation: z.ZodString;
|
|
46
|
+
code: z.ZodString;
|
|
47
|
+
}, z.core.$strict>>>;
|
|
48
|
+
errorsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
50
|
+
coverage: z.ZodObject<{
|
|
51
|
+
complete: z.ZodBoolean;
|
|
52
|
+
reasons: z.ZodArray<z.ZodEnum<{
|
|
53
|
+
cancelled: "cancelled";
|
|
54
|
+
denied: "denied";
|
|
55
|
+
"max-bytes": "max-bytes";
|
|
56
|
+
"max-depth": "max-depth";
|
|
57
|
+
"max-directories": "max-directories";
|
|
58
|
+
"max-entries": "max-entries";
|
|
59
|
+
"max-file-bytes": "max-file-bytes";
|
|
60
|
+
"max-files": "max-files";
|
|
61
|
+
"max-line-bytes": "max-line-bytes";
|
|
62
|
+
"max-output-bytes": "max-output-bytes";
|
|
63
|
+
"max-results": "max-results";
|
|
64
|
+
timeout: "timeout";
|
|
65
|
+
unreadable: "unreadable";
|
|
66
|
+
}>>;
|
|
67
|
+
scope: z.ZodObject<{
|
|
68
|
+
path: z.ZodString;
|
|
69
|
+
include: z.ZodString;
|
|
70
|
+
excludedDirectories: z.ZodEnum<{
|
|
71
|
+
configured: "configured";
|
|
72
|
+
default: "default";
|
|
73
|
+
}>;
|
|
74
|
+
symlinks: z.ZodEnum<{
|
|
75
|
+
list: "list";
|
|
76
|
+
skip: "skip";
|
|
77
|
+
}>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
visitedDirectories: z.ZodInt;
|
|
80
|
+
visitedEntries: z.ZodInt;
|
|
81
|
+
readBytes: z.ZodInt;
|
|
82
|
+
elapsedMs: z.ZodNumber;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
export type SearchOutput = z.infer<typeof SearchOutputSchema>;
|
|
86
|
+
//# sourceMappingURL=coding-search-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-contract.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;;;;;;;;kBAoBnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,iBAAiB;;;;;;kBAQnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqBpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AgentCodingSearchLimitsSchema: z.ZodObject<{
|
|
3
|
+
maxSearchResults: z.ZodInt;
|
|
4
|
+
maxSearchFiles: z.ZodInt;
|
|
5
|
+
maxSearchDepth: z.ZodInt;
|
|
6
|
+
maxSearchDirectories: z.ZodInt;
|
|
7
|
+
maxSearchEntries: z.ZodInt;
|
|
8
|
+
maxSearchBytes: z.ZodInt;
|
|
9
|
+
maxSearchOutputBytes: z.ZodInt;
|
|
10
|
+
searchTimeoutMs: z.ZodInt;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type AgentCodingSearchLimits = z.infer<typeof AgentCodingSearchLimitsSchema>;
|
|
13
|
+
//# sourceMappingURL=coding-search-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-limits.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-limits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,6BAA6B;;;;;;;;;kBAW/B,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type SearchRegex } from './coding-search-automaton.js';
|
|
2
|
+
import { type RegexNode } from './coding-search-regex-syntax.js';
|
|
3
|
+
/**
|
|
4
|
+
* Backtracking steps one native match of one line may spend. The engine itself stops after
|
|
5
|
+
* 100,000,000 counted operations per call and then answers no match, and one step of this model
|
|
6
|
+
* costs it about two; 2^24 keeps a threefold margin below that limit, so a native line never ends
|
|
7
|
+
* in a silent false. Native matching cannot be interrupted, so this also bounds the deadline's
|
|
8
|
+
* overshoot to one such line.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MAX_NATIVE_LINE_WORK: number;
|
|
11
|
+
/**
|
|
12
|
+
* The backtracking work per start position of a line of at most `units` units: each start
|
|
13
|
+
* walks each path through the alternatives once, so paths × the longest path bounds it. On such
|
|
14
|
+
* a line no repetition iterates more than `units` times beyond the iterations it requires (and
|
|
15
|
+
* a body that cannot match empty cannot even reach those), so `x{m,M}`, `x*` and `x+` are their
|
|
16
|
+
* unrolled forms with the bounds capped there: p^m × (1 + p + … + p^(M−m)) paths and M × the
|
|
17
|
+
* body's length.
|
|
18
|
+
*/
|
|
19
|
+
export declare function backtrackingWork(node: RegexNode, units: number): {
|
|
20
|
+
paths: number;
|
|
21
|
+
length: number;
|
|
22
|
+
};
|
|
23
|
+
/** The linear automaton alone, for any accepted pattern. */
|
|
24
|
+
export declare function compileLinearSearchRegex(pattern: string, check: () => void): SearchRegex;
|
|
25
|
+
/**
|
|
26
|
+
* JavaScript `RegExp` syntax without flags with bounded cost per line. A line whose bounded
|
|
27
|
+
* backtracking work — per start position × its length, repetition capped at its length — stays
|
|
28
|
+
* within `MAX_NATIVE_LINE_WORK` runs on the native engine itself; the deadline is observed
|
|
29
|
+
* between lines. Any other line runs on the linear automaton, because a deadline cannot
|
|
30
|
+
* interrupt one native match. The work is measured per power-of-two line length, once.
|
|
31
|
+
*/
|
|
32
|
+
export declare function compileSearchRegex(pattern: string, check: () => void): SearchRegex;
|
|
33
|
+
//# sourceMappingURL=coding-search-matcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-matcher.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-matcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,8BAA8B,CAAC;AAGtC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAU,CAAC;AAkC5C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,MAAM,GACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAmDnC;AAyCD,4DAA4D;AAC5D,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,WAAW,CAOxF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,WAAW,CAqClF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SearchOutput } from './coding-search-contract.js';
|
|
2
|
+
import { type ContainedScanBudget } from './contained-scan-budget.js';
|
|
3
|
+
/** Matches are admitted while streaming; diagnostics get the remaining serialized byte budget. */
|
|
4
|
+
export declare function boundSearchDiagnostics(output: Pick<SearchOutput, 'denied' | 'errors' | 'deniedTruncated' | 'errorsTruncated'>, budget: ContainedScanBudget, maxBytes: number): void;
|
|
5
|
+
//# sourceMappingURL=coding-search-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-output.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,KAAK,mBAAmB,EAAe,MAAM,yBAAyB,CAAC;AAEhF,kGAAkG;AAClG,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,QAAQ,GAAG,iBAAiB,GAAG,iBAAiB,CAAC,EACvF,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,GACf,IAAI,CA4CN"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type RegexAssertion = 'start' | 'end' | 'line-start' | 'line-end' | 'word' | 'not-word';
|
|
2
|
+
/**
|
|
3
|
+
* One single-unit atom. `ranges` is the exact inclusive set when the atom is a literal or a
|
|
4
|
+
* bracket class of plain characters and ranges; every other atom answers through `matches`, a
|
|
5
|
+
* native one-character expression. Equal atoms are one object, so `key` identifies it.
|
|
6
|
+
*/
|
|
7
|
+
export interface UnitAtom {
|
|
8
|
+
key: string;
|
|
9
|
+
ranges?: readonly (readonly [number, number])[];
|
|
10
|
+
matches(unit: number): boolean;
|
|
11
|
+
}
|
|
12
|
+
export type RegexNode = {
|
|
13
|
+
kind: 'empty';
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'unit';
|
|
16
|
+
atom: UnitAtom;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'assert';
|
|
19
|
+
at: RegexAssertion;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'sequence';
|
|
22
|
+
items: RegexNode[];
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'alternation';
|
|
25
|
+
options: RegexNode[];
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'repeat';
|
|
28
|
+
body: RegexNode;
|
|
29
|
+
min: number;
|
|
30
|
+
max: number;
|
|
31
|
+
};
|
|
32
|
+
/** Thrown with the construct a host-facing refusal names. */
|
|
33
|
+
export declare class UnsupportedRegexSyntax extends Error {
|
|
34
|
+
}
|
|
35
|
+
/** Counted repetition is unrolled; a larger bound is refused before it can allocate. */
|
|
36
|
+
export declare const MAX_REGEX_REPEAT = 1000;
|
|
37
|
+
/** Parses a pattern the native engine has already accepted without flags. */
|
|
38
|
+
export declare function parseSearchRegex(pattern: string, check: () => void): RegexNode;
|
|
39
|
+
//# sourceMappingURL=coding-search-regex-syntax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-regex-syntax.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-regex-syntax.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,KAAK,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/F;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAChD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAChC;AAED,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,cAAc,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,SAAS,EAAE,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,6DAA6D;AAC7D,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AAEpD,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,OAAQ,CAAC;AA4BtC,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,SAAS,CAqL9E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type UnitAtom } from './coding-search-regex-syntax.js';
|
|
2
|
+
/** What a position's assertions can observe about a neighbouring unit. */
|
|
3
|
+
export declare const Ahead: {
|
|
4
|
+
End: number;
|
|
5
|
+
Word: number;
|
|
6
|
+
LineTerminator: number;
|
|
7
|
+
Other: number;
|
|
8
|
+
};
|
|
9
|
+
export type Ahead = (typeof Ahead)[keyof typeof Ahead];
|
|
10
|
+
export declare const classify: (unit: number) => Ahead;
|
|
11
|
+
/** Atom memberships the range partition may hold, summed over its segments. */
|
|
12
|
+
export declare const MAX_RANGE_MEMBERSHIPS: number;
|
|
13
|
+
/**
|
|
14
|
+
* Atoms the engine must answer per unit: only classes whose ranges the engine check sent back,
|
|
15
|
+
* since literals, escapes, classes and dot all carry ranges. Their work is this × 65,536 units.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MAX_NATIVE_ATOMS = 64;
|
|
18
|
+
/**
|
|
19
|
+
* UTF-16 units the automaton cannot tell apart share one class: the same range segment, the
|
|
20
|
+
* same answers from every native atom and the same kind for word and line assertions.
|
|
21
|
+
* Transitions are keyed by class, so a text over a large alphabet caches as few transitions as
|
|
22
|
+
* the pattern distinguishes. Classes are at most the 65,536 units, each with a fixed-size bit
|
|
23
|
+
* set over the native atoms, so the table needs no eviction.
|
|
24
|
+
*/
|
|
25
|
+
export declare function unitClasses(atoms: UnitAtom[], check: () => void): {
|
|
26
|
+
classOf: (unit: number) => number;
|
|
27
|
+
kindOf: (unitClass: number) => Ahead;
|
|
28
|
+
atomsOf: (unitClass: number) => readonly UnitAtom[];
|
|
29
|
+
matches: (atom: UnitAtom, unitClass: number) => boolean;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=coding-search-unit-classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-search-unit-classes.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-search-unit-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAA0B,MAAM,8BAA8B,CAAC;AAErF,0EAA0E;AAC1E,eAAO,MAAM,KAAK;;;;;CAGjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;AASvD,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,KACiD,CAAC;AAE1F,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,QAAU,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;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"coding-shell-process.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-shell-process.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,qBAAqB,EAAqB,MAAM,wBAAwB,CAAC;AAEvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAuCrD,wBAAsB,cAAc,CAAC,KAAK,EAAE;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC/C,aAAa,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,KAAK,CAAC,EAAE,MAAM,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CACrE;;;;;;;;;;;;;;;GA4JA"}
|
|
@@ -2,6 +2,14 @@ import { z } from 'zod';
|
|
|
2
2
|
import type { ToolTransport } from '../contract/define.js';
|
|
3
3
|
import type { AgentProcessSandbox, AgentSandboxRestriction } from './sandbox.js';
|
|
4
4
|
export declare const AgentCodingToolLimitsSchema: z.ZodObject<{
|
|
5
|
+
maxSearchResults: z.ZodInt;
|
|
6
|
+
maxSearchFiles: z.ZodInt;
|
|
7
|
+
maxSearchDepth: z.ZodInt;
|
|
8
|
+
maxSearchDirectories: z.ZodInt;
|
|
9
|
+
maxSearchEntries: z.ZodInt;
|
|
10
|
+
maxSearchBytes: z.ZodInt;
|
|
11
|
+
maxSearchOutputBytes: z.ZodInt;
|
|
12
|
+
searchTimeoutMs: z.ZodInt;
|
|
5
13
|
maxPathBytes: z.ZodInt;
|
|
6
14
|
maxReadBytes: z.ZodInt;
|
|
7
15
|
maxWriteBytes: z.ZodInt;
|
|
@@ -10,9 +18,6 @@ export declare const AgentCodingToolLimitsSchema: z.ZodObject<{
|
|
|
10
18
|
maxShellOutputBytes: z.ZodInt;
|
|
11
19
|
maxArtifactBytes: z.ZodInt;
|
|
12
20
|
maxListEntries: z.ZodInt;
|
|
13
|
-
maxSearchResults: z.ZodInt;
|
|
14
|
-
maxSearchFiles: z.ZodInt;
|
|
15
|
-
maxSearchDepth: z.ZodInt;
|
|
16
21
|
shellTimeoutMs: z.ZodInt;
|
|
17
22
|
shellTerminationGraceMs: z.ZodInt;
|
|
18
23
|
}, z.core.$strict>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-tool-contract.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"coding-tool-contract.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;kBAc7B,CAAC;A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AE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;KAC9D,CAAC;IACF,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACtC,OAAO,CAAC,OAAO,EAAE;QACf,MAAM,EAAE,SAAS,CAAC;QAClB,KAAK,EAAE,OAAO,CAAC;QACf,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,mBAAmB;;;;kBAMrB,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;;;;kBAStB,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;kBAMtB,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;;;kBAcvB,CAAC;AAEZ,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE;;;;;;mBAWxE;AAED,eAAO,MAAM,gBAAgB;;;;kBAMlB,CAAC;AAEZ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;kBAoBnB,CAAC;AAuBZ,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,GAChD,qBAAqB,CAEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-tool-files.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coding-tool-files.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-files.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAK3B,MAAM,wBAAwB,CAAC;AAoDhC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,qBAAqB,GAC5B,SAAS,yBAAyB,EAAE,CAyKtC"}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import type { AgentCodingToolConfig, AgentCodingToolDefinition, AgentCodingToolLimits } from './coding-tool-contract.js';
|
|
2
|
-
/** The same set
|
|
2
|
+
/** The same set search_files skips. List shows these directories explicitly. */
|
|
3
3
|
export declare const DEFAULT_EXCLUDED_DIRECTORIES: string[];
|
|
4
|
-
/**
|
|
5
|
-
* Compile one workspace glob into a regular expression.
|
|
6
|
-
*
|
|
7
|
-
* A deliberate subset — `**`, `*`, `?`, and nothing else — written here rather
|
|
8
|
-
* than taken as a dependency: the whole surface has one runtime dependency, and
|
|
9
|
-
* a matcher this size does not earn a second. Everything outside the subset is
|
|
10
|
-
* escaped, so a pattern containing regex punctuation matches it literally
|
|
11
|
-
* instead of meaning something the caller did not write.
|
|
12
|
-
*/
|
|
13
|
-
export declare function compileWorkspaceGlob(pattern: string): RegExp;
|
|
14
4
|
export declare function createListingCodingTools(config: AgentCodingToolConfig, limits: AgentCodingToolLimits): readonly AgentCodingToolDefinition[];
|
|
15
5
|
//# sourceMappingURL=coding-tool-listing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-tool-listing.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-listing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coding-tool-listing.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-listing.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAahC,gFAAgF;AAChF,eAAO,MAAM,4BAA4B,UAQxC,CAAC;AA0CF,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,qBAAqB,GAC5B,SAAS,yBAAyB,EAAE,CAgMtC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ContainedFileHandle } from '../internal/contained-handle.js';
|
|
1
2
|
import { type AgentCodingToolAuthorization, type AgentCodingToolConfig } from './coding-tool-contract.js';
|
|
3
|
+
import type { ContainedScanBudget } from './contained-scan-budget.js';
|
|
2
4
|
export declare function boundedCodingRelativePath(root: string, requested: string, maxPathBytes: number): string;
|
|
3
5
|
export declare function existingCodingPath(root: string, requested: string, maxPathBytes: number): Promise<{
|
|
4
6
|
absolute: string;
|
|
@@ -42,8 +44,10 @@ export declare function authorizeCodingPath(config: AgentCodingToolConfig, path:
|
|
|
42
44
|
* and a policy that keeps an audit no longer sees the leaf once an ancestor has
|
|
43
45
|
* refused.
|
|
44
46
|
*/
|
|
45
|
-
export declare function authorizeCodingPathChain(config: AgentCodingToolConfig, relative: string): Promise<void>;
|
|
47
|
+
export declare function authorizeCodingPathChain(config: AgentCodingToolConfig, relative: string, root: ContainedFileHandle, budget?: ContainedScanBudget): Promise<void>;
|
|
46
48
|
/** Serialize framework-owned compare-and-replace transactions for one canonical target. */
|
|
47
|
-
export declare function withCodingPathLock<T>(
|
|
49
|
+
export declare function withCodingPathLock<T>(root: ContainedFileHandle, relative: string, work: () => Promise<T>): Promise<T>;
|
|
48
50
|
export declare function textOccurrences(source: string, search: string): number;
|
|
51
|
+
/** Select the workspace capability before any asynchronous host policy runs. */
|
|
52
|
+
export declare function withCodingRoot<T>(configured: string, work: (root: ContainedFileHandle, canonicalPath: string) => Promise<T>): Promise<T>;
|
|
49
53
|
//# sourceMappingURL=coding-tool-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-tool-paths.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-paths.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,4BAA4B,EAEjC,KAAK,qBAAqB,EAE3B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"coding-tool-paths.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-paths.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,EACL,KAAK,4BAA4B,EAEjC,KAAK,qBAAqB,EAE3B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAuCnE,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,MAAM,CA6CR;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM;;;GAKrB;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM;;;GAarB;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM;;;GAQrB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,qBAAqB,EAC7B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAIlB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,qBAAqB,EAC7B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,qBAAqB,EAC7B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,mBAAmB,EACzB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAgCf;AAID,2FAA2F;AAC3F,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,IAAI,EAAE,mBAAmB,EACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAUtE;AAED,gFAAgF;AAChF,wBAAsB,cAAc,CAAC,CAAC,EACpC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,CAAC,IAAI,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GACrE,OAAO,CAAC,CAAC,CAAC,CAQZ"}
|
|
@@ -61,6 +61,12 @@ export declare function codingPathRefusal(code: CodingRefusalCode, message: stri
|
|
|
61
61
|
* model can do about it, and keeps being scrubbed. Default-deny by omission.
|
|
62
62
|
*/
|
|
63
63
|
export declare function refuseMissingCodingPath(error: unknown, relative: string): never;
|
|
64
|
+
/**
|
|
65
|
+
* A directory argument (`list_directory` and `glob` paths, `run_command` cwd) that cannot be
|
|
66
|
+
* opened as a directory. Directory capabilities never follow a symlink, so a symlink alias is
|
|
67
|
+
* refused the same way as a file, and the model is told to name the real directory.
|
|
68
|
+
*/
|
|
69
|
+
export declare function refuseUnopenableCodingDirectory(error: unknown, relative: string): never;
|
|
64
70
|
/**
|
|
65
71
|
* The write failures a caller can act on: something else occupies the path. A
|
|
66
72
|
* lost race and a stale check end here too, so each has one answer however it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-tool-refusals.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-refusals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH;;;;;;;;;;GAUG;AACH,QAAA,MAAM,aAAa,0IAQ4B,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAClF,KAAK,CAUP;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACjE,KAAK,CAKP;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAmC/E;AAgBD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACpC,KAAK,CAkCP;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CASpE"}
|
|
1
|
+
{"version":3,"file":"coding-tool-refusals.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-refusals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH;;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