omnara 0.1.3 → 0.1.5
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 +8 -3
- package/dist/auth/auth-provider.d.ts +2 -2
- package/dist/auth/cli-auth-service.d.ts +1 -1
- package/dist/auth/credential-manager.d.ts +1 -1
- package/dist/auth/login-flow.d.ts +2 -2
- package/dist/auth/supabase-client.d.ts +1 -1
- package/dist/cli.js +5940 -44
- package/dist/cli.js.map +7 -1
- package/dist/commands/index.d.ts +2 -2
- package/dist/http/user-sessions.d.ts +13 -0
- package/dist/orchestrator/agent-orchestrator.d.ts +14 -6
- package/dist/orchestrator/ai-client.d.ts +5 -4
- package/dist/orchestrator/orchestrator-prompt.d.ts +3 -2
- package/dist/orchestrator/orchestrator-prompt.md +405 -0
- package/dist/orchestrator/{types.d.ts → orchestrator-types.d.ts} +33 -29
- package/dist/orchestrator/session.d.ts +7 -3
- package/dist/orchestrator/tools/worker-status-tool.d.ts +7 -0
- package/dist/orchestrator/tools/worker-tools.d.ts +2 -1
- package/dist/orchestrator/utils/async-queue.d.ts +26 -0
- package/dist/orchestrator/utils/session-logger.d.ts +1 -1
- package/dist/orchestrator/worker-manager.d.ts +31 -15
- package/dist/relay/relay-bridge.d.ts +24 -3
- package/dist/relay/relay-service.d.ts +4 -7
- package/dist/schemas/index.d.ts +2 -0
- package/dist/voice/voice-service.d.ts +1 -1
- package/package.json +13 -3
- package/scripts/preinstall.js +141 -0
- package/scripts/test-preinstall.js +125 -0
- package/dist/auth/auth-provider.js +0 -58
- package/dist/auth/auth-provider.js.map +0 -1
- package/dist/auth/cli-auth-service.js +0 -47
- package/dist/auth/cli-auth-service.js.map +0 -1
- package/dist/auth/credential-manager.js +0 -73
- package/dist/auth/credential-manager.js.map +0 -1
- package/dist/auth/credentials-store.js +0 -75
- package/dist/auth/credentials-store.js.map +0 -1
- package/dist/auth/login-flow.js +0 -202
- package/dist/auth/login-flow.js.map +0 -1
- package/dist/auth/loopback-listener.js +0 -159
- package/dist/auth/loopback-listener.js.map +0 -1
- package/dist/auth/pkce.js +0 -18
- package/dist/auth/pkce.js.map +0 -1
- package/dist/auth/supabase-client.js +0 -13
- package/dist/auth/supabase-client.js.map +0 -1
- package/dist/auth/supabase-config.js +0 -24
- package/dist/auth/supabase-config.js.map +0 -1
- package/dist/commands/agent.js +0 -174
- package/dist/commands/agent.js.map +0 -1
- package/dist/commands/auth.js +0 -87
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/hello.d.ts +0 -2
- package/dist/commands/hello.js +0 -12
- package/dist/commands/hello.js.map +0 -1
- package/dist/commands/index.js +0 -9
- package/dist/commands/index.js.map +0 -1
- package/dist/generated/relay.d.ts +0 -240
- package/dist/generated/relay.js +0 -2376
- package/dist/generated/relay.js.map +0 -1
- package/dist/http/api-client.js +0 -122
- package/dist/http/api-client.js.map +0 -1
- package/dist/messaging/proto-codec.d.ts +0 -5
- package/dist/messaging/proto-codec.js +0 -387
- package/dist/messaging/proto-codec.js.map +0 -1
- package/dist/orchestrator/agent-orchestrator.js +0 -423
- package/dist/orchestrator/agent-orchestrator.js.map +0 -1
- package/dist/orchestrator/ai-client.js +0 -74
- package/dist/orchestrator/ai-client.js.map +0 -1
- package/dist/orchestrator/orchestrator-prompt.js +0 -160
- package/dist/orchestrator/orchestrator-prompt.js.map +0 -1
- package/dist/orchestrator/session.js +0 -273
- package/dist/orchestrator/session.js.map +0 -1
- package/dist/orchestrator/tools/worker-tools.js +0 -165
- package/dist/orchestrator/tools/worker-tools.js.map +0 -1
- package/dist/orchestrator/types.js +0 -33
- package/dist/orchestrator/types.js.map +0 -1
- package/dist/orchestrator/utils/session-logger.js +0 -53
- package/dist/orchestrator/utils/session-logger.js.map +0 -1
- package/dist/orchestrator/worker-manager.js +0 -250
- package/dist/orchestrator/worker-manager.js.map +0 -1
- package/dist/relay/relay-bridge.js +0 -309
- package/dist/relay/relay-bridge.js.map +0 -1
- package/dist/relay/relay-service.js +0 -29
- package/dist/relay/relay-service.js.map +0 -1
- package/dist/repl/terminal-repl.js +0 -258
- package/dist/repl/terminal-repl.js.map +0 -1
- package/dist/server/agent-server.d.ts +0 -46
- package/dist/server/agent-server.js +0 -429
- package/dist/server/agent-server.js.map +0 -1
- package/dist/server/ai-client.d.ts +0 -16
- package/dist/server/ai-client.js +0 -74
- package/dist/server/ai-client.js.map +0 -1
- package/dist/server/session.d.ts +0 -35
- package/dist/server/session.js +0 -272
- package/dist/server/session.js.map +0 -1
- package/dist/server/subagents.d.ts +0 -19
- package/dist/server/subagents.js +0 -42
- package/dist/server/subagents.js.map +0 -1
- package/dist/server/tools/worker-tools.d.ts +0 -2
- package/dist/server/tools/worker-tools.js +0 -37
- package/dist/server/tools/worker-tools.js.map +0 -1
- package/dist/server/types.d.ts +0 -120
- package/dist/server/types.js +0 -29
- package/dist/server/types.js.map +0 -1
- package/dist/server/utils/session-logger.d.ts +0 -7
- package/dist/server/utils/session-logger.js +0 -53
- package/dist/server/utils/session-logger.js.map +0 -1
- package/dist/server/worker-manager.d.ts +0 -67
- package/dist/server/worker-manager.js +0 -207
- package/dist/server/worker-manager.js.map +0 -1
- package/dist/test-agent.d.ts +0 -1
- package/dist/test-agent.js +0 -63
- package/dist/test-agent.js.map +0 -1
- package/dist/utils/base64url.d.ts +0 -1
- package/dist/utils/base64url.js +0 -12
- package/dist/utils/base64url.js.map +0 -1
- package/dist/utils/prompt.js +0 -19
- package/dist/utils/prompt.js.map +0 -1
- package/dist/utils/random.d.ts +0 -1
- package/dist/utils/random.js +0 -9
- package/dist/utils/random.js.map +0 -1
- package/dist/voice/voice-service.js +0 -27
- package/dist/voice/voice-service.js.map +0 -1
package/dist/commands/agent.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildAgentCommand = buildAgentCommand;
|
|
4
|
-
exports.runAgentOrchestrator = runAgentOrchestrator;
|
|
5
|
-
const commander_1 = require("commander");
|
|
6
|
-
const agent_orchestrator_1 = require("../orchestrator/agent-orchestrator");
|
|
7
|
-
const credentials_store_1 = require("../auth/credentials-store");
|
|
8
|
-
const relay_bridge_1 = require("../relay/relay-bridge");
|
|
9
|
-
const terminal_repl_1 = require("../repl/terminal-repl");
|
|
10
|
-
const api_client_1 = require("../http/api-client");
|
|
11
|
-
const relay_service_1 = require("../relay/relay-service");
|
|
12
|
-
const voice_service_1 = require("../voice/voice-service");
|
|
13
|
-
const auth_provider_1 = require("../auth/auth-provider");
|
|
14
|
-
const login_flow_1 = require("../auth/login-flow");
|
|
15
|
-
function buildAgentCommand() {
|
|
16
|
-
const agent = new commander_1.Command('agent').description('Utilities for interacting with the Omnara Claude agent.');
|
|
17
|
-
agent
|
|
18
|
-
.command('orchestrator')
|
|
19
|
-
.alias('server')
|
|
20
|
-
.description('Start the Omnara agent orchestrator.')
|
|
21
|
-
.option('--backend-url <url>', 'Override backend API base URL used for login')
|
|
22
|
-
.option('--frontend-url <url>', 'Override frontend URL opened during login')
|
|
23
|
-
.action(async (options) => {
|
|
24
|
-
await runAgentOrchestrator(options);
|
|
25
|
-
});
|
|
26
|
-
agent
|
|
27
|
-
.command('repl')
|
|
28
|
-
.description('Start the Omnara agent REPL connected through the backend relay.')
|
|
29
|
-
.requiredOption('--session-id <id>', 'Connect to an existing parent agent session')
|
|
30
|
-
.option('--backend-url <url>', 'Override backend API base URL used for login')
|
|
31
|
-
.option('--frontend-url <url>', 'Override frontend URL opened during login')
|
|
32
|
-
.action(async (options) => {
|
|
33
|
-
await runRepl(options);
|
|
34
|
-
});
|
|
35
|
-
agent
|
|
36
|
-
.command('voice')
|
|
37
|
-
.description('Dispatch the LiveKit voice agent for an existing session.')
|
|
38
|
-
.requiredOption('--session-id <id>', 'Agent session to connect the voice worker to')
|
|
39
|
-
.option('--backend-url <url>', 'Override backend API base URL used for login')
|
|
40
|
-
.option('--frontend-url <url>', 'Override frontend URL opened during login')
|
|
41
|
-
.option('--room-name <name>', 'Override the LiveKit room name used for the call')
|
|
42
|
-
.option('--force', 'Launch even if the CLI relay is offline')
|
|
43
|
-
.action(async (options) => {
|
|
44
|
-
await runVoice(options);
|
|
45
|
-
});
|
|
46
|
-
return agent;
|
|
47
|
-
}
|
|
48
|
-
async function runAgentOrchestrator(options = {}) {
|
|
49
|
-
const orchestrator = new agent_orchestrator_1.AgentOrchestrator();
|
|
50
|
-
await orchestrator.start();
|
|
51
|
-
const backendUrl = (0, login_flow_1.resolveBackendUrl)(options.backendUrl);
|
|
52
|
-
const frontendUrl = (0, login_flow_1.resolveFrontendUrl)(options.frontendUrl);
|
|
53
|
-
const store = new credentials_store_1.CredentialsStore();
|
|
54
|
-
const bridge = new relay_bridge_1.RelayBridge(orchestrator, {
|
|
55
|
-
store,
|
|
56
|
-
logger: console,
|
|
57
|
-
backendUrl,
|
|
58
|
-
frontendUrl,
|
|
59
|
-
});
|
|
60
|
-
const stop = async () => {
|
|
61
|
-
await bridge.stop();
|
|
62
|
-
await orchestrator.stop();
|
|
63
|
-
};
|
|
64
|
-
const signalHandler = createSignalHandler(stop);
|
|
65
|
-
process.on('SIGINT', signalHandler.handler);
|
|
66
|
-
process.on('SIGTERM', signalHandler.handler);
|
|
67
|
-
try {
|
|
68
|
-
await bridge.start();
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
console.error(`Relay orchestrator terminated: ${extractErrorMessage(error)}`);
|
|
72
|
-
process.exitCode = process.exitCode || 1;
|
|
73
|
-
}
|
|
74
|
-
finally {
|
|
75
|
-
await stop();
|
|
76
|
-
signalHandler.remove();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function createSignalHandler(onStop) {
|
|
80
|
-
let stopping = false;
|
|
81
|
-
const handler = (signal) => {
|
|
82
|
-
if (stopping) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
stopping = true;
|
|
86
|
-
console.log(`\nReceived ${signal}. Shutting down agent orchestrator...`);
|
|
87
|
-
void onStop()
|
|
88
|
-
.catch((error) => {
|
|
89
|
-
console.error('Error while shutting down agent orchestrator:', error);
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
const remove = () => {
|
|
93
|
-
process.removeListener('SIGINT', handler);
|
|
94
|
-
process.removeListener('SIGTERM', handler);
|
|
95
|
-
};
|
|
96
|
-
return { handler, remove };
|
|
97
|
-
}
|
|
98
|
-
function extractErrorMessage(error) {
|
|
99
|
-
if (error instanceof Error) {
|
|
100
|
-
return error.message;
|
|
101
|
-
}
|
|
102
|
-
return String(error);
|
|
103
|
-
}
|
|
104
|
-
async function runRepl(options) {
|
|
105
|
-
const backendUrl = (0, login_flow_1.resolveBackendUrl)(options.backendUrl);
|
|
106
|
-
const frontendUrl = (0, login_flow_1.resolveFrontendUrl)(options.frontendUrl);
|
|
107
|
-
const store = new credentials_store_1.CredentialsStore();
|
|
108
|
-
const authProvider = await (0, auth_provider_1.createAuthProvider)({
|
|
109
|
-
store,
|
|
110
|
-
backendUrl,
|
|
111
|
-
frontendUrl,
|
|
112
|
-
logger: console,
|
|
113
|
-
});
|
|
114
|
-
const client = new api_client_1.ApiClient({ baseUrl: backendUrl });
|
|
115
|
-
const accessToken = await authProvider.getAccessToken();
|
|
116
|
-
const registration = await (0, relay_service_1.registerRelaySession)(client, accessToken, {
|
|
117
|
-
sessionId: options.sessionId,
|
|
118
|
-
});
|
|
119
|
-
const wsUrl = buildRelayWebsocketUrl(backendUrl, registration.relayWsPath);
|
|
120
|
-
console.log(`Using agent session ${registration.sessionId}`);
|
|
121
|
-
await (0, terminal_repl_1.runTerminalRepl)({
|
|
122
|
-
url: wsUrl,
|
|
123
|
-
headers: {
|
|
124
|
-
authorization: `Bearer ${accessToken}`,
|
|
125
|
-
'x-relay-token': registration.relayToken,
|
|
126
|
-
},
|
|
127
|
-
initialSessionId: registration.sessionId,
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
async function runVoice(options) {
|
|
131
|
-
const backendUrl = (0, login_flow_1.resolveBackendUrl)(options.backendUrl);
|
|
132
|
-
const frontendUrl = (0, login_flow_1.resolveFrontendUrl)(options.frontendUrl);
|
|
133
|
-
const store = new credentials_store_1.CredentialsStore();
|
|
134
|
-
const authProvider = await (0, auth_provider_1.createAuthProvider)({
|
|
135
|
-
store,
|
|
136
|
-
backendUrl,
|
|
137
|
-
frontendUrl,
|
|
138
|
-
logger: console,
|
|
139
|
-
});
|
|
140
|
-
const client = new api_client_1.ApiClient({ baseUrl: backendUrl });
|
|
141
|
-
const launch = await (0, voice_service_1.launchVoiceForSession)(client, await authProvider.getAccessToken(), {
|
|
142
|
-
sessionId: options.sessionId,
|
|
143
|
-
force: options.force ?? false,
|
|
144
|
-
roomName: options.roomName,
|
|
145
|
-
});
|
|
146
|
-
console.log('\nVoice agent dispatched successfully.');
|
|
147
|
-
console.log(`Session ID: ${launch.sessionId}`);
|
|
148
|
-
console.log(`LiveKit URL: ${launch.livekitUrl}`);
|
|
149
|
-
console.log(`Room name: ${launch.roomName}`);
|
|
150
|
-
console.log(`Participant identity: ${launch.accessTokenIdentity}`);
|
|
151
|
-
console.log('\nUse this token to join the room:');
|
|
152
|
-
console.log(launch.accessToken);
|
|
153
|
-
console.log('\nOnce connected (for example via the LiveKit Agents playground),');
|
|
154
|
-
console.log('the voice worker will coordinate with the CLI coding agent through the relay.');
|
|
155
|
-
console.log(`Relay websocket: ${launch.relayWsUrl}`);
|
|
156
|
-
console.log(`Relay token (expires in ${launch.relayTokenExpiresIn}s):`);
|
|
157
|
-
console.log(launch.relayToken);
|
|
158
|
-
console.log('\nKeep this information secure—tokens grant access to your agent session.');
|
|
159
|
-
}
|
|
160
|
-
function buildRelayWebsocketUrl(baseUrl, path) {
|
|
161
|
-
const url = new URL(baseUrl);
|
|
162
|
-
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
163
|
-
url.search = '';
|
|
164
|
-
url.hash = '';
|
|
165
|
-
if (path.startsWith('/')) {
|
|
166
|
-
url.pathname = path;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
const basePath = url.pathname.endsWith('/') ? url.pathname : `${url.pathname}/`;
|
|
170
|
-
url.pathname = `${basePath}${path}`;
|
|
171
|
-
}
|
|
172
|
-
return url.toString();
|
|
173
|
-
}
|
|
174
|
-
//# sourceMappingURL=agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":";;AAWA,8CAsCC;AAqBD,oDAgCC;AAtGD,yCAAoC;AACpC,2EAAuE;AACvE,iEAA6D;AAC7D,wDAAoD;AACpD,yDAAwD;AACxD,mDAA+C;AAC/C,0DAA8D;AAC9D,0DAA+D;AAC/D,yDAA2D;AAC3D,mDAA2E;AAE3E,SAAgB,iBAAiB;IAC/B,MAAM,KAAK,GAAG,IAAI,mBAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAC5C,yDAAyD,CAC1D,CAAC;IAEF,KAAK;SACF,OAAO,CAAC,cAAc,CAAC;SACvB,KAAK,CAAC,QAAQ,CAAC;SACf,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,qBAAqB,EAAE,8CAA8C,CAAC;SAC7E,MAAM,CAAC,sBAAsB,EAAE,2CAA2C,CAAC;SAC3E,MAAM,CAAC,KAAK,EAAE,OAA4B,EAAE,EAAE;QAC7C,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEL,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,kEAAkE,CAAC;SAC/E,cAAc,CAAC,mBAAmB,EAAE,6CAA6C,CAAC;SAClF,MAAM,CAAC,qBAAqB,EAAE,8CAA8C,CAAC;SAC7E,MAAM,CAAC,sBAAsB,EAAE,2CAA2C,CAAC;SAC3E,MAAM,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAC5C,MAAM,OAAO,CA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AM,CAAC,mBAAmB,KAAK,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;AAC3F,CAAC;AAED,SAAS,sBAAsB,CAAC,OAAe,EAAE,IAAY;IAC3D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1D,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtB,CAAC;SAAM,CAAC;QACN,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,QAAQ,GAAG,CAAC;QAChF,GAAG,CAAC,QAAQ,GAAG,GAAG,QAAQ,GAAG,IAAI,EAAE,CAAC;IACtC,CAAC;IACD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC"}
|
package/dist/commands/auth.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildAuthCommand = buildAuthCommand;
|
|
4
|
-
const commander_1 = require("commander");
|
|
5
|
-
const credentials_store_1 = require("../auth/credentials-store");
|
|
6
|
-
const api_client_1 = require("../http/api-client");
|
|
7
|
-
const login_flow_1 = require("../auth/login-flow");
|
|
8
|
-
function buildAuthCommand() {
|
|
9
|
-
const auth = new commander_1.Command('auth').description('Authenticate the Omnara CLI.');
|
|
10
|
-
auth
|
|
11
|
-
.command('login')
|
|
12
|
-
.description('Authenticate via the browser-based verification flow.')
|
|
13
|
-
.option('--backend-url <url>', 'Backend base URL')
|
|
14
|
-
.option('--frontend-url <url>', 'Frontend URL to open for verification')
|
|
15
|
-
.action(async (options) => {
|
|
16
|
-
const store = new credentials_store_1.CredentialsStore();
|
|
17
|
-
const backendUrl = (0, login_flow_1.resolveBackendUrl)(options.backendUrl);
|
|
18
|
-
try {
|
|
19
|
-
await (0, login_flow_1.performVerificationLogin)({
|
|
20
|
-
backendUrlOption: backendUrl,
|
|
21
|
-
frontendUrlOption: options.frontendUrl,
|
|
22
|
-
store,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
if (error instanceof api_client_1.ApiError) {
|
|
27
|
-
console.error(`\nRequest failed (HTTP ${error.status}): ${error.message}`);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
console.error(`\nLogin failed: ${extractErrorMessage(error)}`);
|
|
31
|
-
}
|
|
32
|
-
process.exitCode = 1;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
auth
|
|
36
|
-
.command('logout')
|
|
37
|
-
.description('Remove stored CLI credentials.')
|
|
38
|
-
.action(async () => {
|
|
39
|
-
const store = new credentials_store_1.CredentialsStore();
|
|
40
|
-
await store.clear();
|
|
41
|
-
console.log('Credentials cleared.');
|
|
42
|
-
});
|
|
43
|
-
auth
|
|
44
|
-
.command('status')
|
|
45
|
-
.description('Show stored CLI credential details.')
|
|
46
|
-
.action(async () => {
|
|
47
|
-
const store = new credentials_store_1.CredentialsStore();
|
|
48
|
-
const credentials = await store.load();
|
|
49
|
-
if (!credentials) {
|
|
50
|
-
console.log('No credentials stored.');
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
printStatus(credentials);
|
|
54
|
-
});
|
|
55
|
-
return auth;
|
|
56
|
-
}
|
|
57
|
-
function printStatus(credentials) {
|
|
58
|
-
if (credentials.accessToken) {
|
|
59
|
-
const accessStatus = describeExpiry(credentials.accessTokenExpiresAt);
|
|
60
|
-
const refreshStatus = credentials.refreshTokenExpiresAt
|
|
61
|
-
? describeExpiry(credentials.refreshTokenExpiresAt)
|
|
62
|
-
: 'unknown expiry';
|
|
63
|
-
console.log(`Authentication: Supabase access token (${accessStatus}), Refresh token (${refreshStatus})`);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
console.log('Authentication: Not configured');
|
|
67
|
-
}
|
|
68
|
-
function describeExpiry(iso) {
|
|
69
|
-
if (!iso) {
|
|
70
|
-
return 'unknown expiry';
|
|
71
|
-
}
|
|
72
|
-
const timestamp = Date.parse(iso);
|
|
73
|
-
if (Number.isNaN(timestamp)) {
|
|
74
|
-
return 'invalid timestamp';
|
|
75
|
-
}
|
|
76
|
-
const diff = timestamp - Date.now();
|
|
77
|
-
const abs = Math.abs(diff);
|
|
78
|
-
const descriptor = (0, login_flow_1.formatDuration)(abs);
|
|
79
|
-
return diff >= 0 ? `expires in ${descriptor}` : `expired ${descriptor} ago`;
|
|
80
|
-
}
|
|
81
|
-
function extractErrorMessage(error) {
|
|
82
|
-
if (error instanceof Error) {
|
|
83
|
-
return error.message;
|
|
84
|
-
}
|
|
85
|
-
return String(error);
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":";;AAUA,4CAoDC;AA9DD,yCAAoC;AACpC,iEAAgF;AAChF,mDAA8C;AAC9C,mDAAiG;AAOjG,SAAgB,gBAAgB;IAC9B,MAAM,IAAI,GAAG,IAAI,mBAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAC;IAE7E,IAAI;SACD,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,uDAAuD,CAA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AAU,EAAE,CAAC,CAAC,CAAC,WAAW,UAAU,MAAM,CAAC;AAC9E,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc;IACzC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/commands/hello.d.ts
DELETED
package/dist/commands/hello.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildHelloCommand = buildHelloCommand;
|
|
4
|
-
const commander_1 = require("commander");
|
|
5
|
-
function buildHelloCommand() {
|
|
6
|
-
return new commander_1.Command('hello')
|
|
7
|
-
.description('Print a friendly greeting.')
|
|
8
|
-
.action(() => {
|
|
9
|
-
console.log('Welcome to the Omnara CLI prototype.');
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=hello.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hello.js","sourceRoot":"","sources":["../../src/commands/hello.ts"],"names":[],"mappings":";;AAEA,8CAMC;AARD,yCAAoC;AAEpC,SAAgB,iBAAiB;IAC/B,OAAO,IAAI,mBAAO,CAAC,OAAO,CAAC;SACxB,WAAW,CAAC,4BAA4B,CAAC;SACzC,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/commands/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildAuthCommand = exports.runAgentOrchestrator = exports.buildAgentCommand = void 0;
|
|
4
|
-
var agent_1 = require("./agent");
|
|
5
|
-
Object.defineProperty(exports, "buildAgentCommand", { enumerable: true, get: function () { return agent_1.buildAgentCommand; } });
|
|
6
|
-
Object.defineProperty(exports, "runAgentOrchestrator", { enumerable: true, get: function () { return agent_1.runAgentOrchestrator; } });
|
|
7
|
-
var auth_1 = require("./auth");
|
|
8
|
-
Object.defineProperty(exports, "buildAuthCommand", { enumerable: true, get: function () { return auth_1.buildAuthCommand; } });
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";;;AAAA,iCAA4F;AAAnF,0GAAA,iBAAiB,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAChD,+BAA0C;AAAjC,wGAAA,gBAAgB,OAAA"}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
export declare const protobufPackage = "omnara.relay";
|
|
3
|
-
export declare enum WorkerStatus {
|
|
4
|
-
WORKER_STATUS_UNSPECIFIED = 0,
|
|
5
|
-
WORKER_STATUS_RUNNING = 1,
|
|
6
|
-
WORKER_STATUS_COMPLETED = 2,
|
|
7
|
-
WORKER_STATUS_ERROR = 3,
|
|
8
|
-
WORKER_STATUS_CANCELED = 4,
|
|
9
|
-
UNRECOGNIZED = -1
|
|
10
|
-
}
|
|
11
|
-
export declare function workerStatusFromJSON(object: any): WorkerStatus;
|
|
12
|
-
export declare function workerStatusToJSON(object: WorkerStatus): string;
|
|
13
|
-
export declare enum AssistantMessageOrigin {
|
|
14
|
-
ORIGIN_UNSPECIFIED = 0,
|
|
15
|
-
ORIGIN_USER = 1,
|
|
16
|
-
ORIGIN_WORKER = 2,
|
|
17
|
-
UNRECOGNIZED = -1
|
|
18
|
-
}
|
|
19
|
-
export declare function assistantMessageOriginFromJSON(object: any): AssistantMessageOrigin;
|
|
20
|
-
export declare function assistantMessageOriginToJSON(object: AssistantMessageOrigin): string;
|
|
21
|
-
export interface SessionCreated {
|
|
22
|
-
sessionId: string;
|
|
23
|
-
}
|
|
24
|
-
export interface SessionJoined {
|
|
25
|
-
sessionId: string;
|
|
26
|
-
}
|
|
27
|
-
export interface SessionInit {
|
|
28
|
-
sessionId: string;
|
|
29
|
-
parentSessionId?: string | undefined;
|
|
30
|
-
metadata: {
|
|
31
|
-
[key: string]: string;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export interface SessionInit_MetadataEntry {
|
|
35
|
-
key: string;
|
|
36
|
-
value: string;
|
|
37
|
-
}
|
|
38
|
-
export interface SessionInitialized {
|
|
39
|
-
sessionId: string;
|
|
40
|
-
parentSessionId?: string | undefined;
|
|
41
|
-
}
|
|
42
|
-
export interface UserText {
|
|
43
|
-
sessionId: string;
|
|
44
|
-
text: string;
|
|
45
|
-
origin: AssistantMessageOrigin;
|
|
46
|
-
}
|
|
47
|
-
export interface AssistantText {
|
|
48
|
-
sessionId: string;
|
|
49
|
-
text: string;
|
|
50
|
-
}
|
|
51
|
-
export interface AssistantComplete {
|
|
52
|
-
sessionId: string;
|
|
53
|
-
}
|
|
54
|
-
export interface ToolCall {
|
|
55
|
-
sessionId: string;
|
|
56
|
-
toolName: string;
|
|
57
|
-
toolUseId: string;
|
|
58
|
-
inputJson: string;
|
|
59
|
-
}
|
|
60
|
-
export interface ToolResult {
|
|
61
|
-
sessionId: string;
|
|
62
|
-
toolUseId: string;
|
|
63
|
-
contentJson: string;
|
|
64
|
-
isError: boolean;
|
|
65
|
-
}
|
|
66
|
-
export interface ResultMessage {
|
|
67
|
-
sessionId: string;
|
|
68
|
-
success: boolean;
|
|
69
|
-
message: string;
|
|
70
|
-
durationMs: number;
|
|
71
|
-
costUsd: number;
|
|
72
|
-
}
|
|
73
|
-
export interface SystemMessage {
|
|
74
|
-
sessionId: string;
|
|
75
|
-
subtype: string;
|
|
76
|
-
}
|
|
77
|
-
export interface ErrorMessage {
|
|
78
|
-
sessionId?: string | undefined;
|
|
79
|
-
message: string;
|
|
80
|
-
}
|
|
81
|
-
export interface WorkerUpdate {
|
|
82
|
-
id: string;
|
|
83
|
-
status: WorkerStatus;
|
|
84
|
-
prompt: string;
|
|
85
|
-
lastUpdateAt: number;
|
|
86
|
-
latestMessage?: string | undefined;
|
|
87
|
-
result?: string | undefined;
|
|
88
|
-
error?: string | undefined;
|
|
89
|
-
originSessionId?: string | undefined;
|
|
90
|
-
sessionId: string;
|
|
91
|
-
}
|
|
92
|
-
export interface WorkerUpdateEnvelope {
|
|
93
|
-
sessionId?: string | undefined;
|
|
94
|
-
worker?: WorkerUpdate | undefined;
|
|
95
|
-
}
|
|
96
|
-
export interface Pong {
|
|
97
|
-
sessionId?: string | undefined;
|
|
98
|
-
}
|
|
99
|
-
export interface ClientChat {
|
|
100
|
-
sessionId?: string | undefined;
|
|
101
|
-
text: string;
|
|
102
|
-
}
|
|
103
|
-
export interface ClientSessionInit {
|
|
104
|
-
sessionId: string;
|
|
105
|
-
parentSessionId?: string | undefined;
|
|
106
|
-
metadata: {
|
|
107
|
-
[key: string]: string;
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
export interface ClientSessionInit_MetadataEntry {
|
|
111
|
-
key: string;
|
|
112
|
-
value: string;
|
|
113
|
-
}
|
|
114
|
-
export interface ClientJoin {
|
|
115
|
-
sessionId: string;
|
|
116
|
-
}
|
|
117
|
-
export interface ClientLeave {
|
|
118
|
-
sessionId: string;
|
|
119
|
-
}
|
|
120
|
-
export interface ClientCancelWorker {
|
|
121
|
-
workerId: string;
|
|
122
|
-
}
|
|
123
|
-
export interface ClientPing {
|
|
124
|
-
}
|
|
125
|
-
export interface ClientMessage {
|
|
126
|
-
payload?: {
|
|
127
|
-
$case: "chat";
|
|
128
|
-
chat: ClientChat;
|
|
129
|
-
} | {
|
|
130
|
-
$case: "sessionInit";
|
|
131
|
-
sessionInit: ClientSessionInit;
|
|
132
|
-
} | {
|
|
133
|
-
$case: "join";
|
|
134
|
-
join: ClientJoin;
|
|
135
|
-
} | {
|
|
136
|
-
$case: "leave";
|
|
137
|
-
leave: ClientLeave;
|
|
138
|
-
} | {
|
|
139
|
-
$case: "cancelWorker";
|
|
140
|
-
cancelWorker: ClientCancelWorker;
|
|
141
|
-
} | {
|
|
142
|
-
$case: "ping";
|
|
143
|
-
ping: ClientPing;
|
|
144
|
-
} | undefined;
|
|
145
|
-
}
|
|
146
|
-
export interface ServerMessage {
|
|
147
|
-
payload?: {
|
|
148
|
-
$case: "sessionCreated";
|
|
149
|
-
sessionCreated: SessionCreated;
|
|
150
|
-
} | {
|
|
151
|
-
$case: "sessionJoined";
|
|
152
|
-
sessionJoined: SessionJoined;
|
|
153
|
-
} | {
|
|
154
|
-
$case: "sessionInit";
|
|
155
|
-
sessionInit: SessionInit;
|
|
156
|
-
} | {
|
|
157
|
-
$case: "sessionInitialized";
|
|
158
|
-
sessionInitialized: SessionInitialized;
|
|
159
|
-
} | {
|
|
160
|
-
$case: "userText";
|
|
161
|
-
userText: UserText;
|
|
162
|
-
} | {
|
|
163
|
-
$case: "assistantText";
|
|
164
|
-
assistantText: AssistantText;
|
|
165
|
-
} | {
|
|
166
|
-
$case: "assistantComplete";
|
|
167
|
-
assistantComplete: AssistantComplete;
|
|
168
|
-
} | {
|
|
169
|
-
$case: "toolCall";
|
|
170
|
-
toolCall: ToolCall;
|
|
171
|
-
} | {
|
|
172
|
-
$case: "toolResult";
|
|
173
|
-
toolResult: ToolResult;
|
|
174
|
-
} | {
|
|
175
|
-
$case: "result";
|
|
176
|
-
result: ResultMessage;
|
|
177
|
-
} | {
|
|
178
|
-
$case: "system";
|
|
179
|
-
system: SystemMessage;
|
|
180
|
-
} | {
|
|
181
|
-
$case: "error";
|
|
182
|
-
error: ErrorMessage;
|
|
183
|
-
} | {
|
|
184
|
-
$case: "workerUpdate";
|
|
185
|
-
workerUpdate: WorkerUpdateEnvelope;
|
|
186
|
-
} | {
|
|
187
|
-
$case: "pong";
|
|
188
|
-
pong: Pong;
|
|
189
|
-
} | undefined;
|
|
190
|
-
}
|
|
191
|
-
export declare const SessionCreated: MessageFns<SessionCreated>;
|
|
192
|
-
export declare const SessionJoined: MessageFns<SessionJoined>;
|
|
193
|
-
export declare const SessionInit: MessageFns<SessionInit>;
|
|
194
|
-
export declare const SessionInit_MetadataEntry: MessageFns<SessionInit_MetadataEntry>;
|
|
195
|
-
export declare const SessionInitialized: MessageFns<SessionInitialized>;
|
|
196
|
-
export declare const UserText: MessageFns<UserText>;
|
|
197
|
-
export declare const AssistantText: MessageFns<AssistantText>;
|
|
198
|
-
export declare const AssistantComplete: MessageFns<AssistantComplete>;
|
|
199
|
-
export declare const ToolCall: MessageFns<ToolCall>;
|
|
200
|
-
export declare const ToolResult: MessageFns<ToolResult>;
|
|
201
|
-
export declare const ResultMessage: MessageFns<ResultMessage>;
|
|
202
|
-
export declare const SystemMessage: MessageFns<SystemMessage>;
|
|
203
|
-
export declare const ErrorMessage: MessageFns<ErrorMessage>;
|
|
204
|
-
export declare const WorkerUpdate: MessageFns<WorkerUpdate>;
|
|
205
|
-
export declare const WorkerUpdateEnvelope: MessageFns<WorkerUpdateEnvelope>;
|
|
206
|
-
export declare const Pong: MessageFns<Pong>;
|
|
207
|
-
export declare const ClientChat: MessageFns<ClientChat>;
|
|
208
|
-
export declare const ClientSessionInit: MessageFns<ClientSessionInit>;
|
|
209
|
-
export declare const ClientSessionInit_MetadataEntry: MessageFns<ClientSessionInit_MetadataEntry>;
|
|
210
|
-
export declare const ClientJoin: MessageFns<ClientJoin>;
|
|
211
|
-
export declare const ClientLeave: MessageFns<ClientLeave>;
|
|
212
|
-
export declare const ClientCancelWorker: MessageFns<ClientCancelWorker>;
|
|
213
|
-
export declare const ClientPing: MessageFns<ClientPing>;
|
|
214
|
-
export declare const ClientMessage: MessageFns<ClientMessage>;
|
|
215
|
-
export declare const ServerMessage: MessageFns<ServerMessage>;
|
|
216
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
217
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
218
|
-
$case: string;
|
|
219
|
-
} ? {
|
|
220
|
-
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
221
|
-
} & {
|
|
222
|
-
$case: T["$case"];
|
|
223
|
-
} : T extends {} ? {
|
|
224
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
225
|
-
} : Partial<T>;
|
|
226
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
227
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
228
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
229
|
-
} & {
|
|
230
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
231
|
-
};
|
|
232
|
-
export interface MessageFns<T> {
|
|
233
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
234
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
235
|
-
fromJSON(object: any): T;
|
|
236
|
-
toJSON(message: T): unknown;
|
|
237
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
238
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
239
|
-
}
|
|
240
|
-
export {};
|