@causyne/agent 1.10.12 → 1.10.17

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.
Files changed (68) hide show
  1. package/LICENSE +1 -1
  2. package/docs/ARCHITECTURE.md +136 -7
  3. package/docs/SECURITY_REVIEW.md +13 -1
  4. package/docs/THIRD_PARTY_NOTICES.md +43 -10
  5. package/package.json +11 -4
  6. package/src/agentLoop.js +161 -93
  7. package/src/agentProfiles.js +135 -0
  8. package/src/agentProfiles.ts +143 -0
  9. package/src/approvalGrants.js +17 -35
  10. package/src/approvalGrants.ts +54 -0
  11. package/src/auditLog.d.ts +3 -0
  12. package/src/benchmarks/planCache.js +159 -0
  13. package/src/browser/camofoxRuntime.js +93 -0
  14. package/src/browser/camofoxRuntime.ts +112 -0
  15. package/src/browser/causyneBrowser.js +495 -0
  16. package/src/browser/causyneBrowser.ts +594 -0
  17. package/src/browser/searchProviders.js +156 -0
  18. package/src/browser/searchProviders.ts +156 -0
  19. package/src/browser/snapshotWindow.js +28 -0
  20. package/src/browser/snapshotWindow.ts +40 -0
  21. package/src/browser/urlPolicy.js +89 -0
  22. package/src/browser/urlPolicy.ts +89 -0
  23. package/src/checkpoints.js +19 -6
  24. package/src/commands.js +120 -8
  25. package/src/config.d.ts +2 -0
  26. package/src/cortex/autoCondenser.js +1 -1
  27. package/src/hooks.js +150 -0
  28. package/src/hooks.ts +193 -0
  29. package/src/mcp/mcpClient.js +520 -132
  30. package/src/mcp/mcpClient.ts +584 -0
  31. package/src/mcp/mcpRegistry.js +399 -185
  32. package/src/mcp/mcpRegistry.ts +451 -0
  33. package/src/planCache.js +529 -225
  34. package/src/planCache.ts +840 -0
  35. package/src/plugins/pluginManager.js +460 -0
  36. package/src/plugins/pluginRunner.js +50 -0
  37. package/src/plugins/pluginSkills.js +84 -0
  38. package/src/plugins/pluginSkills.ts +106 -0
  39. package/src/provisioning/capabilityProvisioner.d.ts +10 -0
  40. package/src/provisioning/capabilityProvisioner.js +5 -0
  41. package/src/provisioning/capabilityTools.js +2 -1
  42. package/src/sandbox.js +53 -2
  43. package/src/sessionJournal.js +471 -0
  44. package/src/sessionJournal.ts +496 -0
  45. package/src/sessionStore.js +3 -279
  46. package/src/skillsManager.js +18 -0
  47. package/src/subagentJournal.js +215 -0
  48. package/src/subagentJournal.ts +254 -0
  49. package/src/taskShape.js +179 -198
  50. package/src/taskShape.ts +259 -0
  51. package/src/toolPacks.js +6 -3
  52. package/src/tools/browserAutomator.js +45 -241
  53. package/src/tools/browserAutomator.ts +57 -0
  54. package/src/tools/deferredMcpSearch.js +2 -2
  55. package/src/tools/manageLocalAiDependencies.js +1 -1
  56. package/src/tools/pluginManager.js +61 -0
  57. package/src/tools/registry.js +47 -53
  58. package/src/tools/subagentOrchestrator.js +73 -12
  59. package/src/tools/toolForge.js +47 -95
  60. package/src/tools/webFetch.js +183 -68
  61. package/src/tools/webFetch.ts +185 -0
  62. package/src/tools/webSearch.js +50 -75
  63. package/src/tools/webSearch.ts +56 -0
  64. package/src/types/contracts.js +8 -0
  65. package/src/types/contracts.ts +263 -0
  66. package/src/utils/paths.d.ts +3 -0
  67. package/src/version.d.ts +1 -0
  68. package/src/mcp/jsonRpc.js +0 -165
package/LICENSE CHANGED
@@ -9,7 +9,7 @@ Parameters
9
9
 
10
10
  Licensor: Ikbal Fadilah
11
11
 
12
- Licensed Work: Causyne Agent 1.10.1
12
+ Licensed Work: Causyne Agent 1.10.13
13
13
  The Licensed Work is (c) 2026 Ikbal Fadilah.
14
14
 
