omnara 0.1.11 → 0.2.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/bin/omnara.js +2 -2
- package/dist/auth/auth-provider.d.ts +9 -2
- package/dist/auth/cli-auth-service.d.ts +0 -1
- package/dist/auth/credential-manager.d.ts +10 -1
- package/dist/auth/credentials-store.d.ts +4 -1
- package/dist/auth/ensure-cli-credentials.d.ts +13 -0
- package/dist/cli.js +5435 -2462
- package/dist/cli.js.map +4 -4
- package/dist/commands/agent.d.ts +3 -2
- package/dist/commands/daemon.d.ts +2 -0
- package/dist/commands/index.d.ts +2 -1
- package/dist/config/omnara-config.d.ts +2 -22
- package/dist/daemon/config-store.d.ts +37 -0
- package/dist/daemon/daemon-client.d.ts +26 -0
- package/dist/daemon/daemon-launcher.d.ts +30 -0
- package/dist/daemon/daemon-service.d.ts +30 -0
- package/dist/daemon/directory-registry.d.ts +17 -0
- package/dist/daemon/file-logger.d.ts +24 -0
- package/dist/daemon/local-control-server.d.ts +37 -0
- package/dist/daemon/machine-supervisor.d.ts +60 -0
- package/dist/daemon/paths.d.ts +9 -0
- package/dist/daemon/run-daemon.d.ts +1 -0
- package/dist/daemon/session-log-manager.d.ts +10 -0
- package/dist/daemon/session-pid-registry.d.ts +5 -0
- package/dist/daemon/session-runner.d.ts +28 -0
- package/dist/daemon/state-store.d.ts +14 -0
- package/dist/http/machines.d.ts +3 -0
- package/dist/http/user-sessions.d.ts +5 -2
- package/dist/http/workspaces.d.ts +4 -0
- package/dist/orchestrator/utils/worktree-manager.d.ts +3 -2
- package/dist/orchestrator/worker-manager.d.ts +8 -0
- package/dist/package-info.d.ts +3 -0
- package/dist/relay/relay-bridge.d.ts +8 -0
- package/dist/schemas/index.d.ts +2 -2
- package/dist/utils/claude-code-check.d.ts +1 -20
- package/dist/utils/version-check.d.ts +1 -5
- package/package.json +3 -3
- package/scripts/copy-assets.mjs +41 -0
- package/dist/repl/terminal-repl.d.ts +0 -9
- package/dist/voice/voice-service.d.ts +0 -19
package/bin/omnara.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = path.dirname(__filename);
|
|
@@ -17,5 +17,5 @@ if (!fs.existsSync(distEntry)) {
|
|
|
17
17
|
process.exit(1);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const { run } = await import(distEntry);
|
|
20
|
+
const { run } = await import(pathToFileURL(distEntry).href);
|
|
21
21
|
await run(process.argv);
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { CredentialsStore } from './credentials-store.js';
|
|
2
2
|
import { type AuthContext } from './credential-manager.js';
|
|
3
|
+
import { performVerificationLogin } from './login-flow.js';
|
|
3
4
|
export interface AuthProviderOptions {
|
|
4
5
|
store: CredentialsStore;
|
|
5
6
|
backendUrl: string;
|
|
6
7
|
frontendUrl?: string;
|
|
7
8
|
logger?: Console;
|
|
9
|
+
interactive?: boolean;
|
|
10
|
+
login?: typeof performVerificationLogin;
|
|
11
|
+
}
|
|
12
|
+
export interface AuthAccessOptions {
|
|
13
|
+
interactive?: boolean;
|
|
8
14
|
}
|
|
9
15
|
export declare class AuthProvider {
|
|
10
16
|
private readonly options;
|
|
11
17
|
private cached;
|
|
18
|
+
private inflight;
|
|
12
19
|
private readonly backendUrl;
|
|
13
20
|
constructor(options: AuthProviderOptions);
|
|
14
|
-
getAuthContext(): Promise<AuthContext>;
|
|
15
|
-
getAccessToken(): Promise<string>;
|
|
21
|
+
getAuthContext(options?: AuthAccessOptions): Promise<AuthContext>;
|
|
22
|
+
getAccessToken(options?: AuthAccessOptions): Promise<string>;
|
|
16
23
|
private loadAuthContext;
|
|
17
24
|
}
|
|
18
25
|
export declare function createAuthProvider(options: AuthProviderOptions): Promise<AuthProvider>;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { CredentialsStore, type StoredCredentials } from './credentials-store.js';
|
|
2
|
+
export type AuthContextErrorCode = 'missing_credentials' | 'refresh_token_unavailable' | 'access_token_missing' | 'access_token_expired' | 'refresh_failed' | 'network_error';
|
|
3
|
+
export declare class AuthContextError extends Error {
|
|
4
|
+
readonly code: AuthContextErrorCode;
|
|
5
|
+
readonly status?: number;
|
|
6
|
+
constructor(message: string, code: AuthContextErrorCode, options?: {
|
|
7
|
+
cause?: unknown;
|
|
8
|
+
status?: number;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
2
11
|
export interface AuthContext {
|
|
3
12
|
credentials: StoredCredentials;
|
|
4
13
|
accessToken: string;
|
|
5
14
|
}
|
|
6
|
-
export declare function ensureAuthContext(store: CredentialsStore, backendUrl: string): Promise<AuthContext>;
|
|
15
|
+
export declare function ensureAuthContext(store: CredentialsStore, backendUrl: string, initialCredentials?: StoredCredentials | null): Promise<AuthContext>;
|
|
@@ -2,7 +2,6 @@ export interface StoredCredentials {
|
|
|
2
2
|
accessToken?: string;
|
|
3
3
|
accessTokenExpiresAt?: string;
|
|
4
4
|
refreshToken?: string;
|
|
5
|
-
refreshTokenExpiresAt?: string;
|
|
6
5
|
}
|
|
7
6
|
export declare const DEFAULT_DIR: string;
|
|
8
7
|
export declare const DEFAULT_CREDENTIALS_PATH: string;
|
|
@@ -12,4 +11,8 @@ export declare class CredentialsStore {
|
|
|
12
11
|
load(): Promise<StoredCredentials | null>;
|
|
13
12
|
save(credentials: StoredCredentials): Promise<void>;
|
|
14
13
|
clear(): Promise<void>;
|
|
14
|
+
withLock<T>(fn: () => Promise<T>): Promise<T>;
|
|
15
|
+
private lockPath;
|
|
16
|
+
private acquireLock;
|
|
17
|
+
private tryBreakStaleLock;
|
|
15
18
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CredentialsStore } from './credentials-store.js';
|
|
2
|
+
export interface EnsureCliCredentialsOptions {
|
|
3
|
+
backendUrl?: string;
|
|
4
|
+
frontendUrl?: string;
|
|
5
|
+
store?: CredentialsStore;
|
|
6
|
+
logger?: Console;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Guarantees that the CLI has valid Supabase credentials stored locally.
|
|
10
|
+
* If the credentials file is missing or expired, this helper runs the
|
|
11
|
+
* interactive browser flow before returning.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ensureCliCredentials(options?: EnsureCliCredentialsOptions): Promise<void>;
|