@myagentroam/node 0.11.36 → 0.11.38
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/dist/application/execution-lifecycle.js +54 -0
- package/dist/application/node-lifecycle.js +104 -0
- package/dist/application/node-operation-admission.js +51 -0
- package/dist/application/node-operation-contracts.js +1 -0
- package/dist/application/runner-composition.js +22 -0
- package/dist/application/session-projection-composition.js +26 -0
- package/dist/application/workspace-application.js +61 -0
- package/dist/application/workspace-composition.js +21 -0
- package/dist/capabilities.js +2 -3
- package/dist/codex-app-server.js +1 -471
- package/dist/connection/authorization.js +26 -0
- package/dist/{service → connection}/direct-transfer-service.js +1 -1
- package/dist/connection/endpoints.js +32 -0
- package/dist/connector.js +145 -253
- package/dist/control-outbound-scheduler.js +3 -0
- package/dist/database.js +34 -14
- package/dist/git-askpass.js +1 -1
- package/dist/git-execution-helper.js +1 -1
- package/dist/hosting/hosted-conversation-file-identity.js +27 -0
- package/dist/hosting/hosted-conversation-file-operations.js +44 -0
- package/dist/hosting/hosted-conversation-node-service.js +974 -0
- package/dist/hosting/hosted-conversation-runs.js +599 -0
- package/dist/hosting/hosted-conversation-templates.js +280 -0
- package/dist/hosting/hosted-conversation-uploads.js +344 -0
- package/dist/hosting/hosted-conversation-watch.js +194 -0
- package/dist/hosting/runtime-contracts.js +1 -0
- package/dist/runner/abstract-runner.js +4 -13
- package/dist/{claude-agent-sdk.js → runner/claude/claude-agent-sdk.js} +2 -2
- package/dist/runner/claude/conversation-parser.js +2 -1
- package/dist/runner/claude/managed-run-controller.js +6 -7
- package/dist/runner/claude/message-parsers.js +2 -1
- package/dist/runner/claude/native-transcript.js +2 -1
- package/dist/runner/claude/tool-normalizer.js +1 -1
- package/dist/runner/claude-code-runner.js +2 -2
- package/dist/runner/codex/codex-app-server.js +471 -0
- package/dist/runner/codex/conversation-parser.js +4 -2
- package/dist/runner/codex/managed-run-controller.js +7 -9
- package/dist/runner/codex/native-transcript.js +1 -1
- package/dist/runner/codex/tool-normalizer.js +1 -1
- package/dist/runner/codex-runner.js +9 -27
- package/dist/runner/contracts.js +1 -0
- package/dist/runner/mar-agent/conversation-normalizer.js +2 -2
- package/dist/runner/mar-agent/history-projection.js +1 -1
- package/dist/runner/mar-agent/hosted-conversation-runtime.js +6 -10
- package/dist/runner/mar-agent/managed-run-controller.js +85 -61
- package/dist/runner/mar-agent/runtime-model-factory.js +0 -3
- package/dist/runner/mar-agent-runner.js +1 -1
- package/dist/runner/normalization.js +42 -0
- package/dist/runner/opencode/conversation-parser.js +1 -1
- package/dist/runner/opencode/managed-run-controller.js +6 -7
- package/dist/{opencode-server.js → runner/opencode/opencode-server.js} +2 -2
- package/dist/runner/opencode/tool-normalizer.js +1 -1
- package/dist/runner/opencode-runner.js +4 -5
- package/dist/runner/runner-registry.js +4 -1
- package/dist/runtime-state.js +48 -372
- package/dist/service/computer-use-enablement-service.js +1 -1
- package/dist/service/continuous-run-coordinator.js +52 -7
- package/dist/service/conversation-history-service.js +4 -4
- package/dist/service/conversation-hosting-capability-service.js +1 -1
- package/dist/service/conversation-hosting-enablement-service.js +1 -1
- package/dist/service/conversation-hosting-lifecycle-service.js +3 -3
- package/dist/service/conversation-hosting-maintenance-service.js +1 -1
- package/dist/service/conversation-observation.js +1 -1
- package/dist/service/conversation-segment-service.js +1 -1
- package/dist/service/external-session-resume-service.js +47 -27
- package/dist/service/fake-managed-run-service.js +3 -7
- package/dist/service/git-operation-service.js +1 -1
- package/dist/service/goal-continuation-coordinator.js +14 -7
- package/dist/service/mar-agent-model-transport-test-service.js +1 -1
- package/dist/service/native-session-watch-service.js +1 -1
- package/dist/service/node-connection-lifecycle-service.js +6 -3
- package/dist/service/node-control-channel.js +48 -11
- package/dist/service/node-request-service.js +1 -1
- package/dist/service/node-terminal-channel.js +2 -1
- package/dist/service/node-workspace-coordinator.js +3 -2
- package/dist/service/notification-mcp-bridge.js +6 -2
- package/dist/service/recent-run-projection-service.js +1 -1
- package/dist/service/restart-session-restorer.js +1 -1
- package/dist/service/run-event-service.js +49 -42
- package/dist/service/run-workbench-service.js +3 -3
- package/dist/service/runner-interaction-service.js +6 -5
- package/dist/service/runner-service.js +1 -1
- package/dist/service/session-recent-activity.js +2 -1
- package/dist/service/skill-directory-service.js +1 -1
- package/dist/service/skill-install-service.js +2 -2
- package/dist/service/terminal-service.js +1 -1
- package/dist/service/workbench-event-projection.js +3 -2
- package/dist/service/workbench-event-service.js +1 -1
- package/dist/service/workspace-service.js +3 -2
- package/dist/session/attachments.js +110 -0
- package/dist/session/contracts.js +1 -0
- package/dist/{util → session}/conversation-identity.js +1 -1
- package/dist/session/input-validation.js +15 -0
- package/dist/{service → session}/native-session-projection-service.js +40 -11
- package/dist/session/pagination.js +77 -0
- package/dist/{util → session}/runner-native-session-parsers.js +2 -1
- package/dist/session/runtime/approvals.js +90 -0
- package/dist/session/runtime/conversation-projection.js +310 -0
- package/dist/session/runtime/type-guards.js +19 -0
- package/dist/{service → session}/session-catalog-service.js +5 -4
- package/dist/{service → session}/session-command-service.js +3 -3
- package/dist/{service → session}/session-identity-service.js +1 -1
- package/dist/{service → session}/session-lifecycle-service.js +18 -7
- package/dist/{service → session}/session-message-service.js +6 -5
- package/dist/{service → session}/session-presentation-service.js +1 -1
- package/dist/{service → session}/session-query-service.js +2 -2
- package/dist/{service → session}/session-schedule-service.js +2 -2
- package/dist/util/records.js +3 -0
- package/dist/workspace/contracts.js +1 -0
- package/dist/workspace/file-index.js +534 -0
- package/dist/workspace/files.js +466 -0
- package/dist/workspace/git.js +991 -0
- package/dist/workspace/path-access.js +184 -0
- package/dist/workspace/utf8.js +12 -0
- package/dist/{service → workspace}/workspace-change-service.js +45 -21
- package/dist/{service → workspace}/workspace-code-navigation-service.js +6 -6
- package/dist/{service → workspace}/workspace-file-manager-service.js +1 -1
- package/dist/{service → workspace}/workspace-file-service.js +16 -16
- package/dist/{service → workspace}/workspace-git-exclude-service.js +1 -1
- package/dist/{service → workspace}/workspace-queue-workbench-service.js +3 -2
- package/dist/{service → workspace}/workspace-session-service.js +45 -40
- package/dist/{service → workspace}/workspace-upload-service.js +28 -28
- package/dist/{service → workspace}/workspace-watch-service.js +29 -28
- package/dist/{service → workspace}/workspace-workbench-service.js +4 -3
- package/package.json +4 -4
- package/dist/service/hosted-conversation-node-service.js +0 -2252
- package/dist/service/run-domain-state.js +0 -4
- package/dist/service/session-domain-state.js +0 -9
- package/dist/service/workspace-domain-state.js +0 -41
- package/dist/util/node-operation-parsers.js +0 -320
- package/dist/workspace.js +0 -2168
- /package/dist/{connector → application}/node-connector-options.js +0 -0
- /package/dist/{util → connection}/node-operation-data.js +0 -0
- /package/dist/{connector → connection}/node-operation-router.js +0 -0
- /package/dist/{service → hosting}/hosted-conversation-sandbox-profile.js +0 -0
- /package/dist/{service → hosting}/hosted-conversation-store.js +0 -0
- /package/dist/{util → mcp}/secret-environment.js +0 -0
- /package/dist/{claude-channel.js → runner/claude/claude-channel.js} +0 -0
- /package/dist/{util → runner}/personal-instructions.js +0 -0
- /package/dist/{util → runner}/runner-error.js +0 -0
- /package/dist/{service/conversation-work-process.js → session/runtime/work-process.js} +0 -0
- /package/dist/{service → session}/session-context-service.js +0 -0
- /package/dist/{util → workspace}/git-credential-client.js +0 -0
- /package/dist/{service → workspace}/workspace-content-search-service.js +0 -0
- /package/dist/{service → workspace}/workspace-watch-snapshot-service.js +0 -0
package/dist/database.js
CHANGED
|
@@ -3,7 +3,7 @@ import { NODE_SCHEMA_MIGRATION_V18 } from './migrations/v018.js';
|
|
|
3
3
|
import { NODE_SCHEMA_MIGRATION_V19 } from './migrations/v019.js';
|
|
4
4
|
import { NODE_SCHEMA_MIGRATION_V20 } from './migrations/v020.js';
|
|
5
5
|
import { NODE_SCHEMA_MIGRATION_V21 } from './migrations/v021.js';
|
|
6
|
-
import { normalizeSessionPrompt } from './
|
|
6
|
+
import { normalizeSessionPrompt } from './runner/personal-instructions.js';
|
|
7
7
|
import { randomUUID } from 'node:crypto';
|
|
8
8
|
import { closeSync, existsSync, mkdirSync, openSync, rmSync } from 'node:fs';
|
|
9
9
|
import { dirname } from 'node:path';
|
|
@@ -381,7 +381,7 @@ export class NodeDatabase {
|
|
|
381
381
|
.get(sessionId);
|
|
382
382
|
return row === undefined ? undefined : sessionRecord(row);
|
|
383
383
|
}
|
|
384
|
-
movePinnedSession(sessionId, direction) {
|
|
384
|
+
movePinnedSession(sessionId, direction, target) {
|
|
385
385
|
const current = this.raw
|
|
386
386
|
.prepare('SELECT workspace_id, pin_order FROM agent_sessions WHERE id = ?')
|
|
387
387
|
.get(sessionId);
|
|
@@ -389,21 +389,41 @@ export class NodeDatabase {
|
|
|
389
389
|
throw new Error('SESSION_NOT_PINNED');
|
|
390
390
|
const order = numberValue(current, 'pin_order');
|
|
391
391
|
const workspaceId = stringValue(current, 'workspace_id');
|
|
392
|
-
const
|
|
393
|
-
.
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
392
|
+
const destination = target === undefined
|
|
393
|
+
? this.raw
|
|
394
|
+
.prepare(direction === 'up'
|
|
395
|
+
? 'SELECT id, pin_order FROM agent_sessions WHERE workspace_id = ? AND pin_order < ? ORDER BY pin_order DESC LIMIT 1'
|
|
396
|
+
: 'SELECT id, pin_order FROM agent_sessions WHERE workspace_id = ? AND pin_order > ? ORDER BY pin_order ASC LIMIT 1')
|
|
397
|
+
.get(workspaceId, order)
|
|
398
|
+
: this.raw
|
|
399
|
+
.prepare('SELECT id, pin_order FROM agent_sessions WHERE workspace_id = ? AND id = ? AND pin_order IS NOT NULL')
|
|
400
|
+
.get(workspaceId, target.sessionId);
|
|
401
|
+
if (target !== undefined && destination === undefined)
|
|
402
|
+
throw new Error('SESSION_PIN_MOVE_INVALID');
|
|
403
|
+
if (destination === undefined)
|
|
404
|
+
return workspaceId;
|
|
405
|
+
const targetOrder = numberValue(destination, 'pin_order');
|
|
406
|
+
if (targetOrder === order)
|
|
407
|
+
return workspaceId;
|
|
408
|
+
const excludedTargetId = target !== undefined &&
|
|
409
|
+
((targetOrder > order && target.position === 'before') ||
|
|
410
|
+
(targetOrder < order && target.position === 'after'))
|
|
411
|
+
? target.sessionId
|
|
412
|
+
: null;
|
|
413
|
+
const displaced = this.raw
|
|
414
|
+
.prepare(`SELECT id, pin_order FROM agent_sessions WHERE workspace_id = ? AND pin_order BETWEEN ? AND ? AND id != ? AND (? IS NULL OR id != ?) ORDER BY pin_order ${targetOrder < order ? 'DESC' : 'ASC'}`)
|
|
415
|
+
.all(workspaceId, Math.min(order, targetOrder), Math.max(order, targetOrder), sessionId, excludedTargetId, excludedTargetId);
|
|
416
|
+
if (displaced.length === 0)
|
|
398
417
|
return workspaceId;
|
|
399
418
|
this.raw.exec('BEGIN IMMEDIATE');
|
|
400
419
|
try {
|
|
401
|
-
this.raw
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
420
|
+
const update = this.raw.prepare('UPDATE agent_sessions SET pin_order = ? WHERE id = ?');
|
|
421
|
+
let nextOrder = order;
|
|
422
|
+
for (const row of displaced) {
|
|
423
|
+
update.run(nextOrder, stringValue(row, 'id'));
|
|
424
|
+
nextOrder = numberValue(row, 'pin_order');
|
|
425
|
+
}
|
|
426
|
+
update.run(nextOrder, sessionId);
|
|
407
427
|
this.raw.exec('COMMIT');
|
|
408
428
|
}
|
|
409
429
|
catch (error) {
|
package/dist/git-askpass.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gitCredentialRequest } from './
|
|
1
|
+
import { gitCredentialRequest } from './workspace/git-credential-client.js';
|
|
2
2
|
// SSH_ASKPASS points to node itself; NODE_OPTIONS imports this before its prompt argument.
|
|
3
3
|
try {
|
|
4
4
|
const result = await gitCredentialRequest('/passphrase', { id: process.env.MAR_GIT_KEY_ID });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn, execFileSync } from 'node:child_process';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
|
-
import { gitCredentialRequest, originalGitEnvironment } from './
|
|
4
|
+
import { gitCredentialRequest, originalGitEnvironment } from './workspace/git-credential-client.js';
|
|
5
5
|
async function run(command, args, options = {}) {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
7
7
|
const child = spawn(command, args, {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { constants } from 'node:fs';
|
|
2
|
+
import { lstat, open } from 'node:fs/promises';
|
|
3
|
+
export async function assertRegularFile(path, expectedSize) {
|
|
4
|
+
const metadata = await regularFileMetadata(path);
|
|
5
|
+
if (metadata.size !== expectedSize)
|
|
6
|
+
throw new Error('HOSTED_CONVERSATION_FILE_INVALID');
|
|
7
|
+
}
|
|
8
|
+
export async function openRegularFile(path) {
|
|
9
|
+
return open(path, constants.O_RDONLY | constants.O_NOFOLLOW).catch(() => {
|
|
10
|
+
throw new Error('HOSTED_CONVERSATION_FILE_INVALID');
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export async function regularFileMetadata(path) {
|
|
14
|
+
const metadata = await lstat(path).catch(() => {
|
|
15
|
+
throw new Error('HOSTED_CONVERSATION_FILE_INVALID');
|
|
16
|
+
});
|
|
17
|
+
assertRegularFileMetadata(metadata);
|
|
18
|
+
return metadata;
|
|
19
|
+
}
|
|
20
|
+
export function assertRegularFileMetadata(metadata) {
|
|
21
|
+
if (!metadata.isFile() ||
|
|
22
|
+
metadata.isSymbolicLink() ||
|
|
23
|
+
metadata.nlink !== 1 ||
|
|
24
|
+
!Number.isSafeInteger(metadata.size) ||
|
|
25
|
+
metadata.size < 0)
|
|
26
|
+
throw new Error('HOSTED_CONVERSATION_FILE_INVALID');
|
|
27
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Owns file mutation admission and deletion conflict lifetimes. */
|
|
2
|
+
export class HostedConversationFileOperations {
|
|
3
|
+
writes = new Map();
|
|
4
|
+
deletes = new Set();
|
|
5
|
+
busy(conversationId) {
|
|
6
|
+
return this.writes.has(conversationId);
|
|
7
|
+
}
|
|
8
|
+
async write(conversationId, uploadId, operation) {
|
|
9
|
+
const writes = this.writes.get(conversationId) ?? new Set();
|
|
10
|
+
if (uploadId !== undefined && [...writes].some((write) => write.uploadId === uploadId))
|
|
11
|
+
throw new Error('HOSTED_CONVERSATION_FILE_CONFLICT');
|
|
12
|
+
// Admission precedes the operation's first asynchronous preparation.
|
|
13
|
+
const write = {
|
|
14
|
+
...(uploadId === undefined ? {} : { uploadId }),
|
|
15
|
+
completion: Promise.resolve().then(operation)
|
|
16
|
+
};
|
|
17
|
+
writes.add(write);
|
|
18
|
+
this.writes.set(conversationId, writes);
|
|
19
|
+
try {
|
|
20
|
+
return await write.completion;
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
writes.delete(write);
|
|
24
|
+
if (writes.size === 0)
|
|
25
|
+
this.writes.delete(conversationId);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
beginDelete(key) {
|
|
29
|
+
if (this.deletes.has(key))
|
|
30
|
+
throw new Error('HOSTED_CONVERSATION_FILE_CONFLICT');
|
|
31
|
+
this.deletes.add(key);
|
|
32
|
+
}
|
|
33
|
+
endDelete(key) {
|
|
34
|
+
this.deletes.delete(key);
|
|
35
|
+
}
|
|
36
|
+
async wait(conversationId) {
|
|
37
|
+
const writes = this.writes.get(conversationId);
|
|
38
|
+
if (writes)
|
|
39
|
+
await Promise.allSettled([...writes].map((write) => write.completion));
|
|
40
|
+
}
|
|
41
|
+
async close() {
|
|
42
|
+
await Promise.all([...this.writes.keys()].map((id) => this.wait(id)));
|
|
43
|
+
}
|
|
44
|
+
}
|