15
15
  Additional Use Grant: You may make use of the Licensed Work, provided that
@@ -31,18 +31,147 @@ are application policies and require adversarial review.
31
31
  | Concern | Source |
32
32
  | --- | --- |
33
33
  | Invocation and local session | `entrypoint.js`, `cliMode.js`, `tui/` |
34
- | Orchestration and budgets | `agentLoop.js`, `modelRouter.js`, `tokenTracker.js` |
34
+ | Orchestration and budgets | `agentLoop.js`, `agentProfiles.ts`, `subagentJournal.ts`, `modelRouter.js`, `tokenTracker.js` |
35
35
  | Host execution | `tools/registry.js`, `sandbox.js`, `execSafe.js` |
36
36
  | Models | `providers/`, `modelCatalogue.js` |
37
37
  | Context and memory | `memory.js`, `memoryManager.js`, `contextManager.js`, `cortex/` |
38
- | Recovery | `checkpoints.js`, `gitSnapshot.js`, `sessionStore.js` |
39
- | Extensions | `mcpClient.js`, `skillsManager.js`, `toolPacks.js`, user skills and Tool Forge |
38
+ | Recovery | `checkpoints.js`, `gitSnapshot.js`, `sessionJournal.ts`, `sessionStore.js` |
39
+ | Extensions | `mcp/`, `plugins/`, `hooks.ts`, `skillsManager.js`, `toolPacks.js` |
40
40
  | Readable interpreter source | `src/tool-scripts/` |
41
41
 
