@arnilo/prism-tools 0.0.0-stage → 0.13.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 +410 -0
- package/LICENSE +21 -0
- package/README.md +44 -2
- package/browser/README.md +98 -0
- package/browser/skills/browser-automation/SKILL.md +14 -0
- package/browser/src/actions/cdp.ts +131 -0
- package/browser/src/actions/dialog.ts +25 -0
- package/browser/src/actions/download_release.ts +22 -0
- package/browser/src/actions/index.ts +37 -0
- package/browser/src/actions/locator.ts +70 -0
- package/browser/src/actions/navigate.ts +23 -0
- package/browser/src/actions/screenshot.ts +27 -0
- package/browser/src/actions/scroll.ts +24 -0
- package/browser/src/actions/select_page.ts +21 -0
- package/browser/src/actions/types.ts +114 -0
- package/browser/src/actions/upload.ts +44 -0
- package/browser/src/actions/wait.ts +45 -0
- package/browser/src/browser.ts +197 -0
- package/browser/src/cdp.ts +178 -0
- package/browser/src/checkpoint.ts +189 -0
- package/browser/src/config.ts +72 -0
- package/browser/src/downloads.ts +253 -0
- package/browser/src/errors.ts +31 -0
- package/browser/src/evaluate.ts +101 -0
- package/browser/src/index.ts +129 -0
- package/browser/src/limits.ts +271 -0
- package/browser/src/manager.ts +730 -0
- package/browser/src/network.ts +263 -0
- package/browser/src/observe.ts +178 -0
- package/browser/src/policy.ts +133 -0
- package/browser/src/screenshot.ts +107 -0
- package/browser/src/shared-sandbox.ts +53 -0
- package/browser/src/snapshot.ts +99 -0
- package/browser/src/targets.ts +165 -0
- package/browser/src/tools.ts +480 -0
- package/browser/src/types.ts +316 -0
- package/browser/src/uploads.ts +174 -0
- package/coding/README.md +337 -0
- package/coding/src/agent/acp-operations.ts +146 -0
- package/coding/src/agent/artifacts.ts +38 -0
- package/coding/src/agent/ask-user-decision.ts +623 -0
- package/coding/src/agent/atomic-write.ts +23 -0
- package/coding/src/agent/bounded-file.ts +21 -0
- package/coding/src/agent/checks.ts +301 -0
- package/coding/src/agent/coding-checkpoint.ts +828 -0
- package/coding/src/agent/delete.ts +237 -0
- package/coding/src/agent/diagnostics-tool.ts +163 -0
- package/coding/src/agent/diagnostics.ts +262 -0
- package/coding/src/agent/edit-diff.ts +382 -0
- package/coding/src/agent/edit.ts +322 -0
- package/coding/src/agent/effects.ts +102 -0
- package/coding/src/agent/env.ts +28 -0
- package/coding/src/agent/execution-policy.ts +89 -0
- package/coding/src/agent/file-mutation-queue.ts +72 -0
- package/coding/src/agent/forge/github.ts +603 -0
- package/coding/src/agent/forge/index.ts +16 -0
- package/coding/src/agent/forge/types.ts +185 -0
- package/coding/src/agent/git-aware-repository.ts +305 -0
- package/coding/src/agent/git-exec.ts +326 -0
- package/coding/src/agent/git-status.ts +177 -0
- package/coding/src/agent/git-tools.ts +360 -0
- package/coding/src/agent/git.ts +1074 -0
- package/coding/src/agent/glob-match.ts +146 -0
- package/coding/src/agent/glob.ts +182 -0
- package/coding/src/agent/goal-verify.ts +385 -0
- package/coding/src/agent/grep-worker.ts +74 -0
- package/coding/src/agent/grep.ts +459 -0
- package/coding/src/agent/identity.ts +48 -0
- package/coding/src/agent/index.ts +676 -0
- package/coding/src/agent/language/client.ts +429 -0
- package/coding/src/agent/language/framing.ts +190 -0
- package/coding/src/agent/language/index.ts +23 -0
- package/coding/src/agent/language/intelligence.ts +682 -0
- package/coding/src/agent/language/types.ts +187 -0
- package/coding/src/agent/lifecycle-events.ts +121 -0
- package/coding/src/agent/lifecycle.ts +166 -0
- package/coding/src/agent/limits.ts +214 -0
- package/coding/src/agent/move.ts +178 -0
- package/coding/src/agent/mutation-path.ts +52 -0
- package/coding/src/agent/output-accumulator.ts +304 -0
- package/coding/src/agent/path-utils.ts +120 -0
- package/coding/src/agent/process/index.ts +58 -0
- package/coding/src/agent/process/recovery.ts +508 -0
- package/coding/src/agent/process/sessions-host.ts +222 -0
- package/coding/src/agent/process/sessions-monitor.ts +141 -0
- package/coding/src/agent/process/sessions-recovery.ts +241 -0
- package/coding/src/agent/process/sessions-spawn.ts +613 -0
- package/coding/src/agent/process/sessions-teardown.ts +281 -0
- package/coding/src/agent/process/sessions.ts +30 -0
- package/coding/src/agent/process/types.ts +358 -0
- package/coding/src/agent/read-path-set.ts +126 -0
- package/coding/src/agent/read.ts +713 -0
- package/coding/src/agent/repository/glob.ts +147 -0
- package/coding/src/agent/repository/indexed-search.ts +480 -0
- package/coding/src/agent/repository/list.ts +131 -0
- package/coding/src/agent/repository/operations.ts +22 -0
- package/coding/src/agent/repository/path.ts +98 -0
- package/coding/src/agent/repository/search.ts +277 -0
- package/coding/src/agent/repository/types.ts +243 -0
- package/coding/src/agent/repository/walk.ts +126 -0
- package/coding/src/agent/repository.ts +12 -0
- package/coding/src/agent/shell-background.ts +264 -0
- package/coding/src/agent/shell-output.ts +75 -0
- package/coding/src/agent/shell.ts +526 -0
- package/coding/src/agent/todo.ts +399 -0
- package/coding/src/agent/truncate.ts +251 -0
- package/coding/src/agent/write.ts +170 -0
- package/coding/src/ask-user-host.ts +48 -0
- package/coding/src/config.ts +278 -0
- package/coding/src/hard-deny.ts +97 -0
- package/coding/src/index.ts +318 -0
- package/coding/src/principal-guard.ts +84 -0
- package/coding/src/sandbox.ts +92 -0
- package/coding/src/security/approval.ts +144 -0
- package/coding/src/security/command-rules.ts +57 -0
- package/coding/src/security/docker-cli.ts +222 -0
- package/coding/src/security/docker-sandbox.ts +1205 -0
- package/coding/src/security/e2b-sandbox.ts +853 -0
- package/coding/src/security/egress/dns-pin.ts +88 -0
- package/coding/src/security/egress/index.ts +32 -0
- package/coding/src/security/egress/limits.ts +57 -0
- package/coding/src/security/egress/policy.ts +137 -0
- package/coding/src/security/egress/proxy.ts +599 -0
- package/coding/src/security/egress/types.ts +30 -0
- package/coding/src/security/index.ts +199 -0
- package/coding/src/security/native-sandbox.ts +639 -0
- package/coding/src/security/path-containment.ts +55 -0
- package/coding/src/security/sandbox-coding-operations.ts +392 -0
- package/coding/src/security/sandbox-fs-operations.ts +644 -0
- package/coding/src/security/sandbox-limits.ts +147 -0
- package/coding/src/security/sandbox-tar.ts +308 -0
- package/coding/src/security/sandbox.ts +179 -0
- package/coding/src/security/semaphore.ts +55 -0
- package/coding/src/targets.ts +110 -0
- package/coding/src/workspace/diff.ts +78 -0
- package/coding/src/workspace/errors.ts +28 -0
- package/coding/src/workspace/index.ts +5 -0
- package/coding/src/workspace/merge.ts +151 -0
- package/coding/src/workspace/routing.ts +76 -0
- package/coding/src/workspace/service.ts +545 -0
- package/computer-use/README.md +105 -0
- package/computer-use/skills/computer-use-linux/SKILL.md +17 -0
- package/computer-use/src/classify.ts +53 -0
- package/computer-use/src/command.ts +29 -0
- package/computer-use/src/config.ts +69 -0
- package/computer-use/src/create.ts +170 -0
- package/computer-use/src/devices.ts +247 -0
- package/computer-use/src/env.ts +28 -0
- package/computer-use/src/index.ts +157 -0
- package/computer-use/src/skill.ts +21 -0
- package/openapi/README.md +97 -0
- package/openapi/src/compile.ts +386 -0
- package/openapi/src/config.ts +73 -0
- package/openapi/src/errors.ts +16 -0
- package/openapi/src/execute.ts +241 -0
- package/openapi/src/index.ts +124 -0
- package/openapi/src/limits.ts +63 -0
- package/openapi/src/specs.ts +86 -0
- package/openapi/src/tools.ts +60 -0
- package/openapi/src/types.ts +61 -0
- package/package.json +171 -4
- package/research/README.md +72 -0
- package/research/skills/research-report/SKILL.md +12 -0
- package/research/skills/research-scoping/SKILL.md +10 -0
- package/research/skills/research-synthesis/SKILL.md +10 -0
- package/research/skills/source-triage/SKILL.md +10 -0
- package/research/src/check.ts +71 -0
- package/research/src/config.ts +41 -0
- package/research/src/index.ts +147 -0
- package/research/src/ledger.ts +157 -0
- package/research/src/urls.ts +21 -0
- package/web/README.md +287 -0
- package/web/skills/web-research/SKILL.md +17 -0
- package/web/src/brave.ts +66 -0
- package/web/src/cache.ts +151 -0
- package/web/src/config.ts +210 -0
- package/web/src/controls.ts +128 -0
- package/web/src/domains.ts +114 -0
- package/web/src/exa.ts +60 -0
- package/web/src/firecrawl.ts +160 -0
- package/web/src/index.ts +387 -0
- package/web/src/kagi.ts +73 -0
- package/web/src/limits.ts +55 -0
- package/web/src/native/convert.ts +84 -0
- package/web/src/native/fetch.ts +226 -0
- package/web/src/normalize.ts +131 -0
- package/web/src/obscura/cdp.ts +201 -0
- package/web/src/obscura/classify.ts +35 -0
- package/web/src/obscura/cli.ts +254 -0
- package/web/src/obscura/errors.ts +8 -0
- package/web/src/obscura/index.ts +59 -0
- package/web/src/obscura/limits.ts +92 -0
- package/web/src/obscura/mcp.ts +104 -0
- package/web/src/obscura/playwright.ts +133 -0
- package/web/src/obscura/process.ts +235 -0
- package/web/src/obscura/search-profile.ts +73 -0
- package/web/src/obscura/types.ts +48 -0
- package/web/src/obscura/web.ts +419 -0
- package/web/src/prompt-fetch.ts +88 -0
- package/web/src/render.ts +75 -0
- package/web/src/searxng.ts +78 -0
- package/web/src/slice.ts +139 -0
- package/web/src/tavily.ts +77 -0
- package/web/src/tools.ts +182 -0
- package/web/src/transport.ts +310 -0
- package/web/src/types.ts +199 -0
- package/work/README.md +77 -0
- package/work/THIRD_PARTY_NOTICES +24 -0
- package/work/docling/ocr.py +150 -0
- package/work/sandbox/Dockerfile +36 -0
- package/work/sandbox/soffice.sh +12 -0
- package/work/src/command.ts +29 -0
- package/work/src/config.ts +138 -0
- package/work/src/connectors/cli.ts +343 -0
- package/work/src/connectors/drafts.ts +647 -0
- package/work/src/connectors/errors.ts +8 -0
- package/work/src/connectors/file-bytes.ts +149 -0
- package/work/src/connectors/google-workspace-http.ts +399 -0
- package/work/src/connectors/google-workspace.ts +465 -0
- package/work/src/connectors/gws-tools.ts +378 -0
- package/work/src/connectors/http.ts +123 -0
- package/work/src/connectors/idempotency.ts +235 -0
- package/work/src/connectors/identity.ts +34 -0
- package/work/src/connectors/index.ts +93 -0
- package/work/src/connectors/limits.ts +50 -0
- package/work/src/connectors/m365-tools.ts +308 -0
- package/work/src/connectors/microsoft365-http.ts +428 -0
- package/work/src/connectors/microsoft365.ts +402 -0
- package/work/src/connectors/normalize.ts +120 -0
- package/work/src/connectors/tool-helpers.ts +398 -0
- package/work/src/connectors/tools.ts +42 -0
- package/work/src/connectors/types.ts +399 -0
- package/work/src/diagrams/canonicalize.ts +166 -0
- package/work/src/diagrams/caps.ts +52 -0
- package/work/src/diagrams/embed.ts +340 -0
- package/work/src/diagrams/errors.ts +76 -0
- package/work/src/diagrams/index.ts +81 -0
- package/work/src/diagrams/messages.ts +150 -0
- package/work/src/diagrams/origin.ts +52 -0
- package/work/src/diagrams/telemetry.ts +34 -0
- package/work/src/diagrams/xml.ts +267 -0
- package/work/src/document-extraction/index.ts +563 -0
- package/work/src/document-reader/ambient.d.ts +2 -0
- package/work/src/document-reader/errors.ts +7 -0
- package/work/src/document-reader/index.ts +181 -0
- package/work/src/document-reader/mistral-ocr.ts +318 -0
- package/work/src/document-reader/parsers.ts +171 -0
- package/work/src/documents/caps.ts +135 -0
- package/work/src/documents/diff.ts +269 -0
- package/work/src/documents/errors.ts +44 -0
- package/work/src/documents/fidelity.ts +98 -0
- package/work/src/documents/generate.ts +96 -0
- package/work/src/documents/hash.ts +8 -0
- package/work/src/documents/index.ts +14 -0
- package/work/src/documents/model-schema.ts +639 -0
- package/work/src/documents/parse.ts +252 -0
- package/work/src/documents/patch-history.ts +81 -0
- package/work/src/documents/patch.ts +476 -0
- package/work/src/documents/preview-html.ts +245 -0
- package/work/src/documents/preview.ts +227 -0
- package/work/src/documents/telemetry.ts +36 -0
- package/work/src/documents/translate/docx.ts +292 -0
- package/work/src/documents/translate/pptx.ts +304 -0
- package/work/src/documents/translate/xlsx.ts +137 -0
- package/work/src/documents/types.ts +188 -0
- package/work/src/index.ts +311 -0
- package/work/src/runtime/worker-pool-entry.ts +102 -0
- package/work/src/runtime/worker-pool.ts +267 -0
- package/work/src/sandbox/composition.ts +212 -0
- package/work/src/sandbox/image.ts +6 -0
- package/work/src/sandbox/index.ts +14 -0
- package/work/src/sheets/caps.ts +68 -0
- package/work/src/sheets/csv.ts +351 -0
- package/work/src/sheets/decimal.ts +388 -0
- package/work/src/sheets/errors.ts +52 -0
- package/work/src/sheets/index.ts +62 -0
- package/work/src/sheets/inference.ts +378 -0
- package/work/src/sheets/telemetry.ts +34 -0
- package/work/src/sheets/types.ts +162 -0
- package/work/src/sheets/xlsx.ts +388 -0
- package/work/src/skills/index.ts +8 -0
- package/work/src/skills/load.ts +43 -0
- package/work/src/tools/filesystem.ts +21 -0
- package/work/src/tools/index.ts +1 -0
- package/work/src/tools/local-filesystem.ts +33 -0
- package/work/src/tools/office.ts +311 -0
- package/work/vendor/hermes-agent/LICENSE +21 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/LICENSE +21 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/SKILL.md +196 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/scripts/docx_comments.py +289 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/scripts/docx_common.py +94 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/scripts/docx_create.py +177 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/scripts/docx_edit.py +250 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/scripts/docx_read.py +149 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/scripts/docx_revisions.py +147 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/scripts/docx_template.py +70 -0
- package/work/vendor/hermes-agent/skills/productivity/docx/scripts/docx_validate.py +156 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/LICENSE +21 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/SKILL.md +125 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/_raster.py +76 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/extract_marker.py +88 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/extract_pymupdf.py +101 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_create.py +130 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_fill_form.py +97 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_form_layout.py +168 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_make_form.py +145 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_merge.py +50 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_meta.py +115 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_page_image.py +99 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_read.py +153 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_secure.py +71 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_split.py +84 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_stamp.py +143 -0
- package/work/vendor/hermes-agent/skills/productivity/pdf/scripts/pdf_watermark.py +51 -0
- package/work/vendor/hermes-agent/skills/productivity/powerpoint/LICENSE +21 -0
- package/work/vendor/hermes-agent/skills/productivity/powerpoint/SKILL.md +220 -0
- package/work/vendor/hermes-agent/skills/productivity/powerpoint/scripts/pptx_create.py +214 -0
- package/work/vendor/hermes-agent/skills/productivity/powerpoint/scripts/pptx_edit.py +436 -0
- package/work/vendor/hermes-agent/skills/productivity/powerpoint/scripts/pptx_from_template.py +88 -0
- package/work/vendor/hermes-agent/skills/productivity/powerpoint/scripts/pptx_read.py +131 -0
- package/work/vendor/hermes-agent/skills/productivity/powerpoint/scripts/pptx_render.py +93 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/LICENSE +21 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/SKILL.md +196 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/scripts/csv_to_xlsx.py +104 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/scripts/xlsx_create.py +259 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/scripts/xlsx_edit.py +263 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/scripts/xlsx_read.py +160 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/scripts/xlsx_recalc.py +111 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/scripts/xlsx_restructure.py +337 -0
- package/work/vendor/hermes-agent/skills/productivity/xlsx/scripts/xlsx_to_csv.py +69 -0
- package/work/vendor-lock.json +11 -0
|
@@ -0,0 +1,676 @@
|
|
|
1
|
+
// @arnilo/prism-tools/coding public barrel.
|
|
2
|
+
//
|
|
3
|
+
// First-party coding tools for the Prism agent harness. Factory functions return Prism
|
|
4
|
+
// `ToolDefinition`s that hosts register into a `ToolRegistry` (e.g.
|
|
5
|
+
// `createToolRegistry(createCodingTools(cwd))`). No tools are auto-registered — import what you need.
|
|
6
|
+
|
|
7
|
+
// --- per-tool factories & types ---
|
|
8
|
+
|
|
9
|
+
export type { TextFileClient } from "./acp-operations.js";
|
|
10
|
+
export { createAcpFilesystemOperations } from "./acp-operations.js";
|
|
11
|
+
export { createDirectoryArtifactWriter, createTempArtifactWriter, sha256Hex } from "./artifacts.js";
|
|
12
|
+
export type {
|
|
13
|
+
AskUserDecisionAnswer,
|
|
14
|
+
AskUserDecisionOption,
|
|
15
|
+
AskUserDecisionRequest,
|
|
16
|
+
AskUserDecisionSelectionMode,
|
|
17
|
+
AskUserDecisionSuspendData,
|
|
18
|
+
AskUserDecisionToolOptions,
|
|
19
|
+
AskUserDecisionUiOutcome,
|
|
20
|
+
ResolvedAskUserDecisionAnswer,
|
|
21
|
+
ResolvedAskUserDecisionLimits,
|
|
22
|
+
} from "./ask-user-decision.js";
|
|
23
|
+
export {
|
|
24
|
+
ASK_USER_DECISION_CUSTOM_VALUE,
|
|
25
|
+
ASK_USER_DECISION_RATIONALE_COUNT,
|
|
26
|
+
ASK_USER_DECISION_SUSPEND_REASON,
|
|
27
|
+
ASK_USER_DECISION_TOOL_NAME,
|
|
28
|
+
askUserDecisionResumeSchema,
|
|
29
|
+
askUserDecisionViaUi,
|
|
30
|
+
createAskUserDecisionTool,
|
|
31
|
+
DEFAULT_MAX_ASK_USER_DECISION_BULLET_BYTES,
|
|
32
|
+
DEFAULT_MAX_ASK_USER_DECISION_CUSTOM_BYTES,
|
|
33
|
+
DEFAULT_MAX_ASK_USER_DECISION_LABEL_BYTES,
|
|
34
|
+
DEFAULT_MAX_ASK_USER_DECISION_OPTIONS,
|
|
35
|
+
DEFAULT_MAX_ASK_USER_DECISION_QUESTION_BYTES,
|
|
36
|
+
HARD_MAX_ASK_USER_DECISION_BULLET_BYTES,
|
|
37
|
+
HARD_MAX_ASK_USER_DECISION_CUSTOM_BYTES,
|
|
38
|
+
HARD_MAX_ASK_USER_DECISION_LABEL_BYTES,
|
|
39
|
+
HARD_MAX_ASK_USER_DECISION_OPTIONS,
|
|
40
|
+
HARD_MAX_ASK_USER_DECISION_QUESTION_BYTES,
|
|
41
|
+
parseAskUserDecisionArgs,
|
|
42
|
+
resolveAskUserDecisionAnswer,
|
|
43
|
+
resolveAskUserDecisionLimits,
|
|
44
|
+
toAskUserDecisionSuspendData,
|
|
45
|
+
} from "./ask-user-decision.js";
|
|
46
|
+
export type { CodingCheckToolOptions, NamedCheckDefinition } from "./checks.js";
|
|
47
|
+
export { createCodingCheckTool } from "./checks.js";
|
|
48
|
+
export type {
|
|
49
|
+
CodingArtifactKind,
|
|
50
|
+
CodingArtifactRef,
|
|
51
|
+
CodingCheckpointLimitOptions,
|
|
52
|
+
CodingCheckpointMetadata,
|
|
53
|
+
CodingCheckSummary,
|
|
54
|
+
CodingFingerprints,
|
|
55
|
+
CodingHandoffSummary,
|
|
56
|
+
CodingTaskStatus,
|
|
57
|
+
CodingTodoItem,
|
|
58
|
+
ResolvedCodingCheckpointLimits,
|
|
59
|
+
} from "./coding-checkpoint.js";
|
|
60
|
+
export {
|
|
61
|
+
assertCodingResumeAllowed,
|
|
62
|
+
buildCodingCheckpointMetadata,
|
|
63
|
+
CODING_CHECKPOINT_SCHEMA_VERSION,
|
|
64
|
+
CODING_STATE_KEY,
|
|
65
|
+
CodingCheckpointError,
|
|
66
|
+
codingCheckpointStatePatch,
|
|
67
|
+
codingPlanPathForTask,
|
|
68
|
+
createCodingArtifactRef,
|
|
69
|
+
createCodingPlanMarkdown,
|
|
70
|
+
fingerprintJson,
|
|
71
|
+
parseCodingPlanTodos,
|
|
72
|
+
readCodingCheckpointFromState,
|
|
73
|
+
readCodingPlanFile,
|
|
74
|
+
resolveCodingCheckpointLimits,
|
|
75
|
+
validateCodingCheckpointMetadata,
|
|
76
|
+
verifyCodingArtifactBytes,
|
|
77
|
+
writeCodingPlanFile,
|
|
78
|
+
} from "./coding-checkpoint.js";
|
|
79
|
+
export type { DeleteOperations, DeleteToolOptions, MutationStat } from "./delete.js";
|
|
80
|
+
export { createDeleteTool } from "./delete.js";
|
|
81
|
+
export type {
|
|
82
|
+
DiagnosticDelta,
|
|
83
|
+
DiagnosticDeltaRequest,
|
|
84
|
+
DiagnosticSeverity,
|
|
85
|
+
NormalizeDiagnosticsOptions,
|
|
86
|
+
NormalizedDiagnostic,
|
|
87
|
+
RawDiagnostic,
|
|
88
|
+
ResolvedDiagnosticsLimits,
|
|
89
|
+
} from "./diagnostics.js";
|
|
90
|
+
export { diagnosticDelta, diagnosticIdentity, normalizeDiagnostics, resolveDiagnosticsLimits } from "./diagnostics.js";
|
|
91
|
+
export type { DiagnosticsToolHandle, DiagnosticsToolOptions } from "./diagnostics-tool.js";
|
|
92
|
+
export { createDiagnosticsTool } from "./diagnostics-tool.js";
|
|
93
|
+
export type { Edit, EditOperations, EditToolDetails, EditToolOptions } from "./edit.js";
|
|
94
|
+
export { createEditTool } from "./edit.js";
|
|
95
|
+
export type { CodingEffectReconciliation, CodingEffectReconciliationInput } from "./effects.js";
|
|
96
|
+
export {
|
|
97
|
+
CODING_LOCAL_EFFECT,
|
|
98
|
+
CODING_OBSERVATION_EFFECT,
|
|
99
|
+
CODING_UNSUPPORTED_EFFECT,
|
|
100
|
+
reconcileCodingToolEffect,
|
|
101
|
+
} from "./effects.js";
|
|
102
|
+
export type {
|
|
103
|
+
CreateGitHubForgeOptions,
|
|
104
|
+
ForgeCheck,
|
|
105
|
+
ForgeCredential,
|
|
106
|
+
ForgeCredentialResolver,
|
|
107
|
+
ForgeCredentialResolverSource,
|
|
108
|
+
ForgeErrorCode,
|
|
109
|
+
ForgeHandoffReport,
|
|
110
|
+
ForgeIssueContext,
|
|
111
|
+
ForgeLimits,
|
|
112
|
+
ForgeOperations,
|
|
113
|
+
ForgePullRequest,
|
|
114
|
+
ResolvedForgeLimits,
|
|
115
|
+
} from "./forge/index.js";
|
|
116
|
+
export { createGitHubForge, ForgeError, resolveForgeLimits } from "./forge/index.js";
|
|
117
|
+
export type {
|
|
118
|
+
ArtifactReference,
|
|
119
|
+
ArtifactWriter,
|
|
120
|
+
BoundGitRunner,
|
|
121
|
+
CreateGitOperationsOptions,
|
|
122
|
+
CreateGitRunnerOptions,
|
|
123
|
+
GitExecRequest,
|
|
124
|
+
GitExecResult,
|
|
125
|
+
GitLimitOptions,
|
|
126
|
+
GitOperations,
|
|
127
|
+
GitRunner,
|
|
128
|
+
GitStatusBranch,
|
|
129
|
+
GitStatusEntry,
|
|
130
|
+
GitStatusEntryKind,
|
|
131
|
+
GitStatusResult,
|
|
132
|
+
PrHandoff,
|
|
133
|
+
ResolvedGitLimits,
|
|
134
|
+
} from "./git.js";
|
|
135
|
+
export {
|
|
136
|
+
createBoundGitRunner,
|
|
137
|
+
createGitOperations,
|
|
138
|
+
GitError,
|
|
139
|
+
parsePorcelainV2,
|
|
140
|
+
resolveGitLimits,
|
|
141
|
+
runGitCli,
|
|
142
|
+
SAFE_GIT_CONFIG_ARGS,
|
|
143
|
+
SAFE_GIT_ENV,
|
|
144
|
+
} from "./git.js";
|
|
145
|
+
export type { GitAwareRepositoryOptions } from "./git-aware-repository.js";
|
|
146
|
+
export { createGitAwareRepositoryOperations, parseGitLsFilesZ } from "./git-aware-repository.js";
|
|
147
|
+
export type { GitToolsOptions } from "./git-tools.js";
|
|
148
|
+
export {
|
|
149
|
+
createGitCommitTool,
|
|
150
|
+
createGitDiffTool,
|
|
151
|
+
createGitPrHandoffTool,
|
|
152
|
+
createGitStatusTool,
|
|
153
|
+
createGitTools,
|
|
154
|
+
} from "./git-tools.js";
|
|
155
|
+
export type { GlobToolOptions } from "./glob.js";
|
|
156
|
+
export { createGlobTool } from "./glob.js";
|
|
157
|
+
export { compileGlob, matchGlobPattern, validateGlobPattern } from "./glob-match.js";
|
|
158
|
+
export type {
|
|
159
|
+
CodingGoalVerifyApproval,
|
|
160
|
+
RunCodingGoalVerifyOptions,
|
|
161
|
+
} from "./goal-verify.js";
|
|
162
|
+
export {
|
|
163
|
+
CODING_GOAL_VERIFY_REVISION,
|
|
164
|
+
CODING_GOAL_VERIFY_SUSPEND_REASON,
|
|
165
|
+
CODING_GOAL_VERIFY_WORKFLOW_ID,
|
|
166
|
+
CodingGoalVerifyError,
|
|
167
|
+
createCodingGoalVerifyWorkflow,
|
|
168
|
+
runCodingGoalVerify,
|
|
169
|
+
} from "./goal-verify.js";
|
|
170
|
+
export type { GrepToolOptions } from "./grep.js";
|
|
171
|
+
export { createGrepTool } from "./grep.js";
|
|
172
|
+
export type {
|
|
173
|
+
CreateLanguageIntelligenceOptions,
|
|
174
|
+
LanguageDiagnostic,
|
|
175
|
+
LanguageIntelligence,
|
|
176
|
+
LanguageIntelligenceLimits,
|
|
177
|
+
LanguageLocation,
|
|
178
|
+
LanguageServerSpec,
|
|
179
|
+
LanguageSymbol,
|
|
180
|
+
LanguageTextEdit,
|
|
181
|
+
LanguageWorkspaceEdit,
|
|
182
|
+
} from "./language/index.js";
|
|
183
|
+
export {
|
|
184
|
+
applyTextEdits,
|
|
185
|
+
createLanguageIntelligence,
|
|
186
|
+
encodeLspFrame,
|
|
187
|
+
LanguageIntelligenceError,
|
|
188
|
+
LspFrameError,
|
|
189
|
+
LspFrameReader,
|
|
190
|
+
languageIdForPath,
|
|
191
|
+
resolveLanguageIntelligenceLimits,
|
|
192
|
+
} from "./language/index.js";
|
|
193
|
+
export type {
|
|
194
|
+
CodingLifecycleEmitter,
|
|
195
|
+
CodingLifecycleEvent,
|
|
196
|
+
CodingLifecycleLimits,
|
|
197
|
+
ConfigurationChangedEvent,
|
|
198
|
+
CreateCodingLifecycleEmitterOptions,
|
|
199
|
+
FileChangedEvent,
|
|
200
|
+
FileChangeOp,
|
|
201
|
+
PermissionDeniedEvent,
|
|
202
|
+
ResolvedCodingLifecycleLimits,
|
|
203
|
+
SubagentFailure,
|
|
204
|
+
SubagentRecovery,
|
|
205
|
+
SubagentRecoveryOutcome,
|
|
206
|
+
SubagentStartedEvent,
|
|
207
|
+
SubagentStoppedEvent,
|
|
208
|
+
WorktreeChangedEvent,
|
|
209
|
+
} from "./lifecycle.js";
|
|
210
|
+
export {
|
|
211
|
+
CodingLifecycleError,
|
|
212
|
+
createCodingLifecycleEmitter,
|
|
213
|
+
resolveCodingLifecycleLimits,
|
|
214
|
+
} from "./lifecycle.js";
|
|
215
|
+
export type { MoveOperations, MoveToolOptions } from "./move.js";
|
|
216
|
+
export { createMoveTool } from "./move.js";
|
|
217
|
+
export type {
|
|
218
|
+
CodingProcessEvent,
|
|
219
|
+
CreateProcessSessionsOptions,
|
|
220
|
+
ProcessExitResult,
|
|
221
|
+
ProcessOutputChunk,
|
|
222
|
+
// host-selected PTY backend: pass ptyBackend to createProcessSessions to
|
|
223
|
+
// enable pty: true (delegates only to the host adapter; see process/types.ts)
|
|
224
|
+
ProcessPtyBackend,
|
|
225
|
+
ProcessPtyHandle,
|
|
226
|
+
ProcessPtyStartRequest,
|
|
227
|
+
ProcessRecoveryBackend,
|
|
228
|
+
ProcessRecoveryErrorCode,
|
|
229
|
+
ProcessRecoveryLimits,
|
|
230
|
+
ProcessRecoveryOutcome,
|
|
231
|
+
ProcessRecoveryRecord,
|
|
232
|
+
ProcessRecoveryRecordReport,
|
|
233
|
+
ProcessRecoveryReport,
|
|
234
|
+
ProcessSandboxBackend,
|
|
235
|
+
ProcessSandboxHandle,
|
|
236
|
+
ProcessSandboxStartRequest,
|
|
237
|
+
ProcessSession,
|
|
238
|
+
ProcessSessionLimits,
|
|
239
|
+
ProcessSessionMetadata,
|
|
240
|
+
ProcessSessionState,
|
|
241
|
+
ProcessSessions,
|
|
242
|
+
ProcessStartRequest,
|
|
243
|
+
ProcessTerminalRequest,
|
|
244
|
+
ProcessTerminalResize,
|
|
245
|
+
ResolvedProcessRecoveryLimits,
|
|
246
|
+
ResolvedProcessSessionLimits,
|
|
247
|
+
} from "./process/index.js";
|
|
248
|
+
// durable process/ACP recovery seam (plan 026 Task 5): recover() is
|
|
249
|
+
// attach-if-attested and never fabricates an exit code; exports below
|
|
250
|
+
export {
|
|
251
|
+
createProcessSessions,
|
|
252
|
+
PROCESS_RECOVERY_CATEGORY,
|
|
253
|
+
PROCESS_RECOVERY_LEASE_NAMESPACE,
|
|
254
|
+
PROCESS_RECOVERY_NAMESPACE,
|
|
255
|
+
PROCESS_RECOVERY_SCHEMA_VERSION,
|
|
256
|
+
ProcessRecoveryError,
|
|
257
|
+
ProcessSessionError,
|
|
258
|
+
resolveProcessRecoveryLimits,
|
|
259
|
+
resolveProcessSessionLimits,
|
|
260
|
+
validateBackendRef,
|
|
261
|
+
validateProcessRecoveryRecord,
|
|
262
|
+
} from "./process/index.js";
|
|
263
|
+
export type {
|
|
264
|
+
DocumentReader,
|
|
265
|
+
DocumentReaderResult,
|
|
266
|
+
ReadOperations,
|
|
267
|
+
ReadTextOptions,
|
|
268
|
+
ReadTextResult,
|
|
269
|
+
ReadToolOptions,
|
|
270
|
+
TransformImage,
|
|
271
|
+
TransformImageInput,
|
|
272
|
+
} from "./read.js";
|
|
273
|
+
export {
|
|
274
|
+
createReadTool,
|
|
275
|
+
DEFAULT_MAX_IMAGE_BYTES,
|
|
276
|
+
detectSupportedImageMimeType,
|
|
277
|
+
detectSupportedImageMimeTypeFromFile,
|
|
278
|
+
} from "./read.js";
|
|
279
|
+
export type { ReadPathSet } from "./read-path-set.js";
|
|
280
|
+
export {
|
|
281
|
+
createReadPathSet,
|
|
282
|
+
createReadPathSetPersistence,
|
|
283
|
+
DEFAULT_MAX_PERSISTED_READ_PATH_CHARS,
|
|
284
|
+
DEFAULT_MAX_PERSISTED_READ_PATHS,
|
|
285
|
+
READ_PATH_SET_NAMESPACE,
|
|
286
|
+
} from "./read-path-set.js";
|
|
287
|
+
export type {
|
|
288
|
+
IndexedRepositoryOptions,
|
|
289
|
+
IndexFacade,
|
|
290
|
+
IndexFileChange,
|
|
291
|
+
IndexLimitOptions,
|
|
292
|
+
IndexResourceDiagnostics,
|
|
293
|
+
IndexSearchHit,
|
|
294
|
+
IndexState,
|
|
295
|
+
RepoEntryKind,
|
|
296
|
+
RepoListEntry,
|
|
297
|
+
RepoSearchMode,
|
|
298
|
+
RepoSearchOutputMode,
|
|
299
|
+
RepositoryFileMatcher,
|
|
300
|
+
RepositoryGlobRequest,
|
|
301
|
+
RepositoryGlobResult,
|
|
302
|
+
RepositoryIndexBackend,
|
|
303
|
+
RepositoryIndexQueryRequest,
|
|
304
|
+
RepositoryIndexQueryResult,
|
|
305
|
+
RepositoryIndexRemoveRequest,
|
|
306
|
+
RepositoryIndexStatus,
|
|
307
|
+
RepositoryIndexUpdateRequest,
|
|
308
|
+
RepositoryLimitOptions,
|
|
309
|
+
RepositoryLineMatch,
|
|
310
|
+
RepositoryListRequest,
|
|
311
|
+
RepositoryListResult,
|
|
312
|
+
RepositoryOperations,
|
|
313
|
+
RepositorySearchMatch,
|
|
314
|
+
RepositorySearchRequest,
|
|
315
|
+
RepositorySearchResult,
|
|
316
|
+
RepositoryWalk,
|
|
317
|
+
RepositoryWalkEvent,
|
|
318
|
+
RepositoryWalkLimits,
|
|
319
|
+
ResolvedIndexLimits,
|
|
320
|
+
ResolvedRepositoryLimits,
|
|
321
|
+
} from "./repository.js";
|
|
322
|
+
// host-indexed search seam (plan 026 Task 2): compose a host index with the
|
|
323
|
+
// literal fallback; indexed_literal/semantic never fall back silently
|
|
324
|
+
export {
|
|
325
|
+
compileSearchPattern,
|
|
326
|
+
createIndexedRepositoryOperations,
|
|
327
|
+
createLocalRepositoryOperations,
|
|
328
|
+
DEFAULT_REPO_EXCLUDE,
|
|
329
|
+
IndexError,
|
|
330
|
+
isBinaryBuffer,
|
|
331
|
+
literalMatcher,
|
|
332
|
+
matchLines,
|
|
333
|
+
RepositoryError,
|
|
334
|
+
resolveIndexLimits,
|
|
335
|
+
resolveRepoPath,
|
|
336
|
+
resolveRepositoryLimits,
|
|
337
|
+
toRepoRelative,
|
|
338
|
+
} from "./repository.js";
|
|
339
|
+
export type {
|
|
340
|
+
BashExecOptions,
|
|
341
|
+
BashOperations,
|
|
342
|
+
BashSpawnContext,
|
|
343
|
+
BashSpawnHook,
|
|
344
|
+
ShellConfig,
|
|
345
|
+
ShellToolOptions,
|
|
346
|
+
} from "./shell.js";
|
|
347
|
+
export {
|
|
348
|
+
createLocalBashOperations,
|
|
349
|
+
createShellTool,
|
|
350
|
+
getShellConfig,
|
|
351
|
+
killProcessTree,
|
|
352
|
+
waitForChildProcess,
|
|
353
|
+
} from "./shell.js";
|
|
354
|
+
export type {
|
|
355
|
+
BackgroundProcesses,
|
|
356
|
+
BackgroundProcessOptions,
|
|
357
|
+
BackgroundRead,
|
|
358
|
+
BackgroundReadInput,
|
|
359
|
+
BackgroundStarted,
|
|
360
|
+
BackgroundStartInput,
|
|
361
|
+
} from "./shell-background.js";
|
|
362
|
+
export {
|
|
363
|
+
BACKGROUND_FIRST_OUTPUT_MS,
|
|
364
|
+
createBackgroundProcesses,
|
|
365
|
+
DEFAULT_MAX_BACKGROUND_PROCESSES,
|
|
366
|
+
HARD_MAX_BACKGROUND_PROCESSES,
|
|
367
|
+
HARD_MAX_BACKGROUND_WAIT_SECONDS,
|
|
368
|
+
} from "./shell-background.js";
|
|
369
|
+
export type { ShellOutputToolOptions } from "./shell-output.js";
|
|
370
|
+
export { createShellOutputTool } from "./shell-output.js";
|
|
371
|
+
export type {
|
|
372
|
+
TodoContinuationDecision,
|
|
373
|
+
TodoContinuationOptions,
|
|
374
|
+
TodoItem,
|
|
375
|
+
TodoListMetadata,
|
|
376
|
+
TodoNoProgressStopInfo,
|
|
377
|
+
TodoStatus,
|
|
378
|
+
TodoWriteToolOptions,
|
|
379
|
+
} from "./todo.js";
|
|
380
|
+
export {
|
|
381
|
+
createTodoContinuationDecision,
|
|
382
|
+
createTodoWriteTool,
|
|
383
|
+
DEFAULT_MAX_TODO_CONTENT_BYTES,
|
|
384
|
+
DEFAULT_MAX_TODO_ID_BYTES,
|
|
385
|
+
DEFAULT_MAX_TODO_ITEMS,
|
|
386
|
+
DEFAULT_MAX_TODO_NO_PROGRESS,
|
|
387
|
+
DEFAULT_MAX_TODO_STEER_BYTES,
|
|
388
|
+
DEFAULT_MAX_TODO_STEER_ITEMS,
|
|
389
|
+
formatTodoList,
|
|
390
|
+
HARD_MAX_TODO_CONTENT_BYTES,
|
|
391
|
+
HARD_MAX_TODO_ID_BYTES,
|
|
392
|
+
HARD_MAX_TODO_ITEMS,
|
|
393
|
+
HARD_MAX_TODO_NO_PROGRESS,
|
|
394
|
+
HARD_MAX_TODO_STEER_BYTES,
|
|
395
|
+
HARD_MAX_TODO_STEER_ITEMS,
|
|
396
|
+
latestTodoList,
|
|
397
|
+
parseTodoListMetadata,
|
|
398
|
+
parseTodoWriteArgs,
|
|
399
|
+
TODO_STATUSES,
|
|
400
|
+
TODO_WRITE_TOOL_NAME,
|
|
401
|
+
todoPinnedEntryIds,
|
|
402
|
+
} from "./todo.js";
|
|
403
|
+
export type { WriteOperations, WriteToolOptions } from "./write.js";
|
|
404
|
+
export { createWriteTool } from "./write.js";
|
|
405
|
+
|
|
406
|
+
// --- generic primitives (re-exported for hosts that want them) ---
|
|
407
|
+
|
|
408
|
+
export type { ExecutionAction, ExecutionDecision, ExecutionPolicy, ExecutionRisk } from "./execution-policy.js";
|
|
409
|
+
export {
|
|
410
|
+
applyExecutionDecision,
|
|
411
|
+
assertExecutionAllowed,
|
|
412
|
+
checkExecution,
|
|
413
|
+
ExecutionDeniedError,
|
|
414
|
+
enforceExecutionPolicy,
|
|
415
|
+
} from "./execution-policy.js";
|
|
416
|
+
export { withFileMutationQueue } from "./file-mutation-queue.js";
|
|
417
|
+
export {
|
|
418
|
+
DEFAULT_CHECK_TIMEOUT_MS,
|
|
419
|
+
DEFAULT_GIT_TIMEOUT_MS,
|
|
420
|
+
DEFAULT_MAX_BYTES,
|
|
421
|
+
DEFAULT_MAX_CHECK_CONCURRENCY,
|
|
422
|
+
DEFAULT_MAX_CHECK_DIAGNOSTIC_LINES,
|
|
423
|
+
DEFAULT_MAX_CHECK_NAMES,
|
|
424
|
+
DEFAULT_MAX_CHECK_OUTPUT_BYTES,
|
|
425
|
+
DEFAULT_MAX_CHECK_SUMMARY_BYTES,
|
|
426
|
+
DEFAULT_MAX_CODING_ARTIFACT_BYTES,
|
|
427
|
+
DEFAULT_MAX_CODING_ARTIFACTS,
|
|
428
|
+
DEFAULT_MAX_CODING_CHECKPOINT_BYTES,
|
|
429
|
+
DEFAULT_MAX_EDIT_FILE_BYTES,
|
|
430
|
+
DEFAULT_MAX_EDIT_INPUT_BYTES,
|
|
431
|
+
DEFAULT_MAX_EDITS,
|
|
432
|
+
DEFAULT_MAX_FORGE_COMMENTS_PER_REVIEW,
|
|
433
|
+
DEFAULT_MAX_FORGE_PAGES_PER_OPERATION,
|
|
434
|
+
DEFAULT_MAX_FORGE_PAYLOAD_BYTES,
|
|
435
|
+
DEFAULT_MAX_FORGE_REQUEST_CONCURRENCY,
|
|
436
|
+
DEFAULT_MAX_FORGE_REQUEST_TIMEOUT_MS,
|
|
437
|
+
DEFAULT_MAX_GIT_CHANGED_FILES,
|
|
438
|
+
DEFAULT_MAX_GIT_DIFF_LINES,
|
|
439
|
+
DEFAULT_MAX_GIT_MESSAGE_BYTES,
|
|
440
|
+
DEFAULT_MAX_GIT_OUTPUT_BYTES,
|
|
441
|
+
DEFAULT_MAX_GIT_PATCH_BYTES,
|
|
442
|
+
DEFAULT_MAX_GIT_PATHS,
|
|
443
|
+
DEFAULT_MAX_GIT_REF_BYTES,
|
|
444
|
+
DEFAULT_MAX_GIT_WORKTREES,
|
|
445
|
+
DEFAULT_MAX_LINES,
|
|
446
|
+
DEFAULT_MAX_LS_FILES_OUTPUT_BYTES,
|
|
447
|
+
DEFAULT_MAX_LSP_DIAGNOSTICS_PER_FILE,
|
|
448
|
+
DEFAULT_MAX_LSP_MESSAGE_BYTES,
|
|
449
|
+
DEFAULT_MAX_LSP_PENDING_REQUESTS,
|
|
450
|
+
DEFAULT_MAX_LSP_RESULTS_PER_QUERY,
|
|
451
|
+
DEFAULT_MAX_LSP_SERVERS,
|
|
452
|
+
DEFAULT_MAX_LSP_TIMEOUT_MS,
|
|
453
|
+
DEFAULT_MAX_PLAN_BYTES,
|
|
454
|
+
DEFAULT_MAX_PR_COMMITS,
|
|
455
|
+
DEFAULT_MAX_PR_HANDOFF_BYTES,
|
|
456
|
+
DEFAULT_MAX_PROCESS_INPUT_BYTES,
|
|
457
|
+
DEFAULT_MAX_PROCESS_LIFETIME_MS,
|
|
458
|
+
DEFAULT_MAX_PROCESS_OUTPUT_CHUNK_BYTES,
|
|
459
|
+
DEFAULT_MAX_PROCESS_SESSIONS,
|
|
460
|
+
DEFAULT_MAX_PROCESS_TOTAL_OUTPUT_BYTES,
|
|
461
|
+
DEFAULT_MAX_PTY_ATTACH_TIMEOUT_MS,
|
|
462
|
+
DEFAULT_MAX_PTY_BACKEND_METADATA_BYTES,
|
|
463
|
+
DEFAULT_MAX_REPO_CONCURRENCY,
|
|
464
|
+
DEFAULT_MAX_REPO_DEPTH,
|
|
465
|
+
DEFAULT_MAX_REPO_ENTRIES,
|
|
466
|
+
DEFAULT_MAX_REPO_FILES,
|
|
467
|
+
DEFAULT_MAX_REPO_RESULTS,
|
|
468
|
+
DEFAULT_MAX_SEARCH_CONTEXT_LINES,
|
|
469
|
+
DEFAULT_MAX_SEARCH_FILE_BYTES,
|
|
470
|
+
DEFAULT_MAX_SEARCH_LINE_BYTES,
|
|
471
|
+
DEFAULT_MAX_SEARCH_MATCHES,
|
|
472
|
+
DEFAULT_MAX_SEARCH_PATTERN_BYTES,
|
|
473
|
+
DEFAULT_MAX_SEARCH_SCAN_BYTES,
|
|
474
|
+
DEFAULT_MAX_SEARCH_TIME_MS,
|
|
475
|
+
DEFAULT_MAX_TERMINAL_COLUMNS,
|
|
476
|
+
DEFAULT_MAX_TERMINAL_RESIZES_PER_MINUTE,
|
|
477
|
+
DEFAULT_MAX_TERMINAL_ROWS,
|
|
478
|
+
DEFAULT_MAX_TERMINAL_TERM_BYTES,
|
|
479
|
+
DEFAULT_MAX_TEXT_SCAN_BYTES,
|
|
480
|
+
DEFAULT_MAX_TODO_TEXT_BYTES,
|
|
481
|
+
DEFAULT_MAX_TODOS,
|
|
482
|
+
DEFAULT_MAX_TOTAL_OUTPUT_BYTES,
|
|
483
|
+
DEFAULT_MAX_WRITE_BYTES,
|
|
484
|
+
DEFAULT_SHELL_TIMEOUT_SECONDS,
|
|
485
|
+
HARD_CHECK_TIMEOUT_MS,
|
|
486
|
+
HARD_GIT_TIMEOUT_MS,
|
|
487
|
+
HARD_MAX_BYTES,
|
|
488
|
+
HARD_MAX_CHECK_CONCURRENCY,
|
|
489
|
+
HARD_MAX_CHECK_DIAGNOSTIC_LINES,
|
|
490
|
+
HARD_MAX_CHECK_NAMES,
|
|
491
|
+
HARD_MAX_CHECK_OUTPUT_BYTES,
|
|
492
|
+
HARD_MAX_CHECK_SUMMARY_BYTES,
|
|
493
|
+
HARD_MAX_CODING_ARTIFACT_BYTES,
|
|
494
|
+
HARD_MAX_CODING_ARTIFACTS,
|
|
495
|
+
HARD_MAX_CODING_CHECKPOINT_BYTES,
|
|
496
|
+
HARD_MAX_EDIT_FILE_BYTES,
|
|
497
|
+
HARD_MAX_EDIT_INPUT_BYTES,
|
|
498
|
+
HARD_MAX_EDITS,
|
|
499
|
+
HARD_MAX_FORGE_COMMENTS_PER_REVIEW,
|
|
500
|
+
HARD_MAX_FORGE_PAGES_PER_OPERATION,
|
|
501
|
+
HARD_MAX_FORGE_PAYLOAD_BYTES,
|
|
502
|
+
HARD_MAX_FORGE_REQUEST_CONCURRENCY,
|
|
503
|
+
HARD_MAX_FORGE_REQUEST_TIMEOUT_MS,
|
|
504
|
+
HARD_MAX_GIT_CHANGED_FILES,
|
|
505
|
+
HARD_MAX_GIT_DIFF_LINES,
|
|
506
|
+
HARD_MAX_GIT_MESSAGE_BYTES,
|
|
507
|
+
HARD_MAX_GIT_OUTPUT_BYTES,
|
|
508
|
+
HARD_MAX_GIT_PATCH_BYTES,
|
|
509
|
+
HARD_MAX_GIT_PATHS,
|
|
510
|
+
HARD_MAX_GIT_REF_BYTES,
|
|
511
|
+
HARD_MAX_GIT_WORKTREES,
|
|
512
|
+
HARD_MAX_IMAGE_BYTES,
|
|
513
|
+
HARD_MAX_LINES,
|
|
514
|
+
HARD_MAX_LS_FILES_OUTPUT_BYTES,
|
|
515
|
+
HARD_MAX_LSP_DIAGNOSTICS_PER_FILE,
|
|
516
|
+
HARD_MAX_LSP_MESSAGE_BYTES,
|
|
517
|
+
HARD_MAX_LSP_PENDING_REQUESTS,
|
|
518
|
+
HARD_MAX_LSP_RESULTS_PER_QUERY,
|
|
519
|
+
HARD_MAX_LSP_SERVERS,
|
|
520
|
+
HARD_MAX_LSP_TIMEOUT_MS,
|
|
521
|
+
HARD_MAX_PLAN_BYTES,
|
|
522
|
+
HARD_MAX_PR_COMMITS,
|
|
523
|
+
HARD_MAX_PR_HANDOFF_BYTES,
|
|
524
|
+
HARD_MAX_PROCESS_INPUT_BYTES,
|
|
525
|
+
HARD_MAX_PROCESS_LIFETIME_MS,
|
|
526
|
+
HARD_MAX_PROCESS_OUTPUT_CHUNK_BYTES,
|
|
527
|
+
HARD_MAX_PROCESS_SESSIONS,
|
|
528
|
+
HARD_MAX_PROCESS_TOTAL_OUTPUT_BYTES,
|
|
529
|
+
HARD_MAX_PTY_ATTACH_TIMEOUT_MS,
|
|
530
|
+
HARD_MAX_PTY_BACKEND_METADATA_BYTES,
|
|
531
|
+
HARD_MAX_REPO_CONCURRENCY,
|
|
532
|
+
HARD_MAX_REPO_DEPTH,
|
|
533
|
+
HARD_MAX_REPO_ENTRIES,
|
|
534
|
+
HARD_MAX_REPO_FILES,
|
|
535
|
+
HARD_MAX_REPO_RESULTS,
|
|
536
|
+
HARD_MAX_SEARCH_CONTEXT_LINES,
|
|
537
|
+
HARD_MAX_SEARCH_FILE_BYTES,
|
|
538
|
+
HARD_MAX_SEARCH_LINE_BYTES,
|
|
539
|
+
HARD_MAX_SEARCH_MATCHES,
|
|
540
|
+
HARD_MAX_SEARCH_PATTERN_BYTES,
|
|
541
|
+
HARD_MAX_SEARCH_SCAN_BYTES,
|
|
542
|
+
HARD_MAX_SEARCH_TIME_MS,
|
|
543
|
+
HARD_MAX_TERMINAL_COLUMNS,
|
|
544
|
+
HARD_MAX_TERMINAL_RESIZES_PER_MINUTE,
|
|
545
|
+
HARD_MAX_TERMINAL_ROWS,
|
|
546
|
+
HARD_MAX_TERMINAL_TERM_BYTES,
|
|
547
|
+
HARD_MAX_TEXT_SCAN_BYTES,
|
|
548
|
+
HARD_MAX_TODO_TEXT_BYTES,
|
|
549
|
+
HARD_MAX_TODOS,
|
|
550
|
+
HARD_MAX_TOTAL_OUTPUT_BYTES,
|
|
551
|
+
HARD_MAX_WRITE_BYTES,
|
|
552
|
+
HARD_SHELL_TIMEOUT_SECONDS,
|
|
553
|
+
LSP_RESTARTS_PER_SERVER,
|
|
554
|
+
} from "./limits.js";
|
|
555
|
+
|
|
556
|
+
// --- aggregators ---
|
|
557
|
+
|
|
558
|
+
import type { ToolDefinition } from "@arnilo/prism";
|
|
559
|
+
import type { DeleteToolOptions } from "./delete.js";
|
|
560
|
+
import { createDeleteTool } from "./delete.js";
|
|
561
|
+
import type { EditToolOptions } from "./edit.js";
|
|
562
|
+
import { createEditTool } from "./edit.js";
|
|
563
|
+
import type { ExecutionPolicy } from "./execution-policy.js";
|
|
564
|
+
import type { GlobToolOptions } from "./glob.js";
|
|
565
|
+
import { createGlobTool } from "./glob.js";
|
|
566
|
+
import type { GrepToolOptions } from "./grep.js";
|
|
567
|
+
import { createGrepTool } from "./grep.js";
|
|
568
|
+
import type { MoveToolOptions } from "./move.js";
|
|
569
|
+
import { createMoveTool } from "./move.js";
|
|
570
|
+
import type { ReadToolOptions } from "./read.js";
|
|
571
|
+
import { createReadTool } from "./read.js";
|
|
572
|
+
import type { RepositoryLimitOptions, RepositoryOperations } from "./repository.js";
|
|
573
|
+
import type { ShellToolOptions } from "./shell.js";
|
|
574
|
+
import { createShellTool } from "./shell.js";
|
|
575
|
+
import { createShellOutputTool } from "./shell-output.js";
|
|
576
|
+
import type { WriteToolOptions } from "./write.js";
|
|
577
|
+
import { createWriteTool } from "./write.js";
|
|
578
|
+
|
|
579
|
+
/** Per-tool options combined for the aggregator factories. */
|
|
580
|
+
export interface ToolsOptions {
|
|
581
|
+
/** Shared execution policy applied to every coding tool unless overridden per tool. */
|
|
582
|
+
executionPolicy?: ExecutionPolicy;
|
|
583
|
+
shell?: ShellToolOptions;
|
|
584
|
+
read?: ReadToolOptions;
|
|
585
|
+
write?: WriteToolOptions;
|
|
586
|
+
edit?: EditToolOptions;
|
|
587
|
+
delete?: DeleteToolOptions;
|
|
588
|
+
move?: MoveToolOptions;
|
|
589
|
+
/**
|
|
590
|
+
* Whether a shell backs this set (default true). When false, `shell` is omitted and the
|
|
591
|
+
* effect-classified `delete`/`move` substitutes are registered instead.
|
|
592
|
+
*/
|
|
593
|
+
shellAvailable?: boolean;
|
|
594
|
+
grep?: GrepToolOptions;
|
|
595
|
+
/** @deprecated use `grep` */
|
|
596
|
+
search?: GrepToolOptions;
|
|
597
|
+
glob?: GlobToolOptions;
|
|
598
|
+
/**
|
|
599
|
+
* Shared repository limits/backends for `grep` / `glob`.
|
|
600
|
+
* Per-tool `search` / `glob` options override these when both are set.
|
|
601
|
+
*/
|
|
602
|
+
repository?: RepositoryLimitOptions & { operations?: RepositoryOperations };
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function withSharedExecutionPolicy<T extends { executionPolicy?: ExecutionPolicy }>(
|
|
606
|
+
toolOptions: T | undefined,
|
|
607
|
+
shared?: ExecutionPolicy,
|
|
608
|
+
): T {
|
|
609
|
+
if (!shared) return (toolOptions ?? {}) as T;
|
|
610
|
+
return { ...(toolOptions ?? {}), executionPolicy: toolOptions?.executionPolicy ?? shared } as T;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
function withRepositoryDefaults(
|
|
614
|
+
toolOptions: GrepToolOptions | GlobToolOptions | undefined,
|
|
615
|
+
shared?: ToolsOptions["repository"],
|
|
616
|
+
): GrepToolOptions | GlobToolOptions {
|
|
617
|
+
if (!shared && !toolOptions) return {};
|
|
618
|
+
return {
|
|
619
|
+
...(toolOptions ?? {}),
|
|
620
|
+
repository: toolOptions?.repository ?? shared,
|
|
621
|
+
operations: toolOptions?.operations ?? shared?.operations,
|
|
622
|
+
exclude: toolOptions?.exclude ?? shared?.exclude,
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Full coding tool set: `shell`, `read`, `write`, `edit`, `grep`, `glob` — plus `delete` and `move`
|
|
628
|
+
* when `shellAvailable` is false. `delete`/`move` exist so a shell-less host still has
|
|
629
|
+
* effect-classified deletes and moves; with a shell, `rm`/`mv` are one call and the extra
|
|
630
|
+
* schemas are pure cost (plan 189 Task 8).
|
|
631
|
+
* Opt-in tools (`createGitTools`, `createAskUserDecisionTool`, `createCodingCheckTool`)
|
|
632
|
+
* stay out — hosts register them explicitly.
|
|
633
|
+
*/
|
|
634
|
+
export function createCodingTools(cwd: string, options?: ToolsOptions): readonly ToolDefinition[] {
|
|
635
|
+
const policy = options?.executionPolicy;
|
|
636
|
+
const searchOpts = withRepositoryDefaults(options?.grep ?? options?.search, options?.repository) as GrepToolOptions;
|
|
637
|
+
const globOpts = withRepositoryDefaults(options?.glob, options?.repository) as GlobToolOptions;
|
|
638
|
+
const fileTools: ToolDefinition[] = [
|
|
639
|
+
createReadTool(cwd, withSharedExecutionPolicy(options?.read, policy)),
|
|
640
|
+
createWriteTool(cwd, withSharedExecutionPolicy(options?.write, policy)),
|
|
641
|
+
createEditTool(cwd, withSharedExecutionPolicy(options?.edit, policy)),
|
|
642
|
+
createGrepTool(cwd, withSharedExecutionPolicy(searchOpts, policy)),
|
|
643
|
+
createGlobTool(cwd, withSharedExecutionPolicy(globOpts, policy)),
|
|
644
|
+
];
|
|
645
|
+
if (options?.shellAvailable === false) {
|
|
646
|
+
return [
|
|
647
|
+
...fileTools,
|
|
648
|
+
createDeleteTool(cwd, withSharedExecutionPolicy(options.delete, policy)),
|
|
649
|
+
createMoveTool(cwd, withSharedExecutionPolicy(options.move, policy)),
|
|
650
|
+
];
|
|
651
|
+
}
|
|
652
|
+
const shellOptions = withSharedExecutionPolicy(options?.shell, policy);
|
|
653
|
+
return [
|
|
654
|
+
createShellTool(cwd, shellOptions),
|
|
655
|
+
...fileTools,
|
|
656
|
+
// `shell_output` is one half of `background: true`, so it ships only with a background runtime.
|
|
657
|
+
...(shellOptions.background !== undefined ? [createShellOutputTool({ background: shellOptions.background })] : []),
|
|
658
|
+
];
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/** Read-only subset: `read`, `grep`, `glob`. Never mutating, never a shell. */
|
|
662
|
+
export function createReadOnlyTools(cwd: string, options?: ToolsOptions): readonly ToolDefinition[] {
|
|
663
|
+
const policy = options?.executionPolicy;
|
|
664
|
+
const searchOpts = withRepositoryDefaults(options?.grep ?? options?.search, options?.repository) as GrepToolOptions;
|
|
665
|
+
const globOpts = withRepositoryDefaults(options?.glob, options?.repository) as GlobToolOptions;
|
|
666
|
+
return [
|
|
667
|
+
createReadTool(cwd, withSharedExecutionPolicy(options?.read, policy)),
|
|
668
|
+
createGrepTool(cwd, withSharedExecutionPolicy(searchOpts, policy)),
|
|
669
|
+
createGlobTool(cwd, withSharedExecutionPolicy(globOpts, policy)),
|
|
670
|
+
];
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/** Every tool this package provides — identical to {@link createCodingTools}. */
|
|
674
|
+
export function createAllTools(cwd: string, options?: ToolsOptions): readonly ToolDefinition[] {
|
|
675
|
+
return createCodingTools(cwd, options);
|
|
676
|
+
}
|