omnara 0.5.3 → 0.6.1
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/README.md +23 -10
- package/bin/omnara.js +56 -17
- package/package.json +24 -55
- package/dist/auth/auth-provider.d.ts +0 -26
- package/dist/auth/cli-auth-service.d.ts +0 -26
- package/dist/auth/credential-manager.d.ts +0 -13
- package/dist/auth/credentials-store.d.ts +0 -20
- package/dist/auth/ensure-cli-credentials.d.ts +0 -8
- package/dist/auth/login-flow.d.ts +0 -11
- package/dist/auth/loopback-listener.d.ts +0 -20
- package/dist/auth/pkce.d.ts +0 -6
- package/dist/cli.d.ts +0 -3
- package/dist/cli.js +0 -19186
- package/dist/cli.js.map +0 -7
- package/dist/commands/agent.d.ts +0 -9
- package/dist/commands/auth.d.ts +0 -2
- package/dist/commands/daemon.d.ts +0 -2
- package/dist/commands/index.d.ts +0 -4
- package/dist/commands/kill.d.ts +0 -2
- package/dist/config/omnara-config.d.ts +0 -19
- package/dist/daemon/config-store.d.ts +0 -37
- package/dist/daemon/daemon-client.d.ts +0 -27
- package/dist/daemon/daemon-launcher.d.ts +0 -39
- package/dist/daemon/daemon-service.d.ts +0 -30
- package/dist/daemon/directory-registry.d.ts +0 -17
- package/dist/daemon/local-control-server.d.ts +0 -38
- package/dist/daemon/machine-supervisor.d.ts +0 -61
- package/dist/daemon/paths.d.ts +0 -16
- package/dist/daemon/run-daemon.d.ts +0 -1
- package/dist/daemon/session-pid-registry.d.ts +0 -11
- package/dist/daemon/session-runner.d.ts +0 -28
- package/dist/daemon/state-store.d.ts +0 -14
- package/dist/env/env-mode.d.ts +0 -2
- package/dist/http/api-client.d.ts +0 -19
- package/dist/http/machines.d.ts +0 -3
- package/dist/http/user-sessions.d.ts +0 -16
- package/dist/http/workspaces.d.ts +0 -4
- package/dist/index.d.ts +0 -1
- package/dist/orchestrator/agent-orchestrator.d.ts +0 -103
- package/dist/orchestrator/ai-client.d.ts +0 -32
- package/dist/orchestrator/orchestrator-prompt.d.ts +0 -8
- package/dist/orchestrator/orchestrator-prompt.md +0 -222
- package/dist/orchestrator/orchestrator-types.d.ts +0 -168
- package/dist/orchestrator/session.d.ts +0 -82
- package/dist/orchestrator/tools/worker-tools.d.ts +0 -10
- package/dist/orchestrator/utils/completions-manager.d.ts +0 -8
- package/dist/orchestrator/utils/envelope-utils.d.ts +0 -13
- package/dist/orchestrator/utils/index.d.ts +0 -2
- package/dist/orchestrator/utils/session-logger.d.ts +0 -7
- package/dist/orchestrator/utils/worker-events.d.ts +0 -7
- package/dist/orchestrator/utils/worktree-manager.d.ts +0 -51
- package/dist/orchestrator/worker-manager.d.ts +0 -81
- package/dist/orchestrator/worker-types.d.ts +0 -23
- package/dist/orchestrator-prompt.md +0 -222
- package/dist/package-info.d.ts +0 -12
- package/dist/relay/relay-bridge.d.ts +0 -65
- package/dist/relay/relay-service.d.ts +0 -19
- package/dist/schemas/index.d.ts +0 -2
- package/dist/utils/backoff.d.ts +0 -6
- package/dist/utils/browser.d.ts +0 -1
- package/dist/utils/claude-code-check.d.ts +0 -19
- package/dist/utils/executable.d.ts +0 -53
- package/dist/utils/logger.d.ts +0 -143
- package/dist/utils/prompt.d.ts +0 -1
- package/dist/utils/version-check.d.ts +0 -47
- package/dist/utils/websocket.d.ts +0 -5
- package/instrument.mjs +0 -14
- package/scripts/build-executable.ts +0 -244
- package/scripts/copy-assets.mjs +0 -41
- package/scripts/generate-release-json.ts +0 -136
- package/scripts/preinstall.js +0 -141
- package/scripts/test-preinstall.js +0 -124
- package/scripts/upload-release.ts +0 -388
package/dist/commands/agent.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface OrchestratorOptions {
|
|
2
|
-
backendUrl?: string;
|
|
3
|
-
frontendUrl?: string;
|
|
4
|
-
workspaceId?: string;
|
|
5
|
-
userSessionId?: string;
|
|
6
|
-
agentSessionId?: string;
|
|
7
|
-
worktreeName?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function runAgentOrchestrator(options?: OrchestratorOptions): Promise<void>;
|
package/dist/commands/auth.d.ts
DELETED
package/dist/commands/index.d.ts
DELETED
package/dist/commands/kill.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
import type { WorkspaceConfigSchema } from '@omnara/shared-js/schemas';
|
|
3
|
-
declare const OmnaraConfig: z.ZodType<WorkspaceConfigSchema.WorkspaceConfig>;
|
|
4
|
-
export type OmnaraConfig = z.infer<typeof OmnaraConfig>;
|
|
5
|
-
/**
|
|
6
|
-
* Read and parse the omnara.jsonc configuration file
|
|
7
|
-
*
|
|
8
|
-
* @param configPath - Path to the config file (defaults to omnara.jsonc in cwd)
|
|
9
|
-
* @returns Parsed configuration or default config if file doesn't exist
|
|
10
|
-
*/
|
|
11
|
-
export declare function readOmnaraConfig(configPath?: string): Promise<OmnaraConfig>;
|
|
12
|
-
/**
|
|
13
|
-
* Check if worktrees are enabled in the configuration
|
|
14
|
-
*
|
|
15
|
-
* @param config - The omnara configuration
|
|
16
|
-
* @returns true if worktrees should be enabled
|
|
17
|
-
*/
|
|
18
|
-
export declare function isWorktreesEnabled(config: OmnaraConfig): boolean;
|
|
19
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export interface DirectoryEntry {
|
|
2
|
-
id: string;
|
|
3
|
-
path: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
addedAt: string;
|
|
6
|
-
lastUsedAt?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface MachineMetadata {
|
|
9
|
-
id?: string;
|
|
10
|
-
name?: string;
|
|
11
|
-
token?: string;
|
|
12
|
-
lastSeenAt?: string;
|
|
13
|
-
tokenExpiresAt?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface DaemonSettings {
|
|
16
|
-
maxSessions?: number;
|
|
17
|
-
autoUpdateCheckSeconds?: number;
|
|
18
|
-
}
|
|
19
|
-
export interface DaemonConfigData {
|
|
20
|
-
machine?: MachineMetadata;
|
|
21
|
-
directories: DirectoryEntry[];
|
|
22
|
-
settings?: DaemonSettings;
|
|
23
|
-
}
|
|
24
|
-
export declare class DaemonConfigStore {
|
|
25
|
-
private readonly filePath;
|
|
26
|
-
constructor(filePath?: string);
|
|
27
|
-
load(): Promise<DaemonConfigData>;
|
|
28
|
-
save(config: DaemonConfigData): Promise<void>;
|
|
29
|
-
update(mutate: (config: DaemonConfigData) => void | DaemonConfigData): Promise<DaemonConfigData>;
|
|
30
|
-
ensureDirectory(absolutePath: string, options?: {
|
|
31
|
-
label?: string;
|
|
32
|
-
touch?: boolean;
|
|
33
|
-
}): Promise<{
|
|
34
|
-
entry: DirectoryEntry;
|
|
35
|
-
created: boolean;
|
|
36
|
-
}>;
|
|
37
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { DirectoryEntry } from './config-store.js';
|
|
2
|
-
import type { DaemonStatusPayload, LaunchWorkspaceResult } from './local-control-server.js';
|
|
3
|
-
import { DaemonStateStore } from './state-store.js';
|
|
4
|
-
import type { MachineMessageSchema } from '../../../shared-js/dist/schemas/generated.js';
|
|
5
|
-
export declare class DaemonClient {
|
|
6
|
-
private readonly stateStore;
|
|
7
|
-
constructor(stateStore?: DaemonStateStore);
|
|
8
|
-
getStatus(): Promise<DaemonStatusPayload | null>;
|
|
9
|
-
addDirectory(directoryPath: string, label?: string): Promise<{
|
|
10
|
-
directory: DirectoryEntry;
|
|
11
|
-
created: boolean;
|
|
12
|
-
} | null>;
|
|
13
|
-
stop(status?: Exclude<MachineMessageSchema.MachineStatus, 'ONLINE'>): Promise<boolean>;
|
|
14
|
-
launchSession(options: {
|
|
15
|
-
path: string;
|
|
16
|
-
initialPrompt?: string;
|
|
17
|
-
userSessionId?: string;
|
|
18
|
-
worktreeName?: string;
|
|
19
|
-
}): Promise<LaunchWorkspaceResult | null>;
|
|
20
|
-
private getEndpoint;
|
|
21
|
-
private request;
|
|
22
|
-
}
|
|
23
|
-
export declare class HttpError extends Error {
|
|
24
|
-
readonly statusCode: number;
|
|
25
|
-
readonly body?: string | undefined;
|
|
26
|
-
constructor(message: string, statusCode: number, body?: string | undefined);
|
|
27
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '../utils/logger.js';
|
|
2
|
-
import { DaemonConfigStore } from './config-store.js';
|
|
3
|
-
export interface StartDaemonOptions {
|
|
4
|
-
waitForReady?: boolean;
|
|
5
|
-
reason?: string;
|
|
6
|
-
backendUrl?: string;
|
|
7
|
-
frontendUrl?: string;
|
|
8
|
-
logger?: Logger;
|
|
9
|
-
}
|
|
10
|
-
export interface StopDaemonOptions {
|
|
11
|
-
logger?: Logger;
|
|
12
|
-
}
|
|
13
|
-
export interface EnsureDaemonOptions {
|
|
14
|
-
cwd?: string;
|
|
15
|
-
label?: string;
|
|
16
|
-
reason?: string;
|
|
17
|
-
backendUrl?: string;
|
|
18
|
-
frontendUrl?: string;
|
|
19
|
-
logger?: Logger;
|
|
20
|
-
}
|
|
21
|
-
export interface StatusOptions {
|
|
22
|
-
logger?: Logger;
|
|
23
|
-
}
|
|
24
|
-
export interface KillAllOptions {
|
|
25
|
-
logger?: Logger;
|
|
26
|
-
}
|
|
27
|
-
export declare function ensureDaemonForSession(options?: EnsureDaemonOptions): Promise<void>;
|
|
28
|
-
export declare function ensureMachineNameConfigured(configStore: DaemonConfigStore, logger: Logger): Promise<string>;
|
|
29
|
-
export declare function startDaemon(options?: StartDaemonOptions): Promise<boolean>;
|
|
30
|
-
export declare function stopDaemon(options?: StopDaemonOptions): Promise<boolean>;
|
|
31
|
-
export declare function showDaemonStatus(options?: StatusOptions): Promise<void>;
|
|
32
|
-
export declare function killAllDaemonProcesses(options?: KillAllOptions): Promise<void>;
|
|
33
|
-
export declare function killDaemonByState(options?: {
|
|
34
|
-
logger?: Logger;
|
|
35
|
-
dev?: boolean;
|
|
36
|
-
}): Promise<void>;
|
|
37
|
-
export declare function killSessionsByRegistry(options?: {
|
|
38
|
-
logger?: Logger;
|
|
39
|
-
}): Promise<void>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '../utils/logger.js';
|
|
2
|
-
import { DirectoryRegistry } from './directory-registry.js';
|
|
3
|
-
import { DaemonStateStore } from './state-store.js';
|
|
4
|
-
import { MachineSupervisor } from './machine-supervisor.js';
|
|
5
|
-
import type { MachineMessageSchema } from '../../../shared-js/dist/schemas/generated.js';
|
|
6
|
-
export interface DaemonServiceOptions {
|
|
7
|
-
directoryRegistry?: DirectoryRegistry;
|
|
8
|
-
stateStore?: DaemonStateStore;
|
|
9
|
-
machineSupervisor?: MachineSupervisor;
|
|
10
|
-
logger?: Logger;
|
|
11
|
-
}
|
|
12
|
-
export declare class DaemonService {
|
|
13
|
-
private readonly logger;
|
|
14
|
-
private readonly directoryRegistry;
|
|
15
|
-
private readonly stateStore;
|
|
16
|
-
private readonly machineSupervisor;
|
|
17
|
-
private controlHandle;
|
|
18
|
-
private startedAt;
|
|
19
|
-
private stopPromise;
|
|
20
|
-
private resolveStopPromise;
|
|
21
|
-
private stopping;
|
|
22
|
-
constructor(options?: DaemonServiceOptions);
|
|
23
|
-
start(): Promise<void>;
|
|
24
|
-
stop(status?: Exclude<MachineMessageSchema.MachineStatus, 'ONLINE'>): Promise<void>;
|
|
25
|
-
waitForShutdown(): Promise<void>;
|
|
26
|
-
private buildStatusPayload;
|
|
27
|
-
private handleLaunchRequest;
|
|
28
|
-
private persistState;
|
|
29
|
-
private cleanupState;
|
|
30
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DaemonConfigStore, type DirectoryEntry } from './config-store.js';
|
|
2
|
-
export interface DirectoryEnsureOptions {
|
|
3
|
-
label?: string;
|
|
4
|
-
updateLastUsed?: boolean;
|
|
5
|
-
skipValidation?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare class DirectoryRegistry {
|
|
8
|
-
private readonly store;
|
|
9
|
-
constructor(store?: DaemonConfigStore);
|
|
10
|
-
list(): Promise<DirectoryEntry[]>;
|
|
11
|
-
getEntry(directoryPath: string): Promise<DirectoryEntry | null>;
|
|
12
|
-
ensureDirectory(directoryPath: string, options?: DirectoryEnsureOptions): Promise<{
|
|
13
|
-
entry: DirectoryEntry;
|
|
14
|
-
created: boolean;
|
|
15
|
-
}>;
|
|
16
|
-
private assertDirectory;
|
|
17
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '../utils/logger.js';
|
|
2
|
-
import type { DirectoryEntry } from './config-store.js';
|
|
3
|
-
import { DirectoryRegistry } from './directory-registry.js';
|
|
4
|
-
import type { MachineMessageSchema } from '../../../shared-js/dist/schemas/generated.js';
|
|
5
|
-
export interface DaemonStatusPayload {
|
|
6
|
-
pid: number;
|
|
7
|
-
startedAt: string;
|
|
8
|
-
directories: DirectoryEntry[];
|
|
9
|
-
}
|
|
10
|
-
export interface LocalControlServerOptions {
|
|
11
|
-
directoryRegistry: DirectoryRegistry;
|
|
12
|
-
getStatus: () => Promise<DaemonStatusPayload>;
|
|
13
|
-
onStopRequested: (status: Exclude<MachineMessageSchema.MachineStatus, 'ONLINE'>) => Promise<void> | void;
|
|
14
|
-
onLaunchRequested?: (payload: LaunchWorkspacePayload) => Promise<LaunchWorkspaceResult>;
|
|
15
|
-
logger?: Logger;
|
|
16
|
-
}
|
|
17
|
-
export interface LocalControlServerHandle {
|
|
18
|
-
port: number;
|
|
19
|
-
token: string;
|
|
20
|
-
close(): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
export interface LaunchWorkspacePayload {
|
|
23
|
-
path: string;
|
|
24
|
-
initialPrompt?: string;
|
|
25
|
-
userSessionId?: string;
|
|
26
|
-
worktreeName?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface LaunchWorkspaceSuccessPayload {
|
|
29
|
-
user_session_id: string;
|
|
30
|
-
workspace_id: string;
|
|
31
|
-
launch_id: string;
|
|
32
|
-
}
|
|
33
|
-
export interface LaunchWorkspaceResult {
|
|
34
|
-
status: 'ok' | 'error' | string;
|
|
35
|
-
payload?: LaunchWorkspaceSuccessPayload | null;
|
|
36
|
-
error?: string;
|
|
37
|
-
}
|
|
38
|
-
export declare function startLocalControlServer(options: LocalControlServerOptions): Promise<LocalControlServerHandle>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '../utils/logger.js';
|
|
2
|
-
import { DirectoryRegistry } from './directory-registry.js';
|
|
3
|
-
import { DaemonConfigStore } from './config-store.js';
|
|
4
|
-
import type { AuthProvider } from '../auth/auth-provider.js';
|
|
5
|
-
import type { LaunchWorkspaceResult } from './local-control-server.js';
|
|
6
|
-
import type { MachineMessageSchema } from '../../../shared-js/dist/schemas/generated.js';
|
|
7
|
-
export interface MachineSupervisorOptions {
|
|
8
|
-
backendUrl: string;
|
|
9
|
-
frontendUrl?: string;
|
|
10
|
-
directoryRegistry: DirectoryRegistry;
|
|
11
|
-
configStore: DaemonConfigStore;
|
|
12
|
-
authProvider: AuthProvider;
|
|
13
|
-
logger?: Logger;
|
|
14
|
-
}
|
|
15
|
-
export declare class MachineSupervisor {
|
|
16
|
-
private readonly backendUrl;
|
|
17
|
-
private readonly frontendUrl?;
|
|
18
|
-
private readonly directoryRegistry;
|
|
19
|
-
private readonly configStore;
|
|
20
|
-
private readonly authProvider;
|
|
21
|
-
private readonly apiClient;
|
|
22
|
-
private readonly logger;
|
|
23
|
-
private readonly sessionManager;
|
|
24
|
-
private running;
|
|
25
|
-
private stopRequested;
|
|
26
|
-
private loopPromise;
|
|
27
|
-
private websocket;
|
|
28
|
-
private heartbeatTimer;
|
|
29
|
-
private waitingForLogin;
|
|
30
|
-
private machineRegistrationReady;
|
|
31
|
-
constructor(options: MachineSupervisorOptions);
|
|
32
|
-
start(): Promise<void>;
|
|
33
|
-
launchWorkspaceSessionLocal(options: {
|
|
34
|
-
path: string;
|
|
35
|
-
initialPrompt?: string;
|
|
36
|
-
userSessionId?: string;
|
|
37
|
-
worktreeName?: string;
|
|
38
|
-
}): Promise<LaunchWorkspaceResult>;
|
|
39
|
-
stop(status: Exclude<MachineMessageSchema.MachineStatus, 'ONLINE'>): Promise<void>;
|
|
40
|
-
private runLoop;
|
|
41
|
-
private registerMachine;
|
|
42
|
-
private runWebsocket;
|
|
43
|
-
private handleSocketMessage;
|
|
44
|
-
private handleRpcRequest;
|
|
45
|
-
private sendRpcResponse;
|
|
46
|
-
private launchWorkspaceSessionFromRpc;
|
|
47
|
-
private launchWorkspaceSession;
|
|
48
|
-
private ensureWorkspaceForDirectory;
|
|
49
|
-
private ensureWorkspaceWithRetry;
|
|
50
|
-
private ensureUserSessionForWorkspace;
|
|
51
|
-
private buildWorkspaceMetadata;
|
|
52
|
-
private getMachineId;
|
|
53
|
-
private waitForMachineRegistration;
|
|
54
|
-
private startHeartbeatTimer;
|
|
55
|
-
private clearHeartbeatTimer;
|
|
56
|
-
private sendHeartbeat;
|
|
57
|
-
private sendMessage;
|
|
58
|
-
private clearLoginWait;
|
|
59
|
-
private closeWebsocket;
|
|
60
|
-
private recoverMachineRegistration;
|
|
61
|
-
}
|
package/dist/daemon/paths.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare function getDaemonPaths(devOverride?: boolean): {
|
|
2
|
-
homeDir: string;
|
|
3
|
-
configPath: string;
|
|
4
|
-
statePath: string;
|
|
5
|
-
daemonLogDir: string;
|
|
6
|
-
userSessionLogRoot: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const OMNARA_HOME_DIR: string;
|
|
9
|
-
export declare const DAEMON_CONFIG_PATH: string;
|
|
10
|
-
export declare const DAEMON_STATE_PATH: string;
|
|
11
|
-
export declare const DAEMON_LOG_DIR: string;
|
|
12
|
-
export declare const USER_SESSION_LOG_ROOT: string;
|
|
13
|
-
export declare const DEFAULT_DIR_MODE = 448;
|
|
14
|
-
export declare const DEFAULT_FILE_MODE = 384;
|
|
15
|
-
export declare function ensureOmnaraHome(): Promise<void>;
|
|
16
|
-
export declare function ensureDirectory(dirPath: string): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function runDaemonProcess(): Promise<void>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface SessionRecord {
|
|
2
|
-
pid: number;
|
|
3
|
-
startedAt?: string;
|
|
4
|
-
command?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface SessionRegistry {
|
|
7
|
-
[userSessionId: string]: SessionRecord;
|
|
8
|
-
}
|
|
9
|
-
export declare function withSessionRegistry<T>(fn: (registry: SessionRegistry) => Promise<[SessionRegistry, T]> | [SessionRegistry, T]): Promise<T>;
|
|
10
|
-
export declare function isProcessAlive(pid: number): Promise<boolean>;
|
|
11
|
-
export declare function isSessionProcessAlive(record: SessionRecord): Promise<boolean>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceConfig } from '@omnara/shared-js/schemas';
|
|
2
|
-
import { DirectoryRegistry } from './directory-registry.js';
|
|
3
|
-
import { type Logger } from '../utils/logger.js';
|
|
4
|
-
export interface SessionManagerOptions {
|
|
5
|
-
backendUrl: string;
|
|
6
|
-
frontendUrl?: string;
|
|
7
|
-
directoryRegistry: DirectoryRegistry;
|
|
8
|
-
logger: Logger;
|
|
9
|
-
}
|
|
10
|
-
export interface SessionLaunchSpec {
|
|
11
|
-
launchId: string;
|
|
12
|
-
directory: string;
|
|
13
|
-
userSessionId: string;
|
|
14
|
-
workspaceId: string;
|
|
15
|
-
workspaceConfig?: WorkspaceConfig | null;
|
|
16
|
-
initialPrompt?: string | null;
|
|
17
|
-
metadata?: Record<string, unknown> | null;
|
|
18
|
-
/** Name for the worktree/branch. If null/undefined, no worktree is created. */
|
|
19
|
-
worktreeName?: string | null;
|
|
20
|
-
}
|
|
21
|
-
export declare class SessionManager {
|
|
22
|
-
private readonly backendUrl;
|
|
23
|
-
private readonly frontendUrl?;
|
|
24
|
-
private readonly directoryRegistry;
|
|
25
|
-
private readonly logger;
|
|
26
|
-
constructor(options: SessionManagerOptions);
|
|
27
|
-
startSession(spec: SessionLaunchSpec): Promise<void>;
|
|
28
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface DaemonStateData {
|
|
2
|
-
pid: number;
|
|
3
|
-
port: number;
|
|
4
|
-
token: string;
|
|
5
|
-
startedAt: string;
|
|
6
|
-
version?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class DaemonStateStore {
|
|
9
|
-
private readonly filePath;
|
|
10
|
-
constructor(filePath?: string);
|
|
11
|
-
load(): Promise<DaemonStateData | null>;
|
|
12
|
-
save(state: DaemonStateData): Promise<void>;
|
|
13
|
-
clear(): Promise<void>;
|
|
14
|
-
}
|
package/dist/env/env-mode.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface RequestOptions {
|
|
2
|
-
headers?: Record<string, string>;
|
|
3
|
-
accessToken?: string;
|
|
4
|
-
apiKey?: string;
|
|
5
|
-
signal?: AbortSignal;
|
|
6
|
-
}
|
|
7
|
-
export interface ApiClientOptions {
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
}
|
|
10
|
-
export declare class ApiClient {
|
|
11
|
-
private readonly baseUrl;
|
|
12
|
-
constructor(options: ApiClientOptions);
|
|
13
|
-
getJson<TResponse>(path: string, options?: RequestOptions): Promise<TResponse>;
|
|
14
|
-
postJson<TRequest, TResponse>(path: string, body: TRequest, options?: RequestOptions): Promise<TResponse>;
|
|
15
|
-
private buildHeaders;
|
|
16
|
-
private handleResponse;
|
|
17
|
-
}
|
|
18
|
-
export declare function normalizeBaseUrl(raw: string): string;
|
|
19
|
-
export declare function resolveUrl(base: string, path: string): string;
|
package/dist/http/machines.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ApiClient } from './api-client.js';
|
|
2
|
-
import type { MachineRegisterRequest, MachineRegisterResponse } from '@omnara/shared-js/schemas';
|
|
3
|
-
export declare function registerMachine(client: ApiClient, accessToken: string, payload: MachineRegisterRequest): Promise<MachineRegisterResponse>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ApiClient } from './api-client.js';
|
|
2
|
-
export interface UserSessionDescriptor {
|
|
3
|
-
kind: 'user_session';
|
|
4
|
-
session_id: string;
|
|
5
|
-
user_id: string;
|
|
6
|
-
status: string;
|
|
7
|
-
name?: string | null;
|
|
8
|
-
metadata?: Record<string, unknown> | null;
|
|
9
|
-
}
|
|
10
|
-
export interface EnsureUserSessionOptions {
|
|
11
|
-
workspaceId: string;
|
|
12
|
-
userSessionId?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
metadata?: Record<string, unknown>;
|
|
15
|
-
}
|
|
16
|
-
export declare function ensureUserSession(client: ApiClient, accessToken: string, options: EnsureUserSessionOptions): Promise<UserSessionDescriptor>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceDescriptor, WorkspaceEnsureRequest, WorkspaceSessionLaunchRequest, WorkspaceSessionLaunchResponse } from '@omnara/shared-js/schemas';
|
|
2
|
-
import { ApiClient } from './api-client.js';
|
|
3
|
-
export declare function ensureWorkspace(client: ApiClient, accessToken: string, payload: WorkspaceEnsureRequest): Promise<WorkspaceDescriptor>;
|
|
4
|
-
export declare function launchWorkspaceSession(client: ApiClient, accessToken: string, workspaceId: string, payload: WorkspaceSessionLaunchRequest): Promise<WorkspaceSessionLaunchResponse>;
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { type McpServerConfig } from '@anthropic-ai/claude-agent-sdk';
|
|
2
|
-
import { type AgentClient } from './ai-client.js';
|
|
3
|
-
import { Session } from './session.js';
|
|
4
|
-
import { WorkerManager } from './worker-manager.js';
|
|
5
|
-
import { WorktreeManager } from './utils/worktree-manager.js';
|
|
6
|
-
import type { InboundMessage } from './orchestrator-types.js';
|
|
7
|
-
import type { ControlMessageSchema, MessageEnvelope } from '@omnara/shared-js/schemas';
|
|
8
|
-
interface AgentOrchestratorDependencies {
|
|
9
|
-
createMainClient?: () => AgentClient;
|
|
10
|
-
createWorkerClient?: (mcpServers?: Record<string, McpServerConfig>, cwd?: string) => AgentClient;
|
|
11
|
-
workerManager?: WorkerManager;
|
|
12
|
-
worktreeManager?: WorktreeManager;
|
|
13
|
-
repoPath?: string;
|
|
14
|
-
worktreeName?: string;
|
|
15
|
-
}
|
|
16
|
-
type OrchestratorControlMessage = {
|
|
17
|
-
type: 'session_init';
|
|
18
|
-
sessionId: string;
|
|
19
|
-
parentSessionId?: string | null;
|
|
20
|
-
metadata?: Record<string, unknown>;
|
|
21
|
-
};
|
|
22
|
-
export interface AgentOrchestratorOutputChannel {
|
|
23
|
-
sendEnvelope: (message: MessageEnvelope) => Promise<void> | void;
|
|
24
|
-
sendControl?: (message: OrchestratorControlMessage) => Promise<void> | void;
|
|
25
|
-
canSend?: () => boolean;
|
|
26
|
-
close?: () => void;
|
|
27
|
-
}
|
|
28
|
-
export interface AgentOrchestratorInputChannel {
|
|
29
|
-
dispatch(message: InboundMessage): void;
|
|
30
|
-
disconnect(): void;
|
|
31
|
-
}
|
|
32
|
-
export declare class AgentOrchestrator {
|
|
33
|
-
private readonly aiClient;
|
|
34
|
-
private readonly workerManager;
|
|
35
|
-
private readonly worktreeManager;
|
|
36
|
-
private readonly workerMcpServer;
|
|
37
|
-
private readonly clients;
|
|
38
|
-
private readonly toolUseMap;
|
|
39
|
-
private readonly completionsManager;
|
|
40
|
-
private session;
|
|
41
|
-
private started;
|
|
42
|
-
private mainSessionId;
|
|
43
|
-
private sessionSettings;
|
|
44
|
-
private worktreeName;
|
|
45
|
-
private worktreePath;
|
|
46
|
-
readonly voiceSessionIds: Set<string>;
|
|
47
|
-
constructor(dependencies?: AgentOrchestratorDependencies);
|
|
48
|
-
ensureSessionExists(requestedSessionId: string): Session;
|
|
49
|
-
getWorkerManager(): WorkerManager;
|
|
50
|
-
getWorktreeManager(): WorktreeManager;
|
|
51
|
-
setMainCodingSessionId(sessionId: string): void;
|
|
52
|
-
addClient(output: AgentOrchestratorOutputChannel): AgentOrchestratorInputChannel;
|
|
53
|
-
start(): Promise<void>;
|
|
54
|
-
private initializeWorktree;
|
|
55
|
-
getWorktreeName(): string | null;
|
|
56
|
-
getWorktreePath(): string | null;
|
|
57
|
-
stop(): Promise<void>;
|
|
58
|
-
cancel(): Promise<void>;
|
|
59
|
-
getCompletions(request: ControlMessageSchema.CompletionsRequest): Promise<ControlMessageSchema.CompletionsResponse>;
|
|
60
|
-
handleSettingsChange(req: ControlMessageSchema.SessionSettingsRequest): Promise<ControlMessageSchema.SessionSettingsResponse>;
|
|
61
|
-
handleGitWrite(req: ControlMessageSchema.GitWriteRequest): Promise<ControlMessageSchema.GitWriteResponse>;
|
|
62
|
-
/**
|
|
63
|
-
* Generate a commit message using the session's conversation context + diff.
|
|
64
|
-
* Falls back to a basic diff-only approach if no session is available.
|
|
65
|
-
*/
|
|
66
|
-
private generateCommitMessageFromSession;
|
|
67
|
-
/**
|
|
68
|
-
* Generate a GitHub compare URL for creating a PR from the given branch.
|
|
69
|
-
* Parses the origin remote URL and constructs the compare link.
|
|
70
|
-
*/
|
|
71
|
-
private generateCompareUrl;
|
|
72
|
-
private applySessionSettings;
|
|
73
|
-
/**
|
|
74
|
-
* Build hooks for agent mode that stage changes after Edit/Write tools
|
|
75
|
-
*/
|
|
76
|
-
private buildAgentModeHooks;
|
|
77
|
-
private bindSession;
|
|
78
|
-
private handleSessionControl;
|
|
79
|
-
private handleSessionMessage;
|
|
80
|
-
private handleSessionComplete;
|
|
81
|
-
private handleWorkerMessage;
|
|
82
|
-
private handleWorkerComplete;
|
|
83
|
-
private emitSessionInit;
|
|
84
|
-
private enqueueWorkerSummary;
|
|
85
|
-
private handleClientMessage;
|
|
86
|
-
private handleSessionInit;
|
|
87
|
-
private handleChatMessage;
|
|
88
|
-
private handleCancelWorker;
|
|
89
|
-
private broadcastEnvelope;
|
|
90
|
-
private broadcastControl;
|
|
91
|
-
private sendToConnection;
|
|
92
|
-
private forwardEnvelope;
|
|
93
|
-
private shouldMirrorToMain;
|
|
94
|
-
private mirrorEnvelope;
|
|
95
|
-
private trackToolUse;
|
|
96
|
-
private consumeToolUse;
|
|
97
|
-
private findSessionIdBySdkSession;
|
|
98
|
-
private buildSystemPrompt;
|
|
99
|
-
private buildCurrentWorkerStatus;
|
|
100
|
-
private escapeXml;
|
|
101
|
-
}
|
|
102
|
-
export declare function startAgentOrchestrator(dependencies?: AgentOrchestratorDependencies): Promise<AgentOrchestrator>;
|
|
103
|
-
export type { OrchestratorControlMessage };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type Options, type SDKMessage, type SDKUserMessage } from '@anthropic-ai/claude-agent-sdk';
|
|
2
|
-
export interface AIClientConfig {
|
|
3
|
-
defaults?: Partial<Options>;
|
|
4
|
-
}
|
|
5
|
-
export type ModelType = 'haiku' | 'sonnet' | 'opus';
|
|
6
|
-
export declare const MODEL_MAP: Record<ModelType, string>;
|
|
7
|
-
export interface AgentClient {
|
|
8
|
-
isGenerating(): boolean;
|
|
9
|
-
streamUserMessage(prompt: string | AsyncIterable<SDKUserMessage>, overrides?: Partial<Options>): AsyncIterable<SDKMessage>;
|
|
10
|
-
cancel(): Promise<void>;
|
|
11
|
-
setModel(model: ModelType): void;
|
|
12
|
-
getModel(): ModelType;
|
|
13
|
-
setOptions(options: Partial<Options>): void;
|
|
14
|
-
getOptions(): Options;
|
|
15
|
-
}
|
|
16
|
-
export declare const BASE_ALLOWED_ORCHESTRATOR_TOOLS: readonly ["Glob", "Grep", "LS", "Read", "WebFetch", "WebSearch", "TodoWrite"];
|
|
17
|
-
export declare const BASE_ALLOWED_WORKER_TOOLS: readonly ["Task", "Bash", "Glob", "Grep", "LS", "ExitPlanMode", "Read", "Edit", "MultiEdit", "Write", "NotebookEdit", "WebFetch", "TodoWrite", "WebSearch", "BashOutput", "KillBash", "Skill", "SlashCommand"];
|
|
18
|
-
export declare class AIClient implements AgentClient {
|
|
19
|
-
private baseOptions;
|
|
20
|
-
private query?;
|
|
21
|
-
private currentModel;
|
|
22
|
-
constructor(config?: AIClientConfig);
|
|
23
|
-
streamUserMessage(prompt: string | AsyncIterable<SDKUserMessage>, overrides?: Partial<Options>): AsyncIterable<SDKMessage>;
|
|
24
|
-
private createQuery;
|
|
25
|
-
cancel(): Promise<void>;
|
|
26
|
-
isGenerating(): boolean;
|
|
27
|
-
setModel(model: ModelType): void;
|
|
28
|
-
getModel(): ModelType;
|
|
29
|
-
setOptions(options: Partial<Options>): void;
|
|
30
|
-
getOptions(): Options;
|
|
31
|
-
private ensureWorkingDirectory;
|
|
32
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* System prompt for the main orchestrator agent.
|
|
3
|
-
*
|
|
4
|
-
* The orchestrator's role is to coordinate and delegate work, not to execute tasks directly.
|
|
5
|
-
* It should ALWAYS use workers to handle all implementation work.
|
|
6
|
-
*/
|
|
7
|
-
import ORCHESTRATOR_SYSTEM_PROMPT from './orchestrator-prompt.md';
|
|
8
|
-
export { ORCHESTRATOR_SYSTEM_PROMPT };
|