42
- The current implementation remains JavaScript/ESM on Node.js 24+. The accepted
43
- language direction is incremental strict TypeScript. Runtime validation is
44
- still needed at model, filesystem, subprocess and extension boundaries.
45
- Rust is a possible narrow native worker later; no Rust rewrite is underway.
42
+ The shipping runtime is ESM on Node.js 24+. Incremental strict TypeScript
43
+ migration is active: `tsconfig.runtime.json` emits readable JavaScript beside
44
+ strict TypeScript runtime modules, shared contracts live under `src/types/`,
45
+ and retained JavaScript has a separately named migration ratchet. Session,
46
+ plugin-skill, task-shape, delegated-agent, hook, approval-grant, plan-cache and
47
+ MCP boundaries now compile from strict TypeScript.
48
+ Runtime validation is still required at model, filesystem, subprocess and
49
+ extension boundaries. Rust is reserved for a measured, narrow native worker;
50
+ no Rust rewrite is underway.
51
+
52
+ ## Tool and extension boundaries
53
+
54
+ Tool schemas are assembled once from native tools, explicitly enabled plugins,
55
+ and granted MCP servers. Denied tools are removed before the model sees them,
56
+ native names win collisions, and large capability groups remain deferred until
57
+ the task shape or `tool_search` makes them relevant.
58
+
59
+ Local plugins use a static `plugin.json` manifest. Creating a plugin leaves it
60
+ disabled. Enabling it pins a digest of every file the plugin process may read;
61
+ any later manifest, source, helper or asset change revokes trust. Discovery
62
+ validates static manifests and hashes bytes without importing JavaScript, so
63
+ code cannot run during pre-trust initialization. Reviewed plugins may contribute
64
+ namespaced, progressively disclosed Markdown skills; these remain inert data
65
+ and disappear from the catalogue if the digest changes. A plugin tool runs in a
66
+ separate Node process with the permission model enabled and only its declared
67
+ workspace, network, or subprocess capabilities. Plugin calls still pass through
68
+ Causyne's sandbox and approval gates.
69
+
70
+ MCP uses the official Model Context Protocol client packages rather than a
71
+ project-specific JSON-RPC implementation. It supports local stdio servers and
72
+ remote Streamable HTTP servers, with legacy SSE fallback when configured for
73
+ automatic negotiation. The SDK owns initialization, capability negotiation,
74
+ protocol framing, request cancellation, and transport shutdown. Causyne adds
75
+ connection timeouts, bounded output, current-workspace roots, concurrent
76
+ discovery, `tools/list_changed` refresh, structured content handling, and
77
+ namespaced access to server resources and prompts.
78
+
79
+ Each MCP grant is bound to a SHA-256 digest of the complete server definition.
80
+ Changing a command, URL, environment, header, working directory, timeout,
81
+ protocol mode, or tool filter invalidates the old grant. Disconnect and revoke
82
+ also invalidate an in-flight handshake so a stale connection cannot become
83
+ active afterward. Per-server include and exclude patterns limit which
84
+ capabilities enter the model's catalogue. Connection state distinguishes
85
+ disabled, connecting, connected, failed, and authentication-required servers;
86
+ one failing server does not prevent native tools or other MCP servers from
87
+ loading. Static bearer or custom headers may be configured locally. Interactive
88
+ browser OAuth is not implemented yet; an HTTP 401 is surfaced as
89
+ `needs_auth` instead of being reported as a generic transport failure.
90
+
91
+ ## Agent browser boundary
92
+
93
+ Causyne's web foundation has two layers. Lightweight TypeScript search and
94
+ fetch clients work without a browser runtime. Rendered navigation uses a
95
+ dedicated in-process Camoufox adapter derived from the locally reviewed Camofox
96
+ Browser source. The adapter is deliberately smaller than the reference service:
97
+ it does not import an HTTP server, inbound port, cloud deployment layer, VNC,
98
+ telemetry, remote WebSocket control, or OpenClaw integration.
99
+
100
+ Camoufox and Playwright are exact-pinned optional capability packages installed
101
+ into the user's private Causyne capability directory only after an explicit
102
+ browser capability grant. Causyne does not download a browser binary. Advanced
103
+ rendered browsing requires a separately installed Camoufox bundle selected by
104
+ `CAUSYNE_CAMOFOX_EXECUTABLE` or discovered from a standard system location.
105
+ The main npm package therefore stays small and web search remains useful when
106
+ the optional rendered browser is absent.
107
+
108
+ The browser runs headless by default with WebRTC blocked and a Causyne-owned
109
+ profile. It provides tabs, navigation, accessibility snapshots with bounded
110
+ pagination, stable element references, form interaction, bounded extraction,
111
+ and atomic downloads restricted to the selected workspace. Search first uses
112
+ bounded DuckDuckGo HTML and Bing RSS providers, then uses rendered provider
113
+ pages when the optional browser is available. Failures remain visible after
114
+ every provider is exhausted instead of being replaced with fabricated results.
115
+
116
+ Every top-level navigation and browser subresource passes through the public
117
+ URL policy. The policy accepts only HTTP(S), rejects embedded credentials,
118
+ resolves hostnames before access, and blocks loopback, private, link-local,
119
+ multicast, reserved, local, internal, and metadata addresses. Redirects in the
120
+ non-browser fetch path are revalidated one at a time. Responses and extracted
121
+ text are bounded, and network downloads require the existing approval gate.
122
+ These controls reduce SSRF and unbounded-output risk while preserving normal
123
+ public-web use from the user's selected workspace.
124
+
125
+ User-defined subagent profiles are static JSON manifests under the local Causyne
126
+ state directory. A profile supplies bounded instructions, an allowlist of tools,
127
+ and hard step/token ceilings. It cannot widen its own scope, cannot recursively
128
+ delegate, and does not load executable project code. Calls may narrow a
129
+ profile's tool scope or budgets, but cannot exceed them.
130
+
131
+ Completed delegated runs write a separate append-only JSONL sidechain under the
132
+ local Causyne state directory. The parent receives only the worker's final
133
+ result, while the bounded sidechain retains its messages and outcome for local
134
+ inspection. A torn final append preserves earlier complete events.
135
+
136
+ Hooks are user-owned argv arrays stored in the local Causyne configuration.
137
+ They never pass through a shell and project repositories are not searched for
138
+ startup hooks. `PreToolUse` runs after the built-in sandbox and before an
139
+ approval prompt; exit code 2 denies, and any other failure fails closed.
140
+ `PostToolUse` can annotate a result or reject it without rewriting history.
141
+
142
+ Host execution remains the current architecture because Causyne must operate in
143
+ the directory and desktop environment the user selected. Container work is
144
+ deferred and is not part of the present implementation plan.
145
+
146
+ ## Durable sessions
147
+
148
+ Each workspace-scoped conversation is stored as an append-only JSONL event
149
+ journal. Reads project `session.created`, `messages.appended`,
150
+ `messages.windowed`, and explicit replacement events into the current session.
151
+ A torn final append preserves prior complete events, while complete corruption
152
+ fails safely. Legacy per-session JSON and global history files migrate on read.
153
+ The compatibility `sessionStore.js` entry keeps existing callers stable while
154
+ the strict TypeScript journal emits the JavaScript used at runtime.
155
+
156
+ ## Plan cache and context pressure
157
+
158
+ Completed multi-step runs teach argument-free plan templates. Lookup tries an
159
+ indexed exact signature first, then bounded lexical similarity only for a task
160
+ shape with enough confidence. Latency, hit type and recent hit rate are recorded;
161
+ lookup temporarily cools down when a populated cache repeatedly misses while
162
+ new successful plans may continue warming it. Persisted plans and metrics are
163
+ validated before entering the typed runtime; malformed entries are ignored.
164
+ `/plans import` accepts sanitized
165
+ offline samples for known workloads, and `/plans` exposes the measurements.
166
+ `npm run benchmark:plan-cache` measures exact lookup, fuzzy lookup, misses and
167
+ prewarming at bounded cache sizes in an isolated temporary state directory. It
168
+ is a synthetic cache microbenchmark, not evidence for model accuracy, token
169
+ cost, or end-to-end latency claims from the research paper.
170
+
171
+ Context uses per-tool result budgets, oversized-result snipping, decay, a bounded
172
+ sliding window, and structural summaries. Full tool output is spilled before it
173
+ is shortened. Material compaction is recorded in the audit log, and summary
174
+ collapse emits a quiet terminal notice so context loss is visible.
46
175
 
