@myagentroam/node 0.9.8 → 0.9.10
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/capabilities.js +2 -92
- package/dist/claude-agent-sdk.js +2 -330
- package/dist/claude-channel.js +2 -44
- package/dist/codex-app-server.js +2 -503
- package/dist/config.js +2 -56
- package/dist/connector/node-connector-options.js +2 -1
- package/dist/connector/node-operation-router.js +2 -22
- package/dist/connector.js +2 -841
- package/dist/control-outbound-scheduler.js +2 -154
- package/dist/database.js +2 -1418
- package/dist/event-buffer.js +2 -19
- package/dist/fake-runner.js +2 -129
- package/dist/health.js +2 -3
- package/dist/main.js +2 -54
- package/dist/migrations/v001.js +3 -144
- package/dist/migrations/v002.js +2 -143
- package/dist/migrations/v003.js +2 -44
- package/dist/migrations/v004.js +34 -30
- package/dist/native-jsonl-reader.js +2 -186
- package/dist/native-session-history.js +2 -1119
- package/dist/opencode-runtime.js +2 -80
- package/dist/opencode-server.js +2 -263
- package/dist/operational.js +2 -122
- package/dist/process-tree.js +2 -18
- package/dist/rotating-log.js +2 -67
- package/dist/runner/abstract-runner.js +2 -232
- package/dist/runner/claude/managed-run-controller.js +2 -345
- package/dist/runner/claude-code-runner.js +2 -303
- package/dist/runner/codex/composer-image-markers.js +2 -0
- package/dist/runner/codex/conversation-parser.js +2 -861
- package/dist/runner/codex/managed-run-controller.js +2 -460
- package/dist/runner/codex-runner.js +2 -628
- package/dist/runner/fake-test-runner.js +2 -47
- package/dist/runner/opencode/conversation-parser.js +2 -221
- package/dist/runner/opencode/managed-run-controller.js +2 -537
- package/dist/runner/opencode-runner.js +2 -448
- package/dist/runner/runner-registry.js +2 -90
- package/dist/runner-command-engine.js +2 -70
- package/dist/runner-profiles.js +2 -215
- package/dist/runner-usage.js +2 -190
- package/dist/runtime-command-detector.js +2 -73
- package/dist/runtime-state.js +2 -973
- package/dist/service/attachment-domain-state.js +2 -7
- package/dist/service/conversation-history-service.js +2 -457
- package/dist/service/conversation-segment-service.js +2 -162
- package/dist/service/external-session-resume-service.js +2 -118
- package/dist/service/fake-managed-run-service.js +2 -60
- package/dist/service/managed-runner-session-service.js +2 -35
- package/dist/service/mcp-installation-verifier.js +2 -87
- package/dist/service/mcp-node-operation-service.js +2 -90
- package/dist/service/mcp-package-installer.js +2 -136
- package/dist/service/native-session-projection-service.js +2 -280
- package/dist/service/native-session-watch-service.js +2 -383
- package/dist/service/node-connection-lifecycle-service.js +2 -83
- package/dist/service/node-control-channel.js +2 -85
- package/dist/service/node-control-message-service.js +2 -107
- package/dist/service/node-request-service.js +2 -52
- package/dist/service/node-run-event-bridge.js +2 -83
- package/dist/service/node-terminal-channel.js +2 -182
- package/dist/service/node-upgrade-coordinator.js +2 -137
- package/dist/service/node-workspace-coordinator.js +2 -70
- package/dist/service/recent-run-projection-service.js +2 -0
- package/dist/service/run-attachment-service.js +2 -194
- package/dist/service/run-domain-state.js +2 -4
- package/dist/service/run-event-service.js +2 -193
- package/dist/service/run-workbench-service.js +2 -104
- package/dist/service/runner-channel-message-service.js +2 -20
- package/dist/service/runner-interaction-service.js +2 -243
- package/dist/service/runner-service.js +2 -71
- package/dist/service/session-catalog-service.js +2 -224
- package/dist/service/session-command-service.js +2 -76
- package/dist/service/session-context-service.js +2 -101
- package/dist/service/session-domain-state.js +2 -9
- package/dist/service/session-identity-service.js +2 -86
- package/dist/service/session-lifecycle-service.js +2 -240
- package/dist/service/session-message-service.js +2 -173
- package/dist/service/session-presentation-service.js +2 -43
- package/dist/service/session-query-service.js +2 -82
- package/dist/service/skill-directory-service.js +2 -238
- package/dist/service/skill-install-service.js +2 -434
- package/dist/service/skill-node-operation-service.js +2 -206
- package/dist/service/terminal-relay-state.js +2 -3
- package/dist/service/terminal-service.js +2 -52
- package/dist/service/workbench-event-service.js +2 -19
- package/dist/service/workbench-manifest-service.js +2 -69
- package/dist/service/workspace-change-service.js +2 -86
- package/dist/service/workspace-content-search-service.js +2 -477
- package/dist/service/workspace-domain-state.js +2 -41
- package/dist/service/workspace-file-service.js +2 -122
- package/dist/service/workspace-git-exclude-service.js +2 -119
- package/dist/service/workspace-queue-workbench-service.js +2 -304
- package/dist/service/workspace-service.js +2 -69
- package/dist/service/workspace-session-service.js +2 -139
- package/dist/service/workspace-upload-service.js +2 -262
- package/dist/service/workspace-watch-service.js +2 -146
- package/dist/service/workspace-workbench-service.js +2 -405
- package/dist/service.js +2 -38
- package/dist/storage.js +2 -32
- package/dist/supervisor.js +2 -136
- package/dist/terminal.js +2 -416
- package/dist/util/node-operation-parsers.js +2 -382
- package/dist/util/personal-instructions.js +2 -31
- package/dist/util/runner-error.js +2 -52
- package/dist/util/runner-native-session-parsers.js +2 -490
- package/dist/util/safe-error.js +2 -5
- package/dist/util/secret-environment.js +2 -25
- package/dist/workspace.js +2 -1519
- package/package.json +3 -3
- package/dist/capabilities.d.ts +0 -12
- package/dist/claude-agent-sdk.d.ts +0 -92
- package/dist/claude-channel.d.ts +0 -28
- package/dist/codex-app-server.d.ts +0 -133
- package/dist/config.d.ts +0 -18
- package/dist/connector/node-connector-options.d.ts +0 -27
- package/dist/connector/node-operation-router.d.ts +0 -9
- package/dist/connector.d.ts +0 -93
- package/dist/control-outbound-scheduler.d.ts +0 -29
- package/dist/database.d.ts +0 -305
- package/dist/event-buffer.d.ts +0 -9
- package/dist/fake-runner.d.ts +0 -42
- package/dist/health.d.ts +0 -4
- package/dist/main.d.ts +0 -2
- package/dist/migrations/v001.d.ts +0 -3
- package/dist/migrations/v002.d.ts +0 -4
- package/dist/migrations/v003.d.ts +0 -4
- package/dist/migrations/v004.d.ts +0 -4
- package/dist/native-jsonl-reader.d.ts +0 -35
- package/dist/native-session-history.d.ts +0 -126
- package/dist/opencode-runtime.d.ts +0 -33
- package/dist/opencode-server.d.ts +0 -49
- package/dist/operational.d.ts +0 -39
- package/dist/process-tree.d.ts +0 -9
- package/dist/rotating-log.d.ts +0 -17
- package/dist/runner/abstract-runner.d.ts +0 -172
- package/dist/runner/claude/managed-run-controller.d.ts +0 -51
- package/dist/runner/claude-code-runner.d.ts +0 -72
- package/dist/runner/codex/conversation-parser.d.ts +0 -59
- package/dist/runner/codex/managed-run-controller.d.ts +0 -90
- package/dist/runner/codex-runner.d.ts +0 -103
- package/dist/runner/fake-test-runner.d.ts +0 -26
- package/dist/runner/opencode/conversation-parser.d.ts +0 -31
- package/dist/runner/opencode/managed-run-controller.d.ts +0 -82
- package/dist/runner/opencode-runner.d.ts +0 -71
- package/dist/runner/runner-registry.d.ts +0 -19
- package/dist/runner-command-engine.d.ts +0 -28
- package/dist/runner-profiles.d.ts +0 -15
- package/dist/runner-usage.d.ts +0 -33
- package/dist/runtime-command-detector.d.ts +0 -3
- package/dist/runtime-state.d.ts +0 -169
- package/dist/service/attachment-domain-state.d.ts +0 -7
- package/dist/service/conversation-history-service.d.ts +0 -43
- package/dist/service/conversation-segment-service.d.ts +0 -20
- package/dist/service/external-session-resume-service.d.ts +0 -34
- package/dist/service/fake-managed-run-service.d.ts +0 -28
- package/dist/service/managed-runner-session-service.d.ts +0 -12
- package/dist/service/mcp-installation-verifier.d.ts +0 -9
- package/dist/service/mcp-node-operation-service.d.ts +0 -11
- package/dist/service/mcp-package-installer.d.ts +0 -8
- package/dist/service/native-session-projection-service.d.ts +0 -52
- package/dist/service/native-session-watch-service.d.ts +0 -62
- package/dist/service/node-connection-lifecycle-service.d.ts +0 -35
- package/dist/service/node-control-channel.d.ts +0 -32
- package/dist/service/node-control-message-service.d.ts +0 -27
- package/dist/service/node-request-service.d.ts +0 -14
- package/dist/service/node-run-event-bridge.d.ts +0 -40
- package/dist/service/node-terminal-channel.d.ts +0 -29
- package/dist/service/node-upgrade-coordinator.d.ts +0 -29
- package/dist/service/node-workspace-coordinator.d.ts +0 -29
- package/dist/service/run-attachment-service.d.ts +0 -38
- package/dist/service/run-domain-state.d.ts +0 -4
- package/dist/service/run-event-service.d.ts +0 -33
- package/dist/service/run-workbench-service.d.ts +0 -25
- package/dist/service/runner-channel-message-service.d.ts +0 -13
- package/dist/service/runner-interaction-service.d.ts +0 -39
- package/dist/service/runner-service.d.ts +0 -46
- package/dist/service/session-catalog-service.d.ts +0 -45
- package/dist/service/session-command-service.d.ts +0 -24
- package/dist/service/session-context-service.d.ts +0 -35
- package/dist/service/session-domain-state.d.ts +0 -9
- package/dist/service/session-identity-service.d.ts +0 -24
- package/dist/service/session-lifecycle-service.d.ts +0 -31
- package/dist/service/session-message-service.d.ts +0 -33
- package/dist/service/session-presentation-service.d.ts +0 -34
- package/dist/service/session-query-service.d.ts +0 -35
- package/dist/service/skill-directory-service.d.ts +0 -20
- package/dist/service/skill-install-service.d.ts +0 -21
- package/dist/service/skill-node-operation-service.d.ts +0 -44
- package/dist/service/terminal-relay-state.d.ts +0 -6
- package/dist/service/terminal-service.d.ts +0 -12
- package/dist/service/workbench-event-service.d.ts +0 -9
- package/dist/service/workbench-manifest-service.d.ts +0 -90
- package/dist/service/workspace-change-service.d.ts +0 -9
- package/dist/service/workspace-content-search-service.d.ts +0 -14
- package/dist/service/workspace-domain-state.d.ts +0 -79
- package/dist/service/workspace-file-service.d.ts +0 -18
- package/dist/service/workspace-git-exclude-service.d.ts +0 -4
- package/dist/service/workspace-queue-workbench-service.d.ts +0 -86
- package/dist/service/workspace-service.d.ts +0 -15
- package/dist/service/workspace-session-service.d.ts +0 -23
- package/dist/service/workspace-upload-service.d.ts +0 -39
- package/dist/service/workspace-watch-service.d.ts +0 -23
- package/dist/service/workspace-workbench-service.d.ts +0 -58
- package/dist/service.d.ts +0 -4
- package/dist/storage.d.ts +0 -2
- package/dist/supervisor.d.ts +0 -1
- package/dist/terminal.d.ts +0 -133
- package/dist/util/node-operation-parsers.d.ts +0 -92
- package/dist/util/personal-instructions.d.ts +0 -2
- package/dist/util/runner-error.d.ts +0 -6
- package/dist/util/runner-native-session-parsers.d.ts +0 -74
- package/dist/util/safe-error.d.ts +0 -2
- package/dist/util/secret-environment.d.ts +0 -1
- package/dist/workspace.d.ts +0 -217
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { NodeAgentSession } from '../database.js';
|
|
2
|
-
import { WorkspaceDomainState } from './workspace-domain-state.js';
|
|
3
|
-
export interface WorkspaceSessionServiceOptions {
|
|
4
|
-
discover: (workspaceId: string) => Promise<readonly NodeAgentSession[]>;
|
|
5
|
-
listPage: (workspaceId: string) => Promise<unknown>;
|
|
6
|
-
active: (workspaceId: string) => boolean;
|
|
7
|
-
emitRevision: (workspaceId: string, revision: number) => void;
|
|
8
|
-
onPending?: (workspaceId: string, waitMs: number) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare class WorkspaceSessionService {
|
|
11
|
-
private readonly state;
|
|
12
|
-
private readonly options;
|
|
13
|
-
private readonly cacheGenerations;
|
|
14
|
-
constructor(state: WorkspaceDomainState, options: WorkspaceSessionServiceOptions);
|
|
15
|
-
ensureWatch(workspaceId: string): void;
|
|
16
|
-
stopWatch(workspaceId: string): void;
|
|
17
|
-
cached(workspaceId: string): Promise<readonly NodeAgentSession[]>;
|
|
18
|
-
clear(): void;
|
|
19
|
-
invalidate(workspaceId: string): void;
|
|
20
|
-
private bumpCacheGeneration;
|
|
21
|
-
private refreshWatch;
|
|
22
|
-
private performRefresh;
|
|
23
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { NodeMessageAttachmentInput, NodeWorkspace } from '../database.js';
|
|
2
|
-
import { WorkspaceDomainState } from './workspace-domain-state.js';
|
|
3
|
-
export interface ResolvedComposerAttachment {
|
|
4
|
-
readonly attachment: NodeMessageAttachmentInput;
|
|
5
|
-
readonly path: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class WorkspaceUploadService {
|
|
8
|
-
private readonly state;
|
|
9
|
-
private readonly onCompleted;
|
|
10
|
-
constructor(state: WorkspaceDomainState, onCompleted: (workspaceId: string) => void);
|
|
11
|
-
preflight(workspace: NodeWorkspace, input: Record<string, unknown>): Promise<({
|
|
12
|
-
name: string;
|
|
13
|
-
status: string;
|
|
14
|
-
path: null;
|
|
15
|
-
} | {
|
|
16
|
-
name: string;
|
|
17
|
-
status: import("../workspace.js").WorkspaceUploadPreflightStatus;
|
|
18
|
-
path: string | null;
|
|
19
|
-
})[]>;
|
|
20
|
-
create(workspace: NodeWorkspace, input: Record<string, unknown>): Promise<UploadStatus>;
|
|
21
|
-
write(input: Record<string, unknown>): Promise<UploadStatus>;
|
|
22
|
-
status(uploadId: unknown): UploadStatus;
|
|
23
|
-
complete(uploadId: unknown): Promise<UploadStatus>;
|
|
24
|
-
cancel(uploadId: unknown): Promise<void>;
|
|
25
|
-
resolve(workspaceId: string, ids: readonly string[]): Promise<readonly ResolvedComposerAttachment[]>;
|
|
26
|
-
consume(ids: readonly string[]): Promise<void>;
|
|
27
|
-
shutdown(): Promise<void>;
|
|
28
|
-
private require;
|
|
29
|
-
private remove;
|
|
30
|
-
private removeCompleted;
|
|
31
|
-
private attachmentTarget;
|
|
32
|
-
}
|
|
33
|
-
interface UploadStatus {
|
|
34
|
-
readonly uploadId: string;
|
|
35
|
-
readonly path: string;
|
|
36
|
-
readonly receivedBytes: number;
|
|
37
|
-
readonly size: number;
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { WorkspaceDomainState, type WorkspaceWatch } from './workspace-domain-state.js';
|
|
2
|
-
export declare class WorkspaceWatchService {
|
|
3
|
-
private readonly state;
|
|
4
|
-
private readonly onSessionWatchRequired;
|
|
5
|
-
private readonly onSessionWatchUnused;
|
|
6
|
-
constructor(state: WorkspaceDomainState, onSessionWatchRequired: (workspaceId: string) => void, onSessionWatchUnused: (workspaceId: string) => void);
|
|
7
|
-
parseTopics(input: Record<string, unknown>): WorkspaceWatch['topics'];
|
|
8
|
-
key(input: Record<string, unknown>): string;
|
|
9
|
-
sessionHash(input: Record<string, unknown>): string;
|
|
10
|
-
connectionId(input: Record<string, unknown>): string;
|
|
11
|
-
create(workspaceId: string, watchId: string, sessionHash: string, workbenchConnectionId: string, nodeGeneration: string, topics: WorkspaceWatch['topics']): WorkspaceWatch;
|
|
12
|
-
renew(workspaceId: string, key: string, watchId?: string): WorkspaceWatch | undefined;
|
|
13
|
-
matches(workspaceId: string, key: string, watchId: string): boolean;
|
|
14
|
-
existing(workspaceId: string, key: string): WorkspaceWatch | undefined;
|
|
15
|
-
remove(workspaceId: string, key: string): void;
|
|
16
|
-
clear(workspaceId: string): void;
|
|
17
|
-
clearAll(): void;
|
|
18
|
-
nextRevision(workspaceId: string): number;
|
|
19
|
-
nextSnapshotSequence(): number;
|
|
20
|
-
topicActive(workspaceId: string, topic: 'files' | 'changes' | 'sessions'): boolean;
|
|
21
|
-
activeWatches(workspaceId: string): readonly WorkspaceWatch[];
|
|
22
|
-
private expiryTimer;
|
|
23
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { NodeOperationHandler } from '../connector/node-operation-router.js';
|
|
2
|
-
import type { NodeWorkspace } from '../database.js';
|
|
3
|
-
import { WorkspaceChangeService } from './workspace-change-service.js';
|
|
4
|
-
import { WorkspaceFileService } from './workspace-file-service.js';
|
|
5
|
-
import { WorkspaceUploadService } from './workspace-upload-service.js';
|
|
6
|
-
import { WorkspaceWatchService } from './workspace-watch-service.js';
|
|
7
|
-
export interface WorkspaceWorkbenchServiceOptions {
|
|
8
|
-
readonly requireWorkspace: (workspaceId: unknown) => NodeWorkspace;
|
|
9
|
-
readonly watch: WorkspaceWatchService;
|
|
10
|
-
readonly files: WorkspaceFileService;
|
|
11
|
-
readonly uploads: WorkspaceUploadService;
|
|
12
|
-
readonly changes: WorkspaceChangeService;
|
|
13
|
-
readonly listSessions: (workspaceId: string) => Promise<unknown>;
|
|
14
|
-
readonly invalidate: (workspaceId: string) => void;
|
|
15
|
-
readonly nodeId: () => string;
|
|
16
|
-
readonly nodeGeneration: () => string;
|
|
17
|
-
readonly emitWatchEvent: (payload: unknown) => void;
|
|
18
|
-
}
|
|
19
|
-
export declare class WorkspaceWorkbenchService {
|
|
20
|
-
private readonly options;
|
|
21
|
-
private readonly contentSearch;
|
|
22
|
-
private readonly topicRefreshes;
|
|
23
|
-
private readonly dirtyTopics;
|
|
24
|
-
constructor(options: WorkspaceWorkbenchServiceOptions);
|
|
25
|
-
operations(): Readonly<Record<string, NodeOperationHandler>>;
|
|
26
|
-
refreshTopic(workspaceId: string, topic: 'sessions' | 'files' | 'changes'): Promise<void>;
|
|
27
|
-
private emitTopicFailure;
|
|
28
|
-
private performTopicRefresh;
|
|
29
|
-
private watch;
|
|
30
|
-
private unwatch;
|
|
31
|
-
private accepted;
|
|
32
|
-
private createInitialSnapshots;
|
|
33
|
-
private emitSnapshot;
|
|
34
|
-
private deliverSnapshot;
|
|
35
|
-
private listFiles;
|
|
36
|
-
private readFile;
|
|
37
|
-
private searchFiles;
|
|
38
|
-
private mutateFile;
|
|
39
|
-
private searchContent;
|
|
40
|
-
private preflight;
|
|
41
|
-
private createUpload;
|
|
42
|
-
private writeUpload;
|
|
43
|
-
private completeUpload;
|
|
44
|
-
private cancelUpload;
|
|
45
|
-
private currentChanges;
|
|
46
|
-
private readFileContent;
|
|
47
|
-
private changeDiff;
|
|
48
|
-
private restoreChange;
|
|
49
|
-
private gitRepository;
|
|
50
|
-
private refs;
|
|
51
|
-
private gitRefs;
|
|
52
|
-
private gitHistory;
|
|
53
|
-
private gitCommitFiles;
|
|
54
|
-
private gitCommitFileDiff;
|
|
55
|
-
private gitCommitFileContent;
|
|
56
|
-
private diff;
|
|
57
|
-
private gitWorkspace;
|
|
58
|
-
}
|
package/dist/service.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function systemdUnit(executable: string, configPath: string, entrypoint?: string, writablePaths?: readonly string[]): string;
|
|
2
|
-
export declare function windowsServiceDefinition(executable: string, configPath: string, entrypoint?: string): string;
|
|
3
|
-
export declare function writeServiceDefinition(outputPath: string, executable: string, configPath: string, platform?: NodeJS.Platform, entrypoint?: string, writablePaths?: readonly string[]): Promise<void>;
|
|
4
|
-
export declare function removeServiceDefinition(outputPath: string): Promise<void>;
|
package/dist/storage.d.ts
DELETED
package/dist/supervisor.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function superviseNode(configPath: string, bootstrapEntrypoint: string): Promise<void>;
|
package/dist/terminal.d.ts
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { type TerminalDataFrame } from '@myagentroam/protocol';
|
|
2
|
-
import { type ManagedProcess } from './process-tree.js';
|
|
3
|
-
export type TerminalPlatform = 'linux' | 'win32';
|
|
4
|
-
export type TerminalState = 'RUNNING' | 'EXITED' | 'CLOSED';
|
|
5
|
-
/** The subset of node-pty used by the terminal lifecycle, kept injectable for tests. */
|
|
6
|
-
export interface TerminalPty extends ManagedProcess {
|
|
7
|
-
write(data: string): void;
|
|
8
|
-
resize(cols: number, rows: number): void;
|
|
9
|
-
onData(listener: (data: string) => void): {
|
|
10
|
-
dispose(): void;
|
|
11
|
-
};
|
|
12
|
-
onExit(listener: (event: {
|
|
13
|
-
exitCode: number;
|
|
14
|
-
signal?: number;
|
|
15
|
-
}) => void): {
|
|
16
|
-
dispose(): void;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface TerminalProfile {
|
|
20
|
-
readonly id: string;
|
|
21
|
-
readonly label: string;
|
|
22
|
-
readonly shell: string;
|
|
23
|
-
readonly args: readonly string[];
|
|
24
|
-
readonly isDefault: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface TerminalSpawnOptions {
|
|
27
|
-
readonly name: string;
|
|
28
|
-
readonly cols: number;
|
|
29
|
-
readonly rows: number;
|
|
30
|
-
readonly cwd: string;
|
|
31
|
-
readonly env: Readonly<Record<string, string | undefined>>;
|
|
32
|
-
}
|
|
33
|
-
export type TerminalPtyFactory = (shell: string, args: readonly string[], options: TerminalSpawnOptions) => TerminalPty;
|
|
34
|
-
export interface TerminalManagerOptions {
|
|
35
|
-
readonly platform?: TerminalPlatform;
|
|
36
|
-
/** This is controlled by the Node service, never supplied by a browser request. */
|
|
37
|
-
readonly cwd?: string;
|
|
38
|
-
readonly profiles?: readonly TerminalProfile[];
|
|
39
|
-
readonly maxTerminals?: number;
|
|
40
|
-
readonly maxTerminalsPerWorkspace?: number;
|
|
41
|
-
readonly maxReplayBytes?: number;
|
|
42
|
-
readonly idleTimeoutMs?: number;
|
|
43
|
-
readonly now?: () => number;
|
|
44
|
-
readonly ptyFactory?: TerminalPtyFactory;
|
|
45
|
-
readonly terminate?: (process: ManagedProcess, platform: TerminalPlatform) => Promise<void>;
|
|
46
|
-
}
|
|
47
|
-
export interface TerminalSummary {
|
|
48
|
-
readonly id: string;
|
|
49
|
-
readonly workspaceId: string | null;
|
|
50
|
-
readonly profileId: string;
|
|
51
|
-
readonly state: TerminalState;
|
|
52
|
-
readonly createdAt: number;
|
|
53
|
-
readonly updatedAt: number;
|
|
54
|
-
readonly exitCode: number | null;
|
|
55
|
-
readonly rows: number;
|
|
56
|
-
readonly cols: number;
|
|
57
|
-
readonly latestSequence: number;
|
|
58
|
-
}
|
|
59
|
-
export interface TerminalAttachment {
|
|
60
|
-
readonly attachmentId: string;
|
|
61
|
-
readonly terminalId: string;
|
|
62
|
-
readonly readonly: boolean;
|
|
63
|
-
readonly frames: readonly TerminalDataFrame[];
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Owns Node-local PTY/ConPTY processes and their bounded output replay.
|
|
67
|
-
* Browser relay transport intentionally lives outside this class: callers pass
|
|
68
|
-
* only schema-validated TerminalDataFrame values after Server authorization.
|
|
69
|
-
*/
|
|
70
|
-
export declare class TerminalManager {
|
|
71
|
-
private readonly platform;
|
|
72
|
-
private readonly cwd;
|
|
73
|
-
private readonly profiles;
|
|
74
|
-
private readonly maxTerminals;
|
|
75
|
-
private readonly maxTerminalsPerWorkspace;
|
|
76
|
-
private readonly maxReplayBytes;
|
|
77
|
-
private readonly idleTimeoutMs;
|
|
78
|
-
private readonly now;
|
|
79
|
-
private readonly ptyFactory;
|
|
80
|
-
private readonly terminate;
|
|
81
|
-
private readonly terminals;
|
|
82
|
-
private readonly attachments;
|
|
83
|
-
private readonly frameListeners;
|
|
84
|
-
private readonly summaryListeners;
|
|
85
|
-
private idleTimer;
|
|
86
|
-
constructor(options?: TerminalManagerOptions);
|
|
87
|
-
availableProfiles(): readonly Pick<TerminalProfile, 'id' | 'label' | 'isDefault'>[];
|
|
88
|
-
limits(): {
|
|
89
|
-
readonly maxTerminals: number;
|
|
90
|
-
readonly maxTerminalsPerWorkspace: number;
|
|
91
|
-
readonly maxReplayBytes: number;
|
|
92
|
-
readonly reconnectWindowMs: number;
|
|
93
|
-
};
|
|
94
|
-
open(input?: {
|
|
95
|
-
readonly profileId?: unknown;
|
|
96
|
-
readonly rows?: unknown;
|
|
97
|
-
readonly cols?: unknown;
|
|
98
|
-
readonly cwd?: unknown;
|
|
99
|
-
/** Resolved by NodeConnector; never trusted from a browser directly. */
|
|
100
|
-
readonly workspaceId?: string | null;
|
|
101
|
-
readonly environment?: Readonly<Record<string, string>>;
|
|
102
|
-
}): TerminalSummary;
|
|
103
|
-
list(): readonly TerminalSummary[];
|
|
104
|
-
get(terminalId: string): TerminalSummary;
|
|
105
|
-
/** One attachment may write. A new writer must explicitly take over. */
|
|
106
|
-
authorizeAttach(input: {
|
|
107
|
-
readonly terminalId?: unknown;
|
|
108
|
-
readonly afterSequence?: unknown;
|
|
109
|
-
readonly readonly?: unknown;
|
|
110
|
-
readonly takeover?: unknown;
|
|
111
|
-
}): TerminalAttachment;
|
|
112
|
-
detach(attachmentId: string): void;
|
|
113
|
-
/** Processes data frames from an already-authorized Server relay attachment. */
|
|
114
|
-
acceptFrame(attachmentId: string, frame: unknown): Promise<void>;
|
|
115
|
-
close(terminalId: string): Promise<TerminalSummary>;
|
|
116
|
-
shutdown(): Promise<void>;
|
|
117
|
-
onFrame(listener: (frame: TerminalDataFrame) => void): () => void;
|
|
118
|
-
onSummary(listener: (summary: TerminalSummary) => void): () => void;
|
|
119
|
-
private closeExpired;
|
|
120
|
-
private recordOutput;
|
|
121
|
-
private exited;
|
|
122
|
-
private replayFrames;
|
|
123
|
-
private summary;
|
|
124
|
-
private notifySummary;
|
|
125
|
-
private requireTerminal;
|
|
126
|
-
private runningCount;
|
|
127
|
-
private evictForNewTerminal;
|
|
128
|
-
private evictLeastRecentlyUsed;
|
|
129
|
-
private runningCountForWorkspace;
|
|
130
|
-
private hasAttachment;
|
|
131
|
-
private detachAll;
|
|
132
|
-
private emit;
|
|
133
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { AgentRunStatus, NodeCapabilities, NodeEnvelope } from '@myagentroam/protocol';
|
|
2
|
-
import type { NodeAgentRun, NodeConversationTurn, NodeMessageAttachmentInput } from '../database.js';
|
|
3
|
-
import type { NativeTranscriptToolCall } from '../native-session-history.js';
|
|
4
|
-
export type RunnerImageAttachment = NodeMessageAttachmentInput & {
|
|
5
|
-
readonly mime: 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp';
|
|
6
|
-
};
|
|
7
|
-
export declare const DEFAULT_SESSION_PAGE_SIZE = 10;
|
|
8
|
-
export declare const MAX_SESSION_PAGE_SIZE = 100;
|
|
9
|
-
export declare function sessionPage<T extends {
|
|
10
|
-
readonly id: string;
|
|
11
|
-
readonly lastActivityAt: number;
|
|
12
|
-
readonly pinOrder?: number | null;
|
|
13
|
-
readonly externalDiscovered?: boolean;
|
|
14
|
-
}>(sessions: readonly T[], input: Record<string, unknown>): {
|
|
15
|
-
readonly sessions: readonly T[];
|
|
16
|
-
readonly nextCursor: string | null;
|
|
17
|
-
};
|
|
18
|
-
export declare function parseSessionPageCursor(cursor: string): {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly lastActivityAt: number;
|
|
21
|
-
readonly pinOrder: number | null;
|
|
22
|
-
readonly externalDiscovered: boolean;
|
|
23
|
-
} | undefined;
|
|
24
|
-
export declare function createSessionPageCursor(session: {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
readonly lastActivityAt: number;
|
|
27
|
-
readonly pinOrder?: number | null;
|
|
28
|
-
readonly externalDiscovered?: boolean;
|
|
29
|
-
}): string;
|
|
30
|
-
export declare function compareSessionPageEntries(left: {
|
|
31
|
-
readonly id: string;
|
|
32
|
-
readonly lastActivityAt: number;
|
|
33
|
-
readonly pinOrder?: number | null;
|
|
34
|
-
readonly externalDiscovered?: boolean;
|
|
35
|
-
}, right: {
|
|
36
|
-
readonly id: string;
|
|
37
|
-
readonly lastActivityAt: number;
|
|
38
|
-
readonly pinOrder?: number | null;
|
|
39
|
-
readonly externalDiscovered?: boolean;
|
|
40
|
-
}): number;
|
|
41
|
-
export declare function compactRunnerText(value: string, limit: number): string;
|
|
42
|
-
export declare function compactRunnerValue(value: unknown, limit: number): {
|
|
43
|
-
readonly text: string;
|
|
44
|
-
readonly truncated: boolean;
|
|
45
|
-
};
|
|
46
|
-
export declare function codexTimestamp(value: unknown): number | null;
|
|
47
|
-
export declare function nativePageEnd(cursor: string | undefined, sessionId: string, fallback: number): number;
|
|
48
|
-
export declare function extractClaudeText(message: Record<string, unknown>): string;
|
|
49
|
-
export declare function extractClaudeThinkingSummaries(message: Record<string, unknown>): readonly string[];
|
|
50
|
-
export declare function extractClaudeToolUses(message: Record<string, unknown>): readonly {
|
|
51
|
-
readonly id: string;
|
|
52
|
-
readonly name: string;
|
|
53
|
-
readonly input: unknown;
|
|
54
|
-
readonly command?: string;
|
|
55
|
-
readonly inputTruncated: boolean;
|
|
56
|
-
}[];
|
|
57
|
-
export declare function extractClaudeToolResults(message: Record<string, unknown>): readonly {
|
|
58
|
-
readonly toolUseId: string;
|
|
59
|
-
readonly output: string;
|
|
60
|
-
readonly failed: boolean;
|
|
61
|
-
readonly truncated: boolean;
|
|
62
|
-
}[];
|
|
63
|
-
export declare function claudeContentBlocks(message: Record<string, unknown>): readonly Record<string, unknown>[];
|
|
64
|
-
export declare function isClaudeCommandTool(name: string): boolean;
|
|
65
|
-
export declare function nativeClaudeCommand(entry: NativeTranscriptToolCall): string;
|
|
66
|
-
export declare function boundedConversationItemId(prefix: string, value: string): string;
|
|
67
|
-
export declare function validUserAuthorization(value: unknown, envelope: NodeEnvelope, operation: string, nodeId: string | undefined, now?: number): boolean;
|
|
68
|
-
export declare function isTerminalRunStatus(status: AgentRunStatus): boolean;
|
|
69
|
-
export declare function validSessionOption(value: unknown): boolean;
|
|
70
|
-
export declare function validSessionEffort(value: unknown): boolean;
|
|
71
|
-
export declare function validSessionTitle(value: unknown): boolean;
|
|
72
|
-
export declare function sessionTitleFromFirstMessage(content: string): string;
|
|
73
|
-
export declare function parseComposerAttachmentUpload(input: Record<string, unknown>): {
|
|
74
|
-
readonly id: string;
|
|
75
|
-
readonly name: string;
|
|
76
|
-
readonly mime: string;
|
|
77
|
-
} | undefined;
|
|
78
|
-
export declare function parseComposerAttachmentIds(value: unknown): readonly string[];
|
|
79
|
-
export declare function validComposerAttachmentName(name: string): boolean;
|
|
80
|
-
export declare function isUuid(value: string): boolean;
|
|
81
|
-
export declare function parseMessageAttachments(value: unknown): readonly NodeMessageAttachmentInput[];
|
|
82
|
-
export declare function parseRunnerImageAttachments(value: unknown): readonly RunnerImageAttachment[];
|
|
83
|
-
export declare function isRunnerImageAttachment(attachment: NodeMessageAttachmentInput): attachment is RunnerImageAttachment;
|
|
84
|
-
export declare function isImageAttachment(attachment: NodeMessageAttachmentInput): boolean;
|
|
85
|
-
export declare function withNonImageAttachmentPrompt(input: string, paths: readonly string[]): string;
|
|
86
|
-
export declare function isCanonicalBase64(value: string): boolean;
|
|
87
|
-
export declare function validatedCapabilities(value: unknown): NodeCapabilities;
|
|
88
|
-
export declare function nodeConnectEndpoint(serverUrl: string): string;
|
|
89
|
-
export declare function nodeTerminalConnectEndpoint(serverUrl: string): string;
|
|
90
|
-
export declare function isPlainRecord(value: unknown): value is Record<string, unknown>;
|
|
91
|
-
export declare function isNodeAgentRun(value: unknown): value is NodeAgentRun;
|
|
92
|
-
export declare function isNodeConversationTurn(value: unknown): value is NodeConversationTurn;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { SessionActivityState } from '@myagentroam/protocol';
|
|
2
|
-
import type { NodeAgentSession, NodeConversationItem, NodeConversationTurn } from '../database.js';
|
|
3
|
-
import type { NativeSessionHistory, NativeTranscriptImageAttachment } from '../native-session-history.js';
|
|
4
|
-
export interface SessionContextUsage {
|
|
5
|
-
readonly model: string | null;
|
|
6
|
-
readonly usedTokens: number;
|
|
7
|
-
readonly maxTokens: number;
|
|
8
|
-
readonly percentage: number;
|
|
9
|
-
}
|
|
10
|
-
export type ConversationHistorySource = 'official' | 'native' | 'runtime';
|
|
11
|
-
export interface ConversationHistoryPage {
|
|
12
|
-
readonly turns: readonly NodeConversationTurn[];
|
|
13
|
-
readonly nextCursor: string | null;
|
|
14
|
-
readonly snapshotSequence: number;
|
|
15
|
-
readonly source: ConversationHistorySource;
|
|
16
|
-
readonly readAt: number;
|
|
17
|
-
readonly latestVisibleAt: number;
|
|
18
|
-
readonly deferredOlderHistory?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare function extractId(result: unknown, key: 'thread' | 'turn'): string;
|
|
21
|
-
export declare function settleWithin<T>(promise: Promise<T>, milliseconds: number): Promise<T | undefined>;
|
|
22
|
-
export declare function extractCodexThreads(result: unknown): readonly {
|
|
23
|
-
readonly id: string;
|
|
24
|
-
readonly source: string | undefined;
|
|
25
|
-
readonly derived: boolean;
|
|
26
|
-
readonly cwd: unknown;
|
|
27
|
-
readonly title: string | undefined;
|
|
28
|
-
}[];
|
|
29
|
-
export declare function codexThreadActivity(result: unknown): SessionActivityState;
|
|
30
|
-
export declare function codexActiveTurnId(result: unknown): string | undefined;
|
|
31
|
-
export declare function codexThreadCwd(value: unknown): string;
|
|
32
|
-
export declare function isWithinWorkspace(cwd: string, workspacePath: string): boolean;
|
|
33
|
-
export declare function claudeDiscoveredSession(value: unknown, fallbackCwd: string): {
|
|
34
|
-
readonly externalSessionId: string;
|
|
35
|
-
readonly cwd: string;
|
|
36
|
-
readonly title?: string;
|
|
37
|
-
} | undefined;
|
|
38
|
-
export declare function latestNativeActivity(history: NativeSessionHistory): number;
|
|
39
|
-
export declare function sameContextUsage(left: SessionContextUsage, right: SessionContextUsage): boolean;
|
|
40
|
-
export declare function isNativeHistory(value: unknown): value is NativeSessionHistory;
|
|
41
|
-
export declare function deduplicateDirectSessions<T extends NodeAgentSession>(sessions: readonly T[]): readonly T[];
|
|
42
|
-
export declare function nativeConversationPage(session: NodeAgentSession, history: NativeSessionHistory, input: {
|
|
43
|
-
readonly cursor?: string;
|
|
44
|
-
readonly limit?: number;
|
|
45
|
-
}, runtimeTurns?: readonly NodeConversationTurn[], registerImages?: (images: readonly NativeTranscriptImageAttachment[]) => readonly Record<string, unknown>[]): {
|
|
46
|
-
readonly turns: readonly NodeConversationTurn[];
|
|
47
|
-
readonly nextCursor: string | null;
|
|
48
|
-
};
|
|
49
|
-
export declare function runtimeAssistantProjectionMoreComplete(runtimeTurn: NodeConversationTurn | undefined, projectedItems: readonly NodeConversationItem[]): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Claude JSONL does not retain browser request IDs. While the Node process is alive, match current
|
|
52
|
-
* runtime user messages by content and creation time so native history replaces the optimistic Turn.
|
|
53
|
-
*/
|
|
54
|
-
export declare function nativeUserClientMessageId(entry: Extract<NativeSessionHistory['items'][number], {
|
|
55
|
-
readonly kind: 'message';
|
|
56
|
-
}>, createdAt: number | null, runtimeTurns: readonly NodeConversationTurn[]): string | null;
|
|
57
|
-
/**
|
|
58
|
-
* Normalize the documented App Server `thread/read(includeTurns: true)`
|
|
59
|
-
* result. Only items with a user-visible Workbench representation are kept;
|
|
60
|
-
* raw protocol envelopes are deliberately never exposed to Web.
|
|
61
|
-
*/
|
|
62
|
-
export declare function claudePlanText(text: string): string | undefined;
|
|
63
|
-
export declare function claudeUserInputQuestions(value: Record<string, unknown>): readonly {
|
|
64
|
-
readonly id: string;
|
|
65
|
-
readonly prompt: string;
|
|
66
|
-
readonly input: 'SINGLE_SELECT' | 'MULTI_SELECT' | 'SHORT_TEXT';
|
|
67
|
-
readonly options: readonly {
|
|
68
|
-
readonly value: string;
|
|
69
|
-
readonly label: string;
|
|
70
|
-
readonly description: string | null;
|
|
71
|
-
}[];
|
|
72
|
-
readonly allowOther: boolean;
|
|
73
|
-
readonly multiSelect: boolean;
|
|
74
|
-
}[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function parseSecretEnvironment(value: unknown): Readonly<Record<string, string>>;
|