omnara 0.1.11 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/bin/omnara.js +2 -2
  2. package/dist/auth/auth-provider.d.ts +9 -2
  3. package/dist/auth/cli-auth-service.d.ts +0 -1
  4. package/dist/auth/credential-manager.d.ts +10 -1
  5. package/dist/auth/credentials-store.d.ts +4 -1
  6. package/dist/auth/ensure-cli-credentials.d.ts +13 -0
  7. package/dist/cli.js +5434 -2462
  8. package/dist/cli.js.map +4 -4
  9. package/dist/commands/agent.d.ts +3 -2
  10. package/dist/commands/daemon.d.ts +2 -0
  11. package/dist/commands/index.d.ts +2 -1
  12. package/dist/config/omnara-config.d.ts +2 -22
  13. package/dist/daemon/config-store.d.ts +37 -0
  14. package/dist/daemon/daemon-client.d.ts +26 -0
  15. package/dist/daemon/daemon-launcher.d.ts +30 -0
  16. package/dist/daemon/daemon-service.d.ts +30 -0
  17. package/dist/daemon/directory-registry.d.ts +17 -0
  18. package/dist/daemon/file-logger.d.ts +24 -0
  19. package/dist/daemon/local-control-server.d.ts +37 -0
  20. package/dist/daemon/machine-supervisor.d.ts +60 -0
  21. package/dist/daemon/paths.d.ts +9 -0
  22. package/dist/daemon/run-daemon.d.ts +1 -0
  23. package/dist/daemon/session-log-manager.d.ts +10 -0
  24. package/dist/daemon/session-pid-registry.d.ts +5 -0
  25. package/dist/daemon/session-runner.d.ts +28 -0
  26. package/dist/daemon/state-store.d.ts +14 -0
  27. package/dist/http/machines.d.ts +3 -0
  28. package/dist/http/user-sessions.d.ts +5 -2
  29. package/dist/http/workspaces.d.ts +4 -0
  30. package/dist/orchestrator/utils/worktree-manager.d.ts +3 -2
  31. package/dist/orchestrator/worker-manager.d.ts +8 -0
  32. package/dist/package-info.d.ts +3 -0
  33. package/dist/relay/relay-bridge.d.ts +8 -0
  34. package/dist/schemas/index.d.ts +2 -2
  35. package/dist/utils/claude-code-check.d.ts +1 -20
  36. package/dist/utils/version-check.d.ts +1 -5
  37. package/package.json +3 -3
  38. package/scripts/copy-assets.mjs +41 -0
  39. package/dist/repl/terminal-repl.d.ts +0 -9
  40. package/dist/voice/voice-service.d.ts +0 -19
@@ -1,7 +1,8 @@
1
- import { Command } from 'commander';
2
- export declare function buildAgentCommand(): Command;
3
1
  export interface OrchestratorOptions {
4
2
  backendUrl?: string;
5
3
  frontendUrl?: string;
4
+ workspaceId?: string;
5
+ userSessionId?: string;
6
+ agentSessionId?: string;
6
7
  }
7
8
  export declare function runAgentOrchestrator(options?: OrchestratorOptions): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function buildDaemonCommand(): Command;
@@ -1,2 +1,3 @@
1
- export { buildAgentCommand, runAgentOrchestrator, type OrchestratorOptions } from './agent.js';
1
+ export { runAgentOrchestrator, type OrchestratorOptions } from './agent.js';
2
2
  export { buildAuthCommand } from './auth.js';
3
+ export { buildDaemonCommand } from './daemon.js';
@@ -1,27 +1,7 @@
1
1
  import * as z from 'zod';
2
+ import type { WorkspaceConfigSchema } from '@omnara/shared-js/schemas';
3
+ declare const OmnaraConfig: z.ZodType<WorkspaceConfigSchema.WorkspaceConfig>;
2
4
  export type OmnaraConfig = z.infer<typeof OmnaraConfig>;