47
176
  ## Removed boundaries
48
177
 
@@ -1,6 +1,6 @@
1
1
  # Security review and migration status
2
2
 
3
- Review date: 2026-10-19. This is a scoped source and package review, not a
3
+ Review date: 2026-10-21. This is a scoped source and package review, not a
4
4
  claim that Causyne Agent is free from vulnerabilities.
5
5
 
6
6
  ## OpenSSF records
@@ -65,6 +65,18 @@ The active source takes a different architecture and distribution path:
65
65
  - `web_fetch` downloads and curated game-asset downloads require the highest
66
66
  approval class. Curated assets are size-limited, constrained to catalog URLs,
67
67
  protected from output path traversal, and are not automatically extracted.
68
+ - Web search uses bounded HTTP providers without requiring a browser binary.
69
+ Interactive rendered browsing uses an outbound, in-process Camoufox adapter.
70
+ Causyne does not run Camofox Browser's server, inbound port, remote control,
71
+ VNC, telemetry, cloud deployment, or OpenClaw integration. Optional launcher
72
+ packages require an explicit capability grant. Causyne never downloads the
73
+ Camoufox browser binary; an existing external installation must be selected
74
+ through `CAUSYNE_CAMOFOX_EXECUTABLE` or a standard system location.
75
+ - Browser navigation and subresources accept only public HTTP(S) destinations.
76
+ Hostnames are resolved and checked against private, loopback, link-local,
77
+ multicast, reserved, local, internal, and metadata ranges. Non-browser
78
+ redirects are checked at every hop. Downloads are bounded, atomic, restricted
79
+ to the selected workspace, and remain in the highest approval class.
68
80
  - The package allowlist excludes the legacy archive, Android source, private
69
81
  operating documents, credentials, installers, bytecode, and generated
70
82
  tarballs.
@@ -1,6 +1,6 @@
1
1
  # Third-party software review
2
2
 
3
- Review date: 2026-10-19.
3
+ Review date: 2026-10-21.
4
4
 
5
5
  Causyne Agent's npm package declares third-party packages as dependencies; it
6
6
  does not bundle their source into the project tarball. Each dependency remains
@@ -9,22 +9,55 @@ license identifiers:
9
9
 
10
10
  | License expression | Lockfile package entries |
11
11
  | --- | ---: |
12
- | Apache-2.0 | 21 |
13
- | MIT | 9 |
12
+ | Apache-2.0 | 25 |
13
+ | MIT | 20 |
14
+ | ISC | 2 |
14
15
 
15
- The lockfile contained 30 dependency entries in total. Three are production
16
- entries; development and platform-specific optional entries account for the
17
- rest. npm's audit metadata reported 12 installed packages.
16
+ The lockfile contained 47 dependency entries in total. Development and
17
+ platform-specific optional entries account for most of the graph.
18
18
 
