@semalt-ai/code 1.8.5 → 1.19.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/.claude/settings.local.json +6 -1
- package/.github/workflows/ci.yml +69 -0
- package/CLAUDE.md +1584 -26
- package/README.md +147 -3
- package/examples/embed.js +74 -0
- package/index.js +251 -10
- package/lib/agent.js +711 -104
- package/lib/api.js +213 -49
- package/lib/args.js +74 -2
- package/lib/audit.js +23 -1
- package/lib/background.js +584 -0
- package/lib/checkpoints.js +757 -0
- package/lib/commands/auth.js +94 -0
- package/lib/commands/chat-session.js +306 -0
- package/lib/commands/chat-slash.js +399 -0
- package/lib/commands/chat-turn.js +446 -0
- package/lib/commands/chat.js +403 -0
- package/lib/commands/custom.js +157 -0
- package/lib/commands/history-utils.js +66 -0
- package/lib/commands/index.js +268 -0
- package/lib/commands/mcp.js +113 -0
- package/lib/commands/oneshot.js +193 -0
- package/lib/commands/registry.js +269 -0
- package/lib/commands/tasks.js +89 -0
- package/lib/compact.js +87 -0
- package/lib/config.js +333 -11
- package/lib/constants.js +372 -3
- package/lib/deny.js +199 -0
- package/lib/doctor.js +160 -0
- package/lib/headless.js +167 -0
- package/lib/hooks.js +286 -0
- package/lib/images.js +264 -0
- package/lib/internals.js +49 -0
- package/lib/mcp/boundary.js +131 -0
- package/lib/mcp/client.js +270 -0
- package/lib/mcp/oauth.js +134 -0
- package/lib/memory.js +209 -0
- package/lib/metrics.js +37 -2
- package/lib/payload.js +54 -0
- package/lib/permission-rules.js +401 -0
- package/lib/permissions.js +100 -10
- package/lib/pricing.js +67 -0
- package/lib/proc.js +62 -0
- package/lib/prompts.js +84 -5
- package/lib/sandbox.js +568 -0
- package/lib/sdk.js +328 -0
- package/lib/secrets.js +211 -0
- package/lib/skills.js +223 -0
- package/lib/subagents.js +516 -0
- package/lib/tool_registry.js +2558 -0
- package/lib/tool_specs.js +222 -2
- package/lib/tools.js +272 -1020
- package/lib/ui/format.js +22 -1
- package/lib/ui/input-field.js +16 -7
- package/lib/ui/status-bar.js +79 -11
- package/lib/ui/theme.js +1 -0
- package/lib/ui/web-activity.js +218 -0
- package/lib/verify.js +229 -0
- package/lib/web-extract.js +213 -0
- package/lib/web-summarize.js +68 -0
- package/package.json +19 -4
- package/scripts/lint.js +57 -0
- package/test/agent-loop.test.js +389 -0
- package/test/background.test.js +414 -0
- package/test/chat.test.js +114 -0
- package/test/checkpoints-agent.test.js +181 -0
- package/test/checkpoints.test.js +650 -0
- package/test/command-registry.test.js +160 -0
- package/test/compact.test.js +116 -0
- package/test/completion-lazy.test.js +52 -0
- package/test/config-merge.test.js +324 -0
- package/test/config-quarantine.test.js +128 -0
- package/test/config-write-guard-allow-anywhere.test.js +56 -0
- package/test/config-write-guard-skip.test.js +46 -0
- package/test/config-write-guard.test.js +153 -0
- package/test/context-split.test.js +215 -0
- package/test/cost-doctor.test.js +142 -0
- package/test/custom-commands-chat.test.js +106 -0
- package/test/custom-commands.test.js +230 -0
- package/test/deny-windows.test.js +120 -0
- package/test/deny.test.js +83 -0
- package/test/download-allow-anywhere.test.js +66 -0
- package/test/download-confine.test.js +153 -0
- package/test/executors.test.js +362 -0
- package/test/extract-tool-calls.test.js +315 -0
- package/test/fetch-url-validation.test.js +219 -0
- package/test/fixtures/tool-calls.js +57 -0
- package/test/fixtures/web-page.js +91 -0
- package/test/git-tools.test.js +384 -0
- package/test/grep-glob-serialize.test.js +242 -0
- package/test/grep-glob.test.js +268 -0
- package/test/harness/README.md +57 -0
- package/test/harness/chat-harness.js +142 -0
- package/test/harness/memwarn-headless-child.js +65 -0
- package/test/harness/mock-llm.js +120 -0
- package/test/harness/mock-mcp-server.js +142 -0
- package/test/harness/sse-server.js +69 -0
- package/test/headless.test.js +203 -0
- package/test/history-utils.test.js +88 -0
- package/test/hooks-agent.test.js +238 -0
- package/test/hooks-verify-sandbox.test.js +232 -0
- package/test/hooks.test.js +216 -0
- package/test/http-get-user-agent.test.js +142 -0
- package/test/images-api.test.js +208 -0
- package/test/images.test.js +238 -0
- package/test/max-iterations.test.js +216 -0
- package/test/mcp-boundary.test.js +57 -0
- package/test/mcp-client.test.js +267 -0
- package/test/mcp-oauth.test.js +86 -0
- package/test/memory-truncation-warning.test.js +222 -0
- package/test/memory.test.js +198 -0
- package/test/native-dispatch.test.js +356 -0
- package/test/output-chokepoint.test.js +188 -0
- package/test/path-guards.test.js +134 -0
- package/test/payload.test.js +99 -0
- package/test/permission-rules-agent.test.js +210 -0
- package/test/permission-rules.test.js +297 -0
- package/test/permissions.test.js +163 -0
- package/test/plan-mode.test.js +167 -0
- package/test/read-paginate.test.js +275 -0
- package/test/readonly-tools.test.js +177 -0
- package/test/result-cap.test.js +233 -0
- package/test/sandbox-agent.test.js +147 -0
- package/test/sandbox-integration.test.js +216 -0
- package/test/sandbox.test.js +408 -0
- package/test/sdk.test.js +234 -0
- package/test/shell-output-cap.test.js +181 -0
- package/test/skills-chat.test.js +110 -0
- package/test/skills.test.js +295 -0
- package/test/smoke.test.js +68 -0
- package/test/status-bar-pause.test.js +164 -0
- package/test/stream-parser.test.js +147 -0
- package/test/subagents-agent.test.js +178 -0
- package/test/subagents.test.js +222 -0
- package/test/tool-registry.test.js +85 -0
- package/test/trim-budget.test.js +101 -0
- package/test/verify-agent.test.js +317 -0
- package/test/verify.test.js +141 -0
- package/test/web-activity-ordering.test.js +194 -0
- package/test/web-activity.test.js +207 -0
- package/test/web-data-extraction-guidance.test.js +71 -0
- package/test/web-extract.test.js +185 -0
- package/test/web-fetch-agent.test.js +291 -0
- package/test/web-fetch-mode.test.js +193 -0
- package/test/web-search.test.js +380 -0
- package/lib/commands.js +0 -1438
|
@@ -17,7 +17,12 @@
|
|
|
17
17
|
"Bash(sed -i \"s/addMessage\\('>>> AI MSG 2'.*$/addMessage\\('>>> AI MSG 2', ['response body 2a', 'response body 2b']\\);\\\\nfor \\(let k = 3; k <= 8; k++\\) { addMessage\\('>>> USER MSG ' + k, ['line body ' + k]\\); addMessage\\('>>> AI MSG ' + k, ['response body ' + k + 'a', 'response body ' + k + 'b']\\); }/\" scroll-capture.js)",
|
|
18
18
|
"Bash(echo \"exit=$?\")",
|
|
19
19
|
"Bash(echo \"---grep done, exit=$?---\")",
|
|
20
|
-
"Bash(grep *)"
|
|
20
|
+
"Bash(grep *)",
|
|
21
|
+
"Bash(npm test *)",
|
|
22
|
+
"Read(//srv/www/ai/**)",
|
|
23
|
+
"Read(//srv/www/ai/cli.semalt.ai/**)",
|
|
24
|
+
"Bash(npm run *)",
|
|
25
|
+
"Bash(— normalized\\\\|mcp)"
|
|
21
26
|
]
|
|
22
27
|
}
|
|
23
28
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
# Green-pipeline gate: lint + tests must pass on every push and PR across the
|
|
4
|
+
# supported OS/Node matrix before changes can land.
|
|
5
|
+
#
|
|
6
|
+
# Supply-chain guardrails (Task 3.2): the project has runtime dependencies
|
|
7
|
+
# (`@modelcontextprotocol/sdk`; plus `@mozilla/readability` + `linkedom` +
|
|
8
|
+
# `turndown` for the web-fetch pipeline, Task W.1). Two checks protect that
|
|
9
|
+
# surface:
|
|
10
|
+
# * `npm ci` installs strictly from the committed package-lock.json and fails
|
|
11
|
+
# if package.json and the lockfile disagree — i.e. lockfile integrity.
|
|
12
|
+
# * `npm audit --omit=dev --audit-level=high` fails the build on a HIGH or
|
|
13
|
+
# CRITICAL advisory in the runtime dependency tree (dev deps excluded; there
|
|
14
|
+
# are none today). Audit-findings policy lives in CLAUDE.md
|
|
15
|
+
# › "Dependency & Supply-Chain Policy".
|
|
16
|
+
|
|
17
|
+
on:
|
|
18
|
+
push:
|
|
19
|
+
branches: [main, master]
|
|
20
|
+
pull_request:
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
lint-and-test:
|
|
24
|
+
name: lint + test (Node ${{ matrix.node }} / ${{ matrix.os }})
|
|
25
|
+
runs-on: ${{ matrix.os }}
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
30
|
+
node: [18, 20]
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- name: Checkout
|
|
34
|
+
uses: actions/checkout@v4
|
|
35
|
+
|
|
36
|
+
- name: Set up Node.js ${{ matrix.node }}
|
|
37
|
+
uses: actions/setup-node@v4
|
|
38
|
+
with:
|
|
39
|
+
node-version: ${{ matrix.node }}
|
|
40
|
+
cache: npm
|
|
41
|
+
|
|
42
|
+
# Lockfile integrity: install strictly from package-lock.json. Fails the
|
|
43
|
+
# build if package.json and the lockfile have drifted apart.
|
|
44
|
+
- name: Install dependencies (npm ci)
|
|
45
|
+
run: npm ci
|
|
46
|
+
|
|
47
|
+
# Supply-chain audit: fail on HIGH/CRITICAL advisories in the runtime
|
|
48
|
+
# (production) dependency tree. See CLAUDE.md for how findings are handled.
|
|
49
|
+
- name: Security audit (npm audit)
|
|
50
|
+
run: npm audit --omit=dev --audit-level=high
|
|
51
|
+
|
|
52
|
+
# Install ripgrep so the grep rg-vs-Node parity tests (Task 2.1) execute
|
|
53
|
+
# rather than skip. ripgrep is an optional accelerator for the `grep`
|
|
54
|
+
# tool, never a runtime dependency — the suite still passes without it.
|
|
55
|
+
- name: Install ripgrep (Linux)
|
|
56
|
+
if: runner.os == 'Linux'
|
|
57
|
+
run: sudo apt-get update && sudo apt-get install -y ripgrep
|
|
58
|
+
- name: Install ripgrep (macOS)
|
|
59
|
+
if: runner.os == 'macOS'
|
|
60
|
+
run: brew install ripgrep
|
|
61
|
+
- name: Install ripgrep (Windows)
|
|
62
|
+
if: runner.os == 'Windows'
|
|
63
|
+
run: choco install ripgrep -y
|
|
64
|
+
|
|
65
|
+
- name: Lint (node --check across all sources)
|
|
66
|
+
run: npm run lint
|
|
67
|
+
|
|
68
|
+
- name: Test (node --test)
|
|
69
|
+
run: npm test
|