3
- declare const OmnaraConfig: z.ZodObject<{
4
- worktrees: z.ZodDefault<z.ZodObject<{
5
- enabled: z.ZodDefault<z.ZodBoolean>;
6
- base_ref: z.ZodOptional<z.ZodString>;
7
- }, "strip", z.ZodTypeAny, {
8
- enabled: boolean;
9
- base_ref?: string | undefined;
10
- }, {
11
- enabled?: boolean | undefined;
12
- base_ref?: string | undefined;
13
- }>>;
14
- }, "strip", z.ZodTypeAny, {
15
- worktrees: {
16
- enabled: boolean;
17
- base_ref?: string | undefined;
18
- };
19
- }, {
20
- worktrees?: {
21
- enabled?: boolean | undefined;
22
- base_ref?: string | undefined;
23
- } | undefined;
24
- }>;
25
5
  /**
26
6
  * Read and parse the omnara.jsonc configuration file
27
7
  *
@@ -0,0 +1,37 @@
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
+ }
@@ -0,0 +1,26 @@
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
+ }): Promise<LaunchWorkspaceResult | null>;
19
+ private getEndpoint;
20
+ private request;
21
+ }
22
+ export declare class HttpError extends Error {
23
+ readonly statusCode: number;
24
+ readonly body?: string | undefined;
25
+ constructor(message: string, statusCode: number, body?: string | undefined);
26
+ }
@@ -0,0 +1,30 @@
1
+ import type { Logger } from '../utils/logger.js';
2
+ export interface StartDaemonOptions {
3
+ waitForReady?: boolean;
4
+ reason?: string;
5
+ backendUrl?: string;
6
+ frontendUrl?: string;
7
+ logger?: Logger;
8
+ }
9
+ export interface StopDaemonOptions {
10
+ logger?: Logger;
11
+ }
12
+ export interface EnsureDaemonOptions {
13
+ cwd?: string;
14
+ label?: string;
15
+ reason?: string;
16
+ backendUrl?: string;
17
+ frontendUrl?: string;
18
+ logger?: Logger;
19
+ }
20
+ export interface StatusOptions {
21
+ logger?: Logger;
22
+ }
23
+ export interface KillAllOptions {
24
+ logger?: Logger;
25
+ }
26
+ export declare function ensureDaemonForSession(options?: EnsureDaemonOptions): Promise<void>;
27
+ export declare function startDaemon(options?: StartDaemonOptions): Promise<boolean>;
28
+ export declare function stopDaemon(options?: StopDaemonOptions): Promise<boolean>;
29
+ export declare function showDaemonStatus(options?: StatusOptions): Promise<void>;
30
+ export declare function killAllDaemonProcesses(options?: KillAllOptions): Promise<void>;
@@ -0,0 +1,30 @@
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
+ }
@@ -0,0 +1,17 @@
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
+ }
@@ -0,0 +1,24 @@
1
+ import fs from 'node:fs';
2
+ import { ControlledLogger, LogLevel } from '../utils/logger.js';
3
+ export declare class FileBackedLogger extends ControlledLogger {
4
+ private readonly stream;
5
+ private closed;
6
+ constructor(stream: fs.WriteStream, options?: {
7
+ logLevel?: LogLevel;
8
+ forceOutput?: boolean;
9
+ });
10
+ log(...args: unknown[]): void;
11
+ info(...args: unknown[]): void;
12
+ debug(...args: unknown[]): void;
13
+ warn(...args: unknown[]): void;
14
+ error(...args: unknown[]): void;
15
+ trace(...args: unknown[]): void;
16
+ important(...args: unknown[]): void;
17
+ success(...args: unknown[]): void;
18
+ close(): Promise<void>;
19
+ private writeLine;
20
+ }
21
+ export declare function createDaemonFileLogger(): Promise<{
22
+ logger: FileBackedLogger;
23
+ logPath: string;
24
+ }>;
@@ -0,0 +1,37 @@
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
+ }
27
+ export interface LaunchWorkspaceSuccessPayload {
28
+ user_session_id: string;
29
+ workspace_id: string;
30
+ launch_id: string;
31
+ }
32
+ export interface LaunchWorkspaceResult {
33
+ status: 'ok' | 'error' | string;
34
+ payload?: LaunchWorkspaceSuccessPayload | null;
35
+ error?: string;
36
+ }
37
+ export declare function startLocalControlServer(options: LocalControlServerOptions): Promise<LocalControlServerHandle>;
@@ -0,0 +1,60 @@
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
+ }): Promise<LaunchWorkspaceResult>;
38
+ stop(status: Exclude<MachineMessageSchema.MachineStatus, 'ONLINE'>): Promise<void>;
39
+ private runLoop;
40
+ private registerMachine;
41
+ private runWebsocket;
42
+ private handleSocketMessage;
43
+ private handleRpcRequest;
44
+ private sendRpcResponse;
45
+ private launchWorkspaceSessionFromRpc;
46
+ private launchWorkspaceSession;
47
+ private ensureWorkspaceForDirectory;
48
+ private ensureWorkspaceWithRetry;
49
+ private ensureUserSessionForWorkspace;
50
+ private buildWorkspaceMetadata;
51
+ private getMachineId;
52
+ private waitForMachineRegistration;
53
+ private startHeartbeatTimer;
54
+ private clearHeartbeatTimer;
55
+ private sendHeartbeat;
56
+ private sendMessage;
57
+ private clearLoginWait;
58
+ private closeWebsocket;
59
+ private recoverMachineRegistration;
60
+ }
@@ -0,0 +1,9 @@
1
+ export declare const OMNARA_HOME_DIR: string;
2
+ export declare const DAEMON_CONFIG_PATH: string;
3
+ export declare const DAEMON_STATE_PATH: string;
4
+ export declare const DAEMON_LOG_DIR: string;
5
+ export declare const USER_SESSION_LOG_ROOT: string;
6
+ export declare const DEFAULT_DIR_MODE = 448;
7
+ export declare const DEFAULT_FILE_MODE = 384;
8
+ export declare function ensureOmnaraHome(): Promise<void>;
9
+ export declare function ensureDirectory(dirPath: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function runDaemonProcess(): Promise<void>;
@@ -0,0 +1,10 @@
1
+ import fs from 'node:fs';
2
+ export interface SessionLogHandle {
3
+ stream: fs.WriteStream;
4
+ logPath: string;
5
+ }
6
+ export declare function createSessionLog(handle: {
7
+ workspaceId: string;
8
+ launchId: string;
9
+ }): Promise<SessionLogHandle>;
10
+ export declare function writeSessionLog(stream: fs.WriteStream, level: string, args: unknown[]): void;
@@ -0,0 +1,5 @@
1
+ export interface SessionRegistry {
2
+ [userSessionId: string]: number;
3
+ }
4
+ export declare function withSessionRegistry<T>(fn: (registry: SessionRegistry) => Promise<[SessionRegistry, T]> | [SessionRegistry, T]): Promise<T>;
5
+ export declare function isProcessAlive(pid: number): Promise<boolean>;
@@ -0,0 +1,28 @@
1
+ import type { Logger } from '../utils/logger.js';
2
+ import type { WorkspaceConfig } from '@omnara/shared-js/schemas';
3
+ import { DirectoryRegistry } from './directory-registry.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
+ }
19
+ export declare class SessionManager {
20
+ private readonly backendUrl;
21
+ private readonly frontendUrl?;
22
+ private readonly directoryRegistry;
23
+ private readonly logger;
24
+ private readonly runners;
25
+ constructor(options: SessionManagerOptions);
26
+ startSession(spec: SessionLaunchSpec): Promise<void>;
27
+ stopAll(): Promise<void>;
28
+ }
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1,3 @@
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>;
@@ -7,7 +7,10 @@ export interface UserSessionDescriptor {
7
7
  name?: string | null;
8
8
  metadata?: Record<string, unknown> | null;
9
9
  }
10
- export declare function createUserSession(client: ApiClient, accessToken: string, options?: {
10
+ export interface EnsureUserSessionOptions {
11
+ workspaceId: string;
12
+ userSessionId?: string;
11
13
  name?: string;
12
14
  metadata?: Record<string, unknown>;
13
- }): Promise<UserSessionDescriptor>;
15
+ }
16
+ export declare function ensureUserSession(client: ApiClient, accessToken: string, options: EnsureUserSessionOptions): Promise<UserSessionDescriptor>;
@@ -0,0 +1,4 @@
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>;
@@ -1,3 +1,4 @@
1
+ import { type SimpleGit } from 'simple-git';
1
2
  /**
2
3
  * Configuration options for WorktreeManager
3
4
  */