19
- The direct runtime dependencies are `acorn-walk` and `commander`. Direct
20
- development dependencies are `@babel/parser`, `@types/node`, `acorn`, and
21
- `typescript`. Exact versions and integrity hashes are recorded in
22
- `package-lock.json`.
19
+ The direct runtime dependencies are `@modelcontextprotocol/client`,
20
+ `acorn-walk`, and `commander`. Direct development dependencies are
21
+ `@babel/parser`, `@modelcontextprotocol/node`, `@modelcontextprotocol/server`,
22
+ `@types/node`, `acorn`, `typescript`, and `zod`. The three direct MCP packages
23
+ are licensed under Apache-2.0. Exact versions, transitive dependencies, license
24
+ identifiers, and integrity hashes are recorded in `package-lock.json`.
23
25
 
24
26
  No dependency in the reviewed main lockfile was marked with an install script.
25
27
  Optional capability dependencies are installed only after approval into a
26
28
  separate local environment and are not covered by the main lockfile review.
27
29
 
30
+ The optional browser capability installs `camoufox-js` 0.11.5 under MPL-2.0
31
+ and `playwright-core` 1.58.0 under Apache-2.0. They remain separate packages in
32
+ the user's local capability directory and are not copied into Causyne Agent's
33
+ npm tarball. Causyne does not download or bundle the Camoufox browser runtime.
34
+
35
+ The snapshot windowing and external executable bridge in `src/browser/` are
36
+ adapted from the MIT-licensed Camofox Browser project at source commit
37
+ `2c0036a8b18bf9cd983376751ff4d52dfd9add0f`. Its required notice is:
38
+
39
+ > MIT License
40
+ >
41
+ > Copyright (c) 2025 Jo, Inc
42
+ >
43
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
44
+ > of this software and associated documentation files (the "Software"), to deal
45
+ > in the Software without restriction, including without limitation the rights
46
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
47
+ > copies of the Software, and to permit persons to whom the Software is
48
+ > furnished to do so, subject to the following conditions:
49
+ >
50
+ > The above copyright notice and this permission notice shall be included in all
51
+ > copies or substantial portions of the Software.
52
+ >
53
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59
+ > SOFTWARE.
60
+
28
61
  Repository scanning found no third-party copyright header or license marker in
29
62
  the project-authored source and skill files. That negative scan alone cannot
30
63
  establish authorship or permission. On 2026-10-19, the licensor confirmed that
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@causyne/agent",
3
- "version": "1.10.12",
3
+ "version": "1.10.17",
4
4
  "description": "Agentic AI for software, tools, and computer workflows",
5
5
  "main": "bin/causyne.js",
6
6
  "type": "module",
@@ -23,12 +23,15 @@
23
23
  "scripts": {
24
24
  "start": "node ./bin/causyne.js",
25
25
  "test": "node --test --import ./tests/helpers/isolateState.js \"tests/**/*.test.js\"",
26
- "build": "node scripts/compile_skills.js",
26
+ "build": "node scripts/compile_skills.js && tsc -p tsconfig.runtime.json",
27
+ "benchmark:plan-cache": "node src/benchmarks/planCache.js",
27
28
  "check:release": "node scripts/check_release.js",
28
29
  "check:public": "npm run check:release && node scripts/check_public_release.js",
29
30
  "prepublishOnly": "npm run check:public && npm test && npm run typecheck:strict",
30
31
  "typecheck": "tsc -p tsconfig.json",
31
- "typecheck:strict": "tsc -p tsconfig.strict.json"
32
+ "typecheck:ts": "tsc -p tsconfig.strict.json",
33
+ "typecheck:js-ratchet": "tsc -p tsconfig.js-ratchet.json",
34
+ "typecheck:strict": "npm run typecheck:ts && npm run typecheck:js-ratchet"
32
35
  },
33
36
  "engines": {
34
37
  "node": ">=24.0.0"
@@ -50,14 +53,18 @@
50
53
  "url": "https://github.com/ikbal-causyne/causyne-agent/issues"
51
54
  },
52
55
  "dependencies": {
56
+ "@modelcontextprotocol/client": "2.3.1",
53
57
  "acorn-walk": "^8.3.5",
54
58
  "commander": "^11.1.0"
55
59
  },
56
60
  "devDependencies": {
57
61
  "@babel/parser": "^8.0.7",
62
+ "@modelcontextprotocol/node": "2.1.1",
63
+ "@modelcontextprotocol/server": "2.3.1",
58
64
  "@types/node": "^22.20.2",
59
65
  "acorn": "^8.18.0",
60
- "typescript": "^7.0.2"
66
+ "typescript": "^7.0.2",
67
+ "zod": "4.6.7"
61
68
  },
62
69
  "private": false
63
70
  }