@myagentroam/node 0.9.62 → 0.9.65
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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/dist/capabilities.js +110 -2
- package/dist/claude-agent-sdk.js +330 -2
- package/dist/claude-channel.js +44 -2
- package/dist/codex-app-server.js +510 -2
- package/dist/config.js +106 -2
- package/dist/connector/node-connector-options.js +1 -2
- package/dist/connector/node-operation-router.js +22 -2
- package/dist/connector.js +1736 -2
- package/dist/control-outbound-scheduler.js +153 -2
- package/dist/database.js +639 -2
- package/dist/fake-runner.js +129 -2
- package/dist/git-askpass.js +12 -0
- package/dist/git-execution-helper.js +266 -0
- package/dist/health.js +3 -2
- package/dist/main.js +57 -2
- package/dist/mcp-installation-model.js +1 -2
- package/dist/migrations/v004.js +55 -3
- package/dist/migrations/v005.js +13 -3
- package/dist/migrations/v006.js +90 -3
- package/dist/migrations/v007.js +22 -3
- package/dist/migrations/v008.js +18 -3
- package/dist/migrations/v009.js +70 -4
- package/dist/migrations/v010.js +43 -3
- package/dist/migrations/v011.js +20 -3
- package/dist/migrations/v012.js +8 -0
- package/dist/native-jsonl-reader.js +186 -2
- package/dist/native-session-history.js +1143 -2
- package/dist/opencode-runtime.js +80 -2
- package/dist/opencode-server.js +259 -2
- package/dist/operational.js +122 -2
- package/dist/process-tree.js +18 -2
- package/dist/ripgrep-binary.js +31 -2
- package/dist/rotating-log.js +67 -2
- package/dist/runner/abstract-runner.js +260 -2
- package/dist/runner/claude/managed-run-controller.js +355 -2
- package/dist/runner/claude/tool-normalizer.js +120 -2
- package/dist/runner/claude-code-runner.js +303 -2
- package/dist/runner/codex/composer-image-markers.js +8 -2
- package/dist/runner/codex/conversation-parser.js +913 -2
- package/dist/runner/codex/managed-run-controller.js +494 -2
- package/dist/runner/codex/tool-normalizer.js +214 -2
- package/dist/runner/codex-runner.js +585 -2
- package/dist/runner/fake-test-runner.js +47 -2
- package/dist/runner/mar-agent/conversation-normalizer.js +644 -2
- package/dist/runner/mar-agent/executor-stdio-client-transport.js +139 -2
- package/dist/runner/mar-agent/generated-images.js +41 -2
- package/dist/runner/mar-agent/history-projection.js +106 -2
- package/dist/runner/mar-agent/hosted-conversation-runtime.js +446 -2
- package/dist/runner/mar-agent/managed-run-controller.js +785 -2
- package/dist/runner/mar-agent/mcp-client-pool.js +233 -2
- package/dist/runner/mar-agent/runtime-model-factory.js +326 -2
- package/dist/runner/mar-agent-runner.js +458 -2
- package/dist/runner/opencode/conversation-parser.js +221 -2
- package/dist/runner/opencode/managed-run-controller.js +588 -2
- package/dist/runner/opencode/tool-normalizer.js +80 -2
- package/dist/runner/opencode-runner.js +426 -2
- package/dist/runner/runner-registry.js +87 -2
- package/dist/runner-command-engine.js +71 -2
- package/dist/runner-profiles.js +323 -2
- package/dist/runner-usage.js +190 -2
- package/dist/runtime-command-detector.js +73 -2
- package/dist/runtime-model.js +1 -2
- package/dist/runtime-state.js +1509 -2
- package/dist/service/attachment-domain-state.js +7 -2
- package/dist/service/bubblewrap-sandbox-executor.js +543 -2
- package/dist/service/continuous-run-coordinator.js +425 -2
- package/dist/service/conversation-history-service.js +552 -2
- package/dist/service/conversation-hosting-capability-service.js +61 -2
- package/dist/service/conversation-hosting-enablement-service.js +91 -2
- package/dist/service/conversation-hosting-maintenance-service.js +174 -2
- package/dist/service/conversation-segment-service.js +162 -2
- package/dist/service/conversation-template-node-service.js +992 -2
- package/dist/service/external-session-resume-service.js +152 -2
- package/dist/service/fake-managed-run-service.js +60 -2
- package/dist/service/git-execution-service.js +418 -0
- package/dist/service/git-operation-service.js +57 -0
- package/dist/service/hosted-conversation-node-service.js +1982 -2
- package/dist/service/hosted-conversation-store.js +1405 -2
- package/dist/service/managed-runner-session-service.js +35 -2
- package/dist/service/mar-agent-model-transport-test-service.js +88 -2
- package/dist/service/mcp-installation-verifier.js +87 -2
- package/dist/service/mcp-node-operation-service.js +90 -2
- package/dist/service/mission-mcp-server.js +124 -2
- package/dist/service/mission-mcp-stdio.js +40 -2
- package/dist/service/mission-runtime.js +142 -2
- package/dist/service/native-session-projection-service.js +274 -2
- package/dist/service/native-session-watch-service.js +683 -2
- package/dist/service/node-connection-lifecycle-service.js +88 -2
- package/dist/service/node-control-channel.js +85 -2
- package/dist/service/node-control-message-service.js +109 -2
- package/dist/service/node-request-service.js +62 -2
- package/dist/service/node-run-event-bridge.js +88 -2
- package/dist/service/node-terminal-channel.js +202 -2
- package/dist/service/node-upgrade-coordinator.js +137 -2
- package/dist/service/node-workspace-coordinator.js +97 -2
- package/dist/service/recent-run-projection-service.js +99 -2
- package/dist/service/run-attachment-service.js +321 -2
- package/dist/service/run-domain-state.js +4 -2
- package/dist/service/run-event-service.js +246 -2
- package/dist/service/run-ownership-policy.js +22 -2
- package/dist/service/run-workbench-service.js +120 -2
- package/dist/service/runner-channel-message-service.js +20 -2
- package/dist/service/runner-interaction-service.js +243 -2
- package/dist/service/runner-service.js +69 -2
- package/dist/service/runtime-credential-control-service.js +95 -2
- package/dist/service/session-catalog-service.js +404 -2
- package/dist/service/session-command-service.js +125 -2
- package/dist/service/session-context-service.js +128 -2
- package/dist/service/session-domain-state.js +9 -2
- package/dist/service/session-identity-service.js +86 -2
- package/dist/service/session-lifecycle-service.js +248 -2
- package/dist/service/session-message-service.js +270 -2
- package/dist/service/session-presentation-service.js +43 -2
- package/dist/service/session-query-service.js +82 -2
- package/dist/service/session-watch-slot-coordinator.js +21 -2
- package/dist/service/skill-directory-service.js +238 -2
- package/dist/service/skill-install-service.js +434 -2
- package/dist/service/skill-node-operation-service.js +206 -2
- package/dist/service/terminal-relay-state.js +3 -2
- package/dist/service/terminal-service.js +90 -2
- package/dist/service/web-search-error.js +40 -2
- package/dist/service/workbench-event-service.js +21 -2
- package/dist/service/workbench-manifest-service.js +69 -2
- package/dist/service/workspace-change-service.js +290 -2
- package/dist/service/workspace-content-search-service.js +457 -2
- package/dist/service/workspace-domain-state.js +41 -2
- package/dist/service/workspace-file-service.js +150 -2
- package/dist/service/workspace-git-exclude-service.js +119 -2
- package/dist/service/workspace-queue-workbench-service.js +176 -2
- package/dist/service/workspace-service.js +92 -2
- package/dist/service/workspace-session-service.js +154 -2
- package/dist/service/workspace-upload-service.js +262 -2
- package/dist/service/workspace-watch-controller.js +68 -2
- package/dist/service/workspace-watch-service.js +170 -2
- package/dist/service/workspace-watch-snapshot-service.js +218 -2
- package/dist/service/workspace-workbench-service.js +239 -2
- package/dist/service.js +91 -2
- package/dist/storage.js +32 -2
- package/dist/supervisor.js +136 -2
- package/dist/terminal.js +496 -2
- package/dist/util/git-credential-client.js +32 -0
- package/dist/util/node-operation-data.js +9 -2
- package/dist/util/node-operation-parsers.js +382 -2
- package/dist/util/personal-instructions.js +34 -2
- package/dist/util/runner-error.js +70 -2
- package/dist/util/runner-native-session-parsers.js +510 -2
- package/dist/util/safe-error.js +8 -2
- package/dist/util/secret-environment.js +25 -2
- package/dist/workspace.js +1793 -2
- package/package.json +11 -8
- package/vendor/ripgrep/darwin-arm64/rg +0 -0
- package/vendor/ripgrep/darwin-x64/rg +0 -0
- package/vendor/ripgrep/manifest.json +12 -0
- package/README.md +0 -42
- package/dist/event-buffer.js +0 -2
- package/dist/migrations/v001.js +0 -107
- package/dist/migrations/v002.js +0 -2
- package/dist/migrations/v003.js +0 -2
- package/dist/service/mcp-package-installer.js +0 -2
package/dist/config.js
CHANGED
|
@@ -1,2 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { dirname, isAbsolute, relative, resolve, sep, win32 } from 'node:path';
|
|
4
|
+
export function nodeConfigPath() {
|
|
5
|
+
return resolve(process.env['MAR_NODE_CONFIG'] ?? 'data/mar-node.json');
|
|
6
|
+
}
|
|
7
|
+
export async function loadNodeConfig(path = nodeConfigPath()) {
|
|
8
|
+
const parsed = JSON.parse(await readFile(path, 'utf8'));
|
|
9
|
+
if (typeof parsed !== 'object' ||
|
|
10
|
+
parsed === null ||
|
|
11
|
+
!('serverUrl' in parsed) ||
|
|
12
|
+
typeof parsed.serverUrl !== 'string' ||
|
|
13
|
+
'databasePath' in parsed ||
|
|
14
|
+
('allowedRoots' in parsed &&
|
|
15
|
+
(!Array.isArray(parsed.allowedRoots) ||
|
|
16
|
+
!parsed.allowedRoots.every((root) => typeof root === 'string')))) {
|
|
17
|
+
throw new Error('NODE_CONFIG_INVALID');
|
|
18
|
+
}
|
|
19
|
+
const input = parsed;
|
|
20
|
+
const optionalString = (name) => typeof input[name] === 'string' ? input[name] : undefined;
|
|
21
|
+
const nodeId = optionalString('nodeId');
|
|
22
|
+
const credential = optionalString('credential');
|
|
23
|
+
const registrationToken = optionalString('registrationToken');
|
|
24
|
+
const dataDirectory = optionalString('dataDirectory');
|
|
25
|
+
const allowedRoots = Array.isArray(input['allowedRoots'])
|
|
26
|
+
? input['allowedRoots']
|
|
27
|
+
: defaultAllowedRoots();
|
|
28
|
+
const conversationHosting = parseConversationHosting(input['conversationHosting']);
|
|
29
|
+
return {
|
|
30
|
+
serverUrl: parsed.serverUrl,
|
|
31
|
+
allowedRoots,
|
|
32
|
+
...(nodeId === undefined ? {} : { nodeId }),
|
|
33
|
+
...(credential === undefined ? {} : { credential }),
|
|
34
|
+
...(registrationToken === undefined ? {} : { registrationToken }),
|
|
35
|
+
...(dataDirectory === undefined ? {} : { dataDirectory }),
|
|
36
|
+
...(conversationHosting === undefined ? {} : { conversationHosting })
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Uses the Node service account's scope when no Workspace roots are configured. */
|
|
40
|
+
export function defaultAllowedRoots(platform = process.platform, homePath = homedir(), currentDirectory = process.cwd()) {
|
|
41
|
+
return platform === 'win32' ? [win32.parse(currentDirectory).root] : [homePath];
|
|
42
|
+
}
|
|
43
|
+
export function nodeDatabasePath(config, configPath = nodeConfigPath()) {
|
|
44
|
+
return resolve(nodeDataDirectory(config, configPath), 'node-runtime.sqlite');
|
|
45
|
+
}
|
|
46
|
+
export function nodeDataDirectory(config, configPath = nodeConfigPath()) {
|
|
47
|
+
if (config.dataDirectory !== undefined)
|
|
48
|
+
return resolve(dirname(configPath), config.dataDirectory);
|
|
49
|
+
return resolve(dirname(configPath));
|
|
50
|
+
}
|
|
51
|
+
export function hostedConversationStorePath(config, configPath = nodeConfigPath()) {
|
|
52
|
+
const hosting = config.conversationHosting;
|
|
53
|
+
if (hosting?.enabled !== true)
|
|
54
|
+
return undefined;
|
|
55
|
+
const configured = hosting.storeDirectory;
|
|
56
|
+
if (!validStoreDirectory(configured))
|
|
57
|
+
throw new Error('NODE_CONFIG_INVALID');
|
|
58
|
+
const dataDirectory = nodeDataDirectory(config, configPath);
|
|
59
|
+
const store = resolve(dataDirectory, configured);
|
|
60
|
+
const relation = relative(dataDirectory, store);
|
|
61
|
+
if (relation.length === 0 || relation === '..' || relation.startsWith(`..${sep}`))
|
|
62
|
+
throw new Error('NODE_CONFIG_INVALID');
|
|
63
|
+
return store;
|
|
64
|
+
}
|
|
65
|
+
/** Credentials are always written with owner-only POSIX permissions where supported. */
|
|
66
|
+
export async function saveNodeConfig(config, path = nodeConfigPath()) {
|
|
67
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
68
|
+
await writeFile(path, `${JSON.stringify(config, undefined, 2)}\n`, { mode: 0o600 });
|
|
69
|
+
if (process.platform !== 'win32') {
|
|
70
|
+
await chmod(path, 0o600);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function parseConversationHosting(value) {
|
|
74
|
+
if (value === undefined)
|
|
75
|
+
return undefined;
|
|
76
|
+
if (typeof value !== 'object' ||
|
|
77
|
+
value === null ||
|
|
78
|
+
Array.isArray(value) ||
|
|
79
|
+
typeof value['enabled'] !== 'boolean' ||
|
|
80
|
+
Object.keys(value).some((key) => key !== 'enabled' && key !== 'storeDirectory' && key !== 'inactiveRetentionDays'))
|
|
81
|
+
throw new Error('NODE_CONFIG_INVALID');
|
|
82
|
+
const enabled = value['enabled'];
|
|
83
|
+
const storeDirectory = value['storeDirectory'];
|
|
84
|
+
const inactiveRetentionDays = value['inactiveRetentionDays'] ?? 60;
|
|
85
|
+
if (storeDirectory !== undefined &&
|
|
86
|
+
(typeof storeDirectory !== 'string' || !validStoreDirectory(storeDirectory)))
|
|
87
|
+
throw new Error('NODE_CONFIG_INVALID');
|
|
88
|
+
if (!Number.isInteger(inactiveRetentionDays) ||
|
|
89
|
+
inactiveRetentionDays < 1 ||
|
|
90
|
+
inactiveRetentionDays > 365)
|
|
91
|
+
throw new Error('NODE_CONFIG_INVALID');
|
|
92
|
+
if (enabled && storeDirectory === undefined)
|
|
93
|
+
throw new Error('NODE_CONFIG_INVALID');
|
|
94
|
+
return {
|
|
95
|
+
enabled,
|
|
96
|
+
...(storeDirectory === undefined ? {} : { storeDirectory }),
|
|
97
|
+
inactiveRetentionDays: inactiveRetentionDays
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function validStoreDirectory(value) {
|
|
101
|
+
if (typeof value !== 'string' || value.trim() !== value || value.length === 0)
|
|
102
|
+
return false;
|
|
103
|
+
if (isAbsolute(value) || value === '.' || value === '..')
|
|
104
|
+
return false;
|
|
105
|
+
return !value.split('/').some((part) => part.length === 0 || part === '.' || part === '..');
|
|
106
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export{};
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** Exact allow-list dispatcher for protocol-defined Node operations. */
|
|
2
|
+
export class NodeOperationRouter {
|
|
3
|
+
handlers = new Map();
|
|
4
|
+
register(operation, handler) {
|
|
5
|
+
if (this.handlers.has(operation))
|
|
6
|
+
throw new Error(`NODE_OPERATION_ALREADY_REGISTERED:${operation}`);
|
|
7
|
+
this.handlers.set(operation, handler);
|
|
8
|
+
}
|
|
9
|
+
registerAll(handlers) {
|
|
10
|
+
for (const [operation, handler] of Object.entries(handlers))
|
|
11
|
+
this.register(operation, handler);
|
|
12
|
+
}
|
|
13
|
+
has(operation) {
|
|
14
|
+
return this.handlers.has(operation);
|
|
15
|
+
}
|
|
16
|
+
execute(operation, data) {
|
|
17
|
+
const handler = this.handlers.get(operation);
|
|
18
|
+
if (handler === undefined)
|
|
19
|
+
return Promise.reject(new Error('OPERATION_UNSUPPORTED'));
|
|
20
|
+
return Promise.resolve(handler(data));
|
|
21
|
+
}
|
|
22
|
+
}
|