@@ -69,7 +70,7 @@ export declare class WorktreeError extends Error {
69
70
  * ```
70
71
  */
71
72
  export declare class WorktreeManager {
72
- private readonly git;
73
+ readonly git: SimpleGit;
73
74
  private readonly repoPath;
74
75
  private readonly worktreeBasePath;
75
76
  private readonly activeWorktrees;
@@ -84,7 +85,7 @@ export declare class WorktreeManager {
84
85
  * Tries in order: configured base_ref, main, master, origin/HEAD
85
86
  * @returns The first valid ref found, or undefined if none exist
86
87
  */
87
- private findValidBaseRef;
88
+ findValidBaseRef(): Promise<string | undefined>;
88
89
  /**
89
90
  * Validate that the repoPath is a git repository
90
91
  * Logs an error if worktrees are enabled but not in a git repository
@@ -2,6 +2,7 @@ import { EventEmitter } from 'events';
2
2
  import type { SDKUserMessage, McpServerConfig } from '@anthropic-ai/claude-agent-sdk';
3
3
  import type { AgentClient } from './ai-client.js';
4
4
  import { AsyncQueue } from './utils/async-queue.js';
5
+ import { WorktreeManager } from './utils/worktree-manager.js';
5
6
  export type WorkerStatus = 'running' | 'completed' | 'error' | 'canceled';
6
7
  export interface WorkerProgressEntry {
7
8
  timestamp: number;
@@ -57,7 +58,9 @@ export declare class WorkerManager extends EventEmitter {
57
58
  private readonly workers;
58
59
  private readonly runningQueries;
59
60
  private worktreeManager;
61
+ repoPath: string;
60
62
  constructor(options: WorkerManagerOptions);
63
+ private initializeConfig;
61
64
  listWorkers(): WorkerRecord[];
62
65
  getWorker(id: string): WorkerRecord | undefined;
63
66
  getWorkerByTask(task: string): WorkerRecord | undefined;
@@ -99,5 +102,10 @@ export declare class WorkerManager extends EventEmitter {
99
102
  * This should be called during application shutdown to ensure all worktrees are cleaned up
100
103
  */
101
104
  shutdown(): Promise<void>;
105
+ /**
106
+ * Get the WorktreeManager instance
107
+ * @returns The WorktreeManager instance
108
+ */
109
+ getWorktreeManager(): WorktreeManager;
102
110
  }
103
111
  export {};
@@ -0,0 +1,3 @@
1
+ export declare const PACKAGE_NAME: string;
2
+ export declare const PACKAGE_VERSION: string;
3
+ export declare const PACKAGE_DESCRIPTION: string;
@@ -6,6 +6,9 @@ export interface RelayBridgeOptions {
6
6
  logger?: Console;
7
7
  backendUrl: string;
8
8
  frontendUrl?: string;
9
+ workspaceId?: string;
10
+ userSessionId?: string;
11
+ agentSessionId?: string;
9
12
  }
10
13
  export declare class RelayBridge extends EventEmitter {
11
14
  private readonly orchestrator;
@@ -13,6 +16,7 @@ export declare class RelayBridge extends EventEmitter {
13
16
  private readonly logger;
14
17
  private readonly backendUrl;
15
18
  private readonly frontendUrl?;
19
+ private readonly workspaceId;
16
20
  private connectionHandle;
17
21
  private ws;
18
22
  private stopped;
@@ -22,8 +26,10 @@ export declare class RelayBridge extends EventEmitter {
22
26
  private authProviderPromise;
23
27
  private userSessionId;
24
28
  private currentAgentSessionId;
29
+ private readonly attachAgentSessionId;
25
30
  private browserOpened;
26
31
  private canceled;
32
+ private waitingForLogin;
27
33
  constructor(orchestrator: AgentOrchestrator, options: RelayBridgeOptions);
28
34
  start(): Promise<void>;
29
35
  stop(): Promise<void>;
@@ -44,6 +50,7 @@ export declare class RelayBridge extends EventEmitter {
44
50
  private handleSessionAnnounce;
45
51
  private handleCancelAgent;
46
52
  private handleSessionClosed;
53
+ private handleGitDiffRequest;
47
54
  private handleRelayRequest;
48
55
  private handleMessageEnvelope;
49
56
  private isTextContent;
@@ -59,5 +66,6 @@ export declare class RelayBridge extends EventEmitter {
59
66
  private enqueue;
60
67
  private flushQueue;
61
68
  private startPingTimer;
69
+ private clearLoginWait;
62
70
  private closeCurrentSocket;
63
71
  }
@@ -1,2 +1,2 @@
1
- export type { ControlMessage, MessageEnvelope, ControlMessageSchema, MessageEnvelopeSchema, ValidationError, } from '@omnara/shared-js/schemas';
2
- export { validateControlMessage, validateMessageEnvelope } from '@omnara/shared-js/schemas';
1
+ export type { ControlMessage, MessageEnvelope, ControlMessageSchema, MessageEnvelopeSchema, MachineMessage, ValidationError, } from '@omnara/shared-js/schemas';
2
+ export { validateControlMessage, validateMessageEnvelope, validateMachineMessage, } from '@omnara/shared-js/schemas';
@@ -1,25 +1,6 @@
1
- /**
2
- * Checks if Claude Code is installed and available in the system
3
- */
4
- export declare function checkClaudeCodeInstallation(): boolean;
5
- /**
6
- * Checks if ANTHROPIC_API_KEY environment variable is set
7
- */
8
- export declare function checkAnthropicApiKey(): boolean;
9
- /**
10
- * Displays a warning message if neither authentication method is available
11
- */
12
- export declare function displayClaudeCodeWarning(): void;
13
1
  /**
14
2
  * Performs the Claude Code check and displays warning if needed
15
3
  * @param options - Optional configuration for the check
16
4
  * @returns boolean indicating if either authentication method is available
17
5
  */
18
- export declare function performClaudeCodeCheck(options?: {
19
- silent?: boolean;
20
- exitOnMissing?: boolean;
21
- }): boolean;
22
- /**
23
- * Gets Claude Code version if installed
24
- */
25
- export declare function getClaudeCodeVersion(): string | null;
6
+ export declare function performClaudeCodeCheck(): Promise<boolean>;
@@ -2,8 +2,4 @@
2
2
  * Checks if a newer version is available and logs a message if so.
3
3
  * This function is non-blocking and will not throw errors.
4
4
  */
5
- export declare function checkForUpdates(): Promise<void>;
6
- /**
7
- * Checks for updates in the background without blocking
8
- */
9
- export declare function checkForUpdatesInBackground(): void;
5
+ export declare function attemptUpdate(): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnara",
3
- "version": "0.1.11",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "Command-line interface for Omnara.",
6
6
  "main": "dist/cli.js",
@@ -11,7 +11,7 @@
11
11
  "scripts": {
12
12
  "build": "npm run build:types && node build.mjs && npm run copy-assets",
13
13
  "build:types": "tsc --emitDeclarationOnly --project tsconfig.json",
14
- "copy-assets": "mkdir -p dist dist/orchestrator && cp -r src/orchestrator/*.md dist/ && cp -r src/orchestrator/*.md dist/orchestrator/",
14
+ "copy-assets": "node scripts/copy-assets.mjs",
15
15
  "preinstall": "node scripts/preinstall.js"
16
16
  },
17
17
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "README.md"
28
28
  ],
29
29
  "dependencies": {
30
- "@anthropic-ai/claude-agent-sdk": "^0.1.23",
30
+ "@anthropic-ai/claude-agent-sdk": "^0.1.42",
31
31
  "@anthropic-ai/sdk": "^0.67.0",
32
32
  "@modelcontextprotocol/sdk": "^1.20.1",
33
33
  "@supabase/supabase-js": "^2.76.1",
@@ -0,0 +1,41 @@
1
+ import { mkdir, copyFile } from 'fs/promises';
2
+ import { basename, join } from 'path';
3
+ import { cwd } from 'process';
4
+ import { glob } from 'glob';
5
+
6
+ async function main() {
7
+ const projectRoot = cwd();
8
+ const mdFiles = await glob('src/orchestrator/*.md', {
9
+ cwd: projectRoot,
10
+ absolute: true,
11
+ });
12
+
13
+ if (mdFiles.length === 0) {
14
+ return;
15
+ }
16
+
17
+ const distDir = join(projectRoot, 'dist');
18
+ const orchestratorDistDir = join(distDir, 'orchestrator');
19
+
20
+ await Promise.all([
21
+ mkdir(distDir, { recursive: true }),
22
+ mkdir(orchestratorDistDir, { recursive: true }),
23
+ ]);
24
+
25
+ await Promise.all(
26
+ mdFiles.flatMap((file) => {
27
+ const fileName = basename(file);
28
+ const targets = [
29
+ join(distDir, fileName),
30
+ join(orchestratorDistDir, fileName),
31
+ ];
32
+
33
+ return targets.map((target) => copyFile(file, target));
34
+ }),
35
+ );
36
+ }
37
+
38
+ main().catch((error) => {
39
+ console.error('[copy-assets] Failed to copy markdown assets:', error);
40
+ process.exit(1);
41
+ });
@@ -1,9 +0,0 @@
1
- export interface ReplOptions {
2
- url?: string;
3
- headers?: Record<string, string>;
4
- initialSessionId?: string;
5
- parentSessionId?: string;
6
- initialMetadata?: Record<string, unknown>;
7
- initializeSession?: boolean;
8
- }
9
- export declare function runTerminalRepl(options?: Partial<ReplOptions>): Promise<void>;