@creativeintelligence/abbie 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/context/inject.js +1 -1
- package/dist/cli/commands/context/list.js +1 -1
- package/dist/cli/commands/context/publish.js +1 -1
- package/dist/cli/commands/context/read.js +1 -1
- package/dist/cli/commands/daemon.js +1 -1
- package/dist/cli/commands/history/index.d.ts +13 -2
- package/dist/cli/commands/history/index.d.ts.map +1 -1
- package/dist/cli/commands/history/index.js +2 -2
- package/dist/cli/commands/login.js +2 -2
- package/dist/cli/commands/logout.js +1 -1
- package/dist/cli/commands/preview/index.js +2 -2
- package/dist/cli/commands/preview/list.js +2 -2
- package/dist/cli/commands/preview/status.js +2 -2
- package/dist/cli/commands/preview/stop.js +2 -2
- package/dist/cli/commands/push.js +2 -2
- package/dist/cli/commands/session/list.js +1 -1
- package/dist/cli/commands/session/mark-done.js +1 -1
- package/dist/cli/commands/session/replay.js +1 -1
- package/dist/cli/commands/session/start.js +1 -1
- package/dist/cli/commands/session/stop.js +1 -1
- package/dist/cli/commands/start.d.ts +2 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +17 -12
- package/dist/cli/commands/status.js +2 -2
- package/dist/cli/commands/sync.js +2 -2
- package/dist/cli/commands/windows/list.js +1 -1
- package/dist/lib/active-sessions.js +6 -6
- package/dist/lib/annotations-convex.js +1 -1
- package/dist/lib/events.js +1 -1
- package/dist/lib/provider-auth.d.ts +38 -0
- package/dist/lib/provider-auth.d.ts.map +1 -0
- package/dist/lib/provider-auth.js +193 -0
- package/dist/lib/report.js +1 -1
- package/dist/lib/runner.js +4 -4
- package/extensions/abbie/index.ts +63 -0
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
- package/src/cli/commands/__tests__/daemon.test.ts +1 -1
- package/src/cli/commands/context/inject.ts +1 -1
- package/src/cli/commands/context/list.ts +1 -1
- package/src/cli/commands/context/publish.ts +1 -1
- package/src/cli/commands/context/read.ts +1 -1
- package/src/cli/commands/daemon.ts +1 -1
- package/src/cli/commands/history/index.ts +15 -3
- package/src/cli/commands/login.ts +2 -2
- package/src/cli/commands/logout.ts +1 -1
- package/src/cli/commands/preview/index.ts +2 -2
- package/src/cli/commands/preview/list.ts +2 -2
- package/src/cli/commands/preview/status.ts +2 -2
- package/src/cli/commands/preview/stop.ts +2 -2
- package/src/cli/commands/push.ts +2 -2
- package/src/cli/commands/session/list.ts +1 -1
- package/src/cli/commands/session/mark-done.ts +1 -1
- package/src/cli/commands/session/replay.ts +1 -1
- package/src/cli/commands/session/start.ts +1 -1
- package/src/cli/commands/session/stop.ts +1 -1
- package/src/cli/commands/start.ts +19 -13
- package/src/cli/commands/status.ts +2 -2
- package/src/cli/commands/sync.ts +2 -2
- package/src/cli/commands/windows/list.ts +1 -1
- package/src/lib/active-sessions.ts +6 -6
- package/src/lib/annotations-convex.ts +1 -1
- package/src/lib/events.ts +1 -1
- package/src/lib/provider-auth.ts +258 -0
- package/src/lib/report.ts +1 -1
- package/src/lib/runner.ts +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getHttpClient, api } from "@
|
|
1
|
+
import { getHttpClient, api } from "@creativeintelligence/sdk/convex";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { BaseCommand } from "../../base-command.js";
|
|
4
4
|
export default class ContextInject extends BaseCommand {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getHttpClient, api } from "@
|
|
1
|
+
import { getHttpClient, api } from "@creativeintelligence/sdk/convex";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { BaseCommand } from "../../base-command.js";
|
|
4
4
|
export default class ContextList extends BaseCommand {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api, getHttpClient } from "@
|
|
1
|
+
import { api, getHttpClient } from "@creativeintelligence/sdk/convex";
|
|
2
2
|
import { Args, Flags } from "@oclif/core";
|
|
3
3
|
import { BaseCommand } from "../../base-command.js";
|
|
4
4
|
export default class ContextPublish extends BaseCommand {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getHttpClient, api } from "@
|
|
1
|
+
import { getHttpClient, api } from "@creativeintelligence/sdk/convex";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { BaseCommand } from "../../base-command.js";
|
|
4
4
|
export default class ContextRead extends BaseCommand {
|
|
@@ -3,7 +3,7 @@ import { createHash } from "node:crypto";
|
|
|
3
3
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { homedir, hostname } from "node:os";
|
|
5
5
|
import { join } from "node:path";
|
|
6
|
-
import { api, closeClients, getHttpClient, isConvexConfigured, subscribe } from "@
|
|
6
|
+
import { api, closeClients, getHttpClient, isConvexConfigured, subscribe } from "@creativeintelligence/sdk/convex";
|
|
7
7
|
import { Flags } from "@oclif/core";
|
|
8
8
|
import { getActiveSessionManager } from "../../lib/active-sessions.js";
|
|
9
9
|
import { discoverProjects, loadConfig } from "../../lib/config-loader.js";
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { type Doc } from "@abbie/sdk/convex";
|
|
2
1
|
import { BaseCommand } from "../../base-command.js";
|
|
3
|
-
type HistoryEvent =
|
|
2
|
+
type HistoryEvent = {
|
|
3
|
+
_id: string;
|
|
4
|
+
_creationTime: number;
|
|
5
|
+
timestamp?: number;
|
|
6
|
+
action?: string;
|
|
7
|
+
task?: string;
|
|
8
|
+
confidence?: number;
|
|
9
|
+
project?: string;
|
|
10
|
+
deviceId?: string;
|
|
11
|
+
agent?: string;
|
|
12
|
+
traceId?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
};
|
|
4
15
|
interface HistoryResult {
|
|
5
16
|
success: boolean;
|
|
6
17
|
events: HistoryEvent[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/history/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/history/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,UAAU,aAAa;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAwBD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IACrD,OAAgB,OAAO,SAA+B;IACtD,OAAgB,WAAW,SAIwB;IAEnD,OAAgB,QAAQ,WAQtB;IAEF,OAAgB,KAAK;;;;;;;;;;;;;;MAsCnB;IAEI,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;IA4DvC;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IA8ClB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,gBAAgB;CAgCzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api, getHttpClient } from "@
|
|
1
|
+
import { api, getHttpClient } from "@creativeintelligence/sdk/convex";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { BaseCommand } from "../../base-command.js";
|
|
4
4
|
/**
|
|
@@ -140,7 +140,7 @@ SYMMETRY: abbie report writes → abbie history reads`;
|
|
|
140
140
|
postFilter(events, flags, sinceMs) {
|
|
141
141
|
let filtered = events;
|
|
142
142
|
if (sinceMs !== undefined) {
|
|
143
|
-
filtered = filtered.filter((e) => e.timestamp >= sinceMs);
|
|
143
|
+
filtered = filtered.filter((e) => (e.timestamp ?? 0) >= sinceMs);
|
|
144
144
|
}
|
|
145
145
|
if (flags["trace-id"]) {
|
|
146
146
|
filtered = filtered.filter((e) => e.traceId === flags["trace-id"]);
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* 6. Optionally trigger initial sync
|
|
11
11
|
*/
|
|
12
12
|
import { Flags } from "@oclif/core";
|
|
13
|
-
import { getDeviceInfo, getStoredClerkId, saveClerkId, getWebUrl } from "@
|
|
14
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
13
|
+
import { getDeviceInfo, getStoredClerkId, saveClerkId, getWebUrl } from "@creativeintelligence/sdk/config";
|
|
14
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
15
15
|
import { BaseCommand } from "../base-command.js";
|
|
16
16
|
const POLL_INTERVAL_MS = 1_500;
|
|
17
17
|
const MAX_POLL_DURATION_MS = 10 * 60 * 1_000; // 10 minutes (matches code TTL)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* abbie logout — clear stored credentials from this device.
|
|
3
3
|
*/
|
|
4
|
-
import { clearClerkId, getStoredClerkId, getDeviceInfo } from "@
|
|
4
|
+
import { clearClerkId, getStoredClerkId, getDeviceInfo } from "@creativeintelligence/sdk/config";
|
|
5
5
|
import { BaseCommand } from "../base-command.js";
|
|
6
6
|
export default class LogoutCommand extends BaseCommand {
|
|
7
7
|
static summary = "Clear authentication from this device";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { basename, resolve } from "node:path";
|
|
3
|
-
import { getStoredClerkId } from "@
|
|
4
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
3
|
+
import { getStoredClerkId } from "@creativeintelligence/sdk/config";
|
|
4
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
5
5
|
import { Args, Flags } from "@oclif/core";
|
|
6
6
|
import { detectProject } from "../../../lib/preview/detect.js";
|
|
7
7
|
import { BaseCommand } from "../../base-command.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getStoredClerkId } from "@
|
|
2
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
1
|
+
import { getStoredClerkId } from "@creativeintelligence/sdk/config";
|
|
2
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
3
3
|
import { Flags } from "@oclif/core";
|
|
4
4
|
import { BaseCommand } from "../../base-command.js";
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { basename, resolve } from "node:path";
|
|
2
|
-
import { getStoredClerkId } from "@
|
|
3
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
2
|
+
import { getStoredClerkId } from "@creativeintelligence/sdk/config";
|
|
3
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
4
4
|
import { Args, Flags } from "@oclif/core";
|
|
5
5
|
import { BaseCommand } from "../../base-command.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { basename, resolve } from "node:path";
|
|
2
|
-
import { getStoredClerkId } from "@
|
|
3
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
2
|
+
import { getStoredClerkId } from "@creativeintelligence/sdk/config";
|
|
3
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
4
4
|
import { Args, Flags } from "@oclif/core";
|
|
5
5
|
import { BaseCommand } from "../../base-command.js";
|
|
6
6
|
/**
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* --type: push specific content type only.
|
|
7
7
|
*/
|
|
8
8
|
import { Flags } from "@oclif/core";
|
|
9
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
10
|
-
import { getStoredClerkId } from "@
|
|
9
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
10
|
+
import { getStoredClerkId } from "@creativeintelligence/sdk/config";
|
|
11
11
|
import { ContentSyncRunner, } from "../../lib/content-sync/index.js";
|
|
12
12
|
import { BaseCommand } from "../base-command.js";
|
|
13
13
|
export default class PushCommand extends BaseCommand {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { getHttpClient, api } from "@
|
|
2
|
+
import { getHttpClient, api } from "@creativeintelligence/sdk/convex";
|
|
3
3
|
import { Flags } from "@oclif/core";
|
|
4
4
|
import { getActiveSessionManager } from "../../../lib/active-sessions.js";
|
|
5
5
|
import { getDeviceId } from "../../../lib/device.js";
|
|
@@ -2,7 +2,7 @@ import { spawnSync } from "node:child_process";
|
|
|
2
2
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import { getHttpClient, api } from "@
|
|
5
|
+
import { getHttpClient, api } from "@creativeintelligence/sdk/convex";
|
|
6
6
|
import { Args } from "@oclif/core";
|
|
7
7
|
import { getActiveSessionManager } from "../../../lib/active-sessions.js";
|
|
8
8
|
import { createEvent, EventStore } from "../../../lib/events.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
|
-
import { api, getHttpClient } from "@
|
|
2
|
+
import { api, getHttpClient } from "@creativeintelligence/sdk/convex";
|
|
3
3
|
import { Args, Flags } from "@oclif/core";
|
|
4
4
|
import { getActiveSessionManager } from "../../../lib/active-sessions.js";
|
|
5
5
|
import { AgentSessionMiner } from "../../../lib/agent-sessions.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { basename } from "node:path";
|
|
3
|
-
import { api, getHttpClient } from "@
|
|
3
|
+
import { api, getHttpClient } from "@creativeintelligence/sdk/convex";
|
|
4
4
|
import { Flags } from "@oclif/core";
|
|
5
5
|
import { getActiveSessionManager } from "../../../lib/active-sessions.js";
|
|
6
6
|
import { telemetry } from "../../../lib/analytics.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getHttpClient, api } from "@
|
|
1
|
+
import { getHttpClient, api } from "@creativeintelligence/sdk/convex";
|
|
2
2
|
import { Args, Flags } from "@oclif/core";
|
|
3
3
|
import { getActiveSessionManager } from "../../../lib/active-sessions.js";
|
|
4
4
|
import { BaseCommand } from "../../base-command.js";
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* 1. Check Pi → not found → auto-install
|
|
6
6
|
* 2. Install Abbie Pi extension
|
|
7
7
|
* 3. Open browser for Clerk auth
|
|
8
|
-
* 4.
|
|
8
|
+
* 4. Connect AI provider (OAuth — uses your subscription)
|
|
9
|
+
* 5. Launch Pi (extension auto-starts bridge)
|
|
9
10
|
*
|
|
10
11
|
* Subsequent runs:
|
|
11
12
|
* Launch Pi directly (extension handles bridge)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAoCjD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IACrD,OAAgB,EAAE,SAAM;IACxB,OAAgB,OAAO,SAAkB;IACzC,OAAgB,WAAW,SAQsB;IAEjD,OAAgB,QAAQ,WAItB;IAEF,OAAgB,KAAK;;;;;;;MAUnB;IAGF,OAAgB,MAAM,UAAS;IAEzB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;YAyDnB,QAAQ;IAqFtB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAmB5B"}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* 1. Check Pi → not found → auto-install
|
|
6
6
|
* 2. Install Abbie Pi extension
|
|
7
7
|
* 3. Open browser for Clerk auth
|
|
8
|
-
* 4.
|
|
8
|
+
* 4. Connect AI provider (OAuth — uses your subscription)
|
|
9
|
+
* 5. Launch Pi (extension auto-starts bridge)
|
|
9
10
|
*
|
|
10
11
|
* Subsequent runs:
|
|
11
12
|
* Launch Pi directly (extension handles bridge)
|
|
@@ -17,6 +18,7 @@ import { fileURLToPath } from "node:url";
|
|
|
17
18
|
import { spawnSync, spawn, execSync } from "node:child_process";
|
|
18
19
|
import { Flags } from "@oclif/core";
|
|
19
20
|
import { BaseCommand } from "../base-command.js";
|
|
21
|
+
import { hasAnyProvider, ensureProviderConnected, getConnectedProviders } from "../../lib/provider-auth.js";
|
|
20
22
|
const __filename = fileURLToPath(import.meta.url);
|
|
21
23
|
const __dirname = dirname(__filename);
|
|
22
24
|
const PI_PACKAGE = "@mariozechner/pi-coding-agent";
|
|
@@ -86,17 +88,20 @@ After setup, just run \`abbie\` to start working.`;
|
|
|
86
88
|
const extOk = extensionInstalled();
|
|
87
89
|
// --status: show state and exit
|
|
88
90
|
if (flags.status) {
|
|
91
|
+
const providers = getConnectedProviders();
|
|
89
92
|
this.log("");
|
|
90
93
|
this.log(" abbie status");
|
|
91
94
|
this.log("");
|
|
92
95
|
this.log(` pi: ${pi.installed ? `✓ ${pi.version}` : "✗ not installed"}`);
|
|
93
96
|
this.log(` extension: ${extOk ? "✓ installed" : "✗ not installed"}`);
|
|
94
97
|
this.log(` auth: ${configured ? "✓ configured" : "✗ not configured"}`);
|
|
98
|
+
this.log(` providers: ${providers.length > 0 ? `✓ ${providers.join(", ")}` : "✗ none connected"}`);
|
|
95
99
|
this.log("");
|
|
96
|
-
return { pi: pi.installed, extension: extOk, auth: configured };
|
|
100
|
+
return { pi: pi.installed, extension: extOk, auth: configured, providers };
|
|
97
101
|
}
|
|
98
102
|
// Setup needed?
|
|
99
|
-
const
|
|
103
|
+
const providerOk = hasAnyProvider();
|
|
104
|
+
const needsSetup = flags.setup || !pi.installed || !configured || !extOk || !providerOk;
|
|
100
105
|
if (needsSetup) {
|
|
101
106
|
await this.runSetup(pi, configured, extOk);
|
|
102
107
|
// Re-check after setup
|
|
@@ -130,7 +135,7 @@ After setup, just run \`abbie\` to start working.`;
|
|
|
130
135
|
this.log("");
|
|
131
136
|
// Step 1: Install Pi
|
|
132
137
|
if (!pi.installed) {
|
|
133
|
-
this.log(" [1/
|
|
138
|
+
this.log(" [1/4] installing pi...");
|
|
134
139
|
this.log(` npm install -g ${PI_PACKAGE}`);
|
|
135
140
|
this.log("");
|
|
136
141
|
try {
|
|
@@ -158,12 +163,12 @@ After setup, just run \`abbie\` to start working.`;
|
|
|
158
163
|
}
|
|
159
164
|
}
|
|
160
165
|
else {
|
|
161
|
-
this.log(` [1/
|
|
166
|
+
this.log(` [1/4] pi ${pi.version} ✓`);
|
|
162
167
|
}
|
|
163
168
|
this.log("");
|
|
164
169
|
// Step 2: Install Abbie extension
|
|
165
170
|
if (!extOk) {
|
|
166
|
-
this.log(" [2/
|
|
171
|
+
this.log(" [2/4] installing abbie extension...");
|
|
167
172
|
// Find the bundled extension
|
|
168
173
|
const extSource = this.findExtensionSource();
|
|
169
174
|
if (extSource) {
|
|
@@ -177,12 +182,12 @@ After setup, just run \`abbie\` to start working.`;
|
|
|
177
182
|
}
|
|
178
183
|
}
|
|
179
184
|
else {
|
|
180
|
-
this.log(" [2/
|
|
185
|
+
this.log(" [2/4] extension ✓");
|
|
181
186
|
}
|
|
182
187
|
this.log("");
|
|
183
188
|
// Step 3: Authenticate
|
|
184
189
|
if (!configured) {
|
|
185
|
-
this.log(" [3/
|
|
190
|
+
this.log(" [3/4] authenticating...");
|
|
186
191
|
this.log(" opening browser for login...");
|
|
187
192
|
this.log("");
|
|
188
193
|
// Delegate to the login command
|
|
@@ -194,13 +199,13 @@ After setup, just run \`abbie\` to start working.`;
|
|
|
194
199
|
}
|
|
195
200
|
}
|
|
196
201
|
else {
|
|
197
|
-
this.log(" [3/
|
|
202
|
+
this.log(" [3/4] authenticated ✓");
|
|
198
203
|
}
|
|
199
204
|
this.log("");
|
|
200
|
-
|
|
205
|
+
// Step 4: Connect AI provider
|
|
206
|
+
await ensureProviderConnected((msg) => this.log(msg));
|
|
201
207
|
this.log("");
|
|
202
|
-
this.log("
|
|
203
|
-
this.log(" (Anthropic, OpenAI, Google, or GitHub Copilot)");
|
|
208
|
+
this.log(" setup complete ✓");
|
|
204
209
|
}
|
|
205
210
|
/**
|
|
206
211
|
* Find the bundled extension source directory.
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* - Pending changes
|
|
10
10
|
*/
|
|
11
11
|
import { existsSync, readFileSync } from "node:fs";
|
|
12
|
-
import { isConvexConfigured } from "@
|
|
13
|
-
import { getStoredClerkId } from "@
|
|
12
|
+
import { isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
13
|
+
import { getStoredClerkId } from "@creativeintelligence/sdk/config";
|
|
14
14
|
import { getAdapter, getSyncDir } from "../../lib/config-sync/index.js";
|
|
15
15
|
import { getLatestBackup } from "../../lib/config-sync/writer.js";
|
|
16
16
|
import { BaseCommand } from "../base-command.js";
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* --type: sync specific content type only (content sync only).
|
|
13
13
|
*/
|
|
14
14
|
import { Flags } from "@oclif/core";
|
|
15
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
16
|
-
import { getStoredClerkId } from "@
|
|
15
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
16
|
+
import { getStoredClerkId } from "@creativeintelligence/sdk/config";
|
|
17
17
|
import { ConfigSyncRunner } from "../../lib/config-sync/index.js";
|
|
18
18
|
import { ContentSyncRunner } from "../../lib/content-sync/index.js";
|
|
19
19
|
import { BaseCommand } from "../base-command.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
1
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { getDeviceId } from "../../../lib/device.js";
|
|
4
4
|
import { isRunning } from "../../../lib/tmux/index.js";
|
|
@@ -751,7 +751,7 @@ Avoid editing the same files simultaneously. Check git status before committing.
|
|
|
751
751
|
*/
|
|
752
752
|
async getFileProvenanceContext(project) {
|
|
753
753
|
try {
|
|
754
|
-
const { getHttpClient, api } = await import("@
|
|
754
|
+
const { getHttpClient, api } = await import("@creativeintelligence/sdk/convex");
|
|
755
755
|
const client = getHttpClient();
|
|
756
756
|
const entries = await client.query(api.contextBus.readByProject, {
|
|
757
757
|
project,
|
|
@@ -925,7 +925,7 @@ Violation of this contract will cause session termination.
|
|
|
925
925
|
*/
|
|
926
926
|
async writeSessionToStore(session) {
|
|
927
927
|
try {
|
|
928
|
-
const { getHttpClient, api } = await import("@
|
|
928
|
+
const { getHttpClient, api } = await import("@creativeintelligence/sdk/convex");
|
|
929
929
|
const client = getHttpClient();
|
|
930
930
|
await client.mutation(api.sessions.create, {
|
|
931
931
|
sessionId: session.session_id,
|
|
@@ -961,7 +961,7 @@ Violation of this contract will cause session termination.
|
|
|
961
961
|
*/
|
|
962
962
|
async updateSessionInStore(sessionId, status, metadata) {
|
|
963
963
|
try {
|
|
964
|
-
const { getHttpClient, api } = await import("@
|
|
964
|
+
const { getHttpClient, api } = await import("@creativeintelligence/sdk/convex");
|
|
965
965
|
const client = getHttpClient();
|
|
966
966
|
await client.mutation(api.sessions.update, {
|
|
967
967
|
sessionId,
|
|
@@ -979,7 +979,7 @@ Violation of this contract will cause session termination.
|
|
|
979
979
|
*/
|
|
980
980
|
async getAsync(sessionId) {
|
|
981
981
|
try {
|
|
982
|
-
const { getHttpClient, api } = await import("@
|
|
982
|
+
const { getHttpClient, api } = await import("@creativeintelligence/sdk/convex");
|
|
983
983
|
const client = getHttpClient();
|
|
984
984
|
const storeSession = await client.query(api.sessions.get, { sessionId });
|
|
985
985
|
if (storeSession) {
|
|
@@ -996,7 +996,7 @@ Violation of this contract will cause session termination.
|
|
|
996
996
|
*/
|
|
997
997
|
async listAsync(options) {
|
|
998
998
|
try {
|
|
999
|
-
const { getHttpClient, api } = await import("@
|
|
999
|
+
const { getHttpClient, api } = await import("@creativeintelligence/sdk/convex");
|
|
1000
1000
|
const client = getHttpClient();
|
|
1001
1001
|
const deviceId = getDeviceId();
|
|
1002
1002
|
const storeSessions = await client.query(api.sessions.list, {
|
|
@@ -1028,7 +1028,7 @@ Violation of this contract will cause session termination.
|
|
|
1028
1028
|
*/
|
|
1029
1029
|
async getActiveAsync() {
|
|
1030
1030
|
try {
|
|
1031
|
-
const { getHttpClient, api } = await import("@
|
|
1031
|
+
const { getHttpClient, api } = await import("@creativeintelligence/sdk/convex");
|
|
1032
1032
|
const client = getHttpClient();
|
|
1033
1033
|
const deviceId = getDeviceId();
|
|
1034
1034
|
const storeSessions = await client.query(api.sessions.getActive, { deviceId });
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Falls back to local AnnotationStore when Convex is unavailable.
|
|
8
8
|
*/
|
|
9
|
-
import { api, getHttpClient, isConvexConfigured } from "@
|
|
9
|
+
import { api, getHttpClient, isConvexConfigured } from "@creativeintelligence/sdk/convex";
|
|
10
10
|
import { AnnotationStore } from "./annotations.js";
|
|
11
11
|
// Map our domain types to AFS types used by Convex
|
|
12
12
|
function intentToAfs(intent) {
|
package/dist/lib/events.js
CHANGED
|
@@ -50,7 +50,7 @@ export class EventStore {
|
|
|
50
50
|
*/
|
|
51
51
|
async appendToStore(event) {
|
|
52
52
|
try {
|
|
53
|
-
const { getHttpClient, api } = await import("@
|
|
53
|
+
const { getHttpClient, api } = await import("@creativeintelligence/sdk/convex");
|
|
54
54
|
const client = getHttpClient();
|
|
55
55
|
await client.mutation(api.events.append, {
|
|
56
56
|
sessionId: event.session_id,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider OAuth Authentication
|
|
3
|
+
*
|
|
4
|
+
* Runs AI provider OAuth flows (Anthropic, OpenAI, Google, GitHub Copilot)
|
|
5
|
+
* using Pi's OAuth libraries, resolved dynamically from Pi's global install.
|
|
6
|
+
*
|
|
7
|
+
* Writes credentials to ~/.pi/agent/auth.json (Pi's auth storage format).
|
|
8
|
+
* This means Pi starts with providers already configured — no /login needed.
|
|
9
|
+
*/
|
|
10
|
+
export interface ProviderCredential {
|
|
11
|
+
type: "oauth";
|
|
12
|
+
refresh: string;
|
|
13
|
+
access: string;
|
|
14
|
+
expires: number;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
type AuthData = Record<string, ProviderCredential>;
|
|
18
|
+
export declare function readAuthJson(): AuthData;
|
|
19
|
+
export declare function getConnectedProviders(): string[];
|
|
20
|
+
export declare function hasAnyProvider(): boolean;
|
|
21
|
+
export interface ProviderInfo {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const PROVIDERS: ProviderInfo[];
|
|
27
|
+
/**
|
|
28
|
+
* Run the provider selection + OAuth flow.
|
|
29
|
+
* Returns the provider ID that was connected, or null if cancelled.
|
|
30
|
+
*/
|
|
31
|
+
export declare function connectProvider(log: (msg: string) => void): Promise<string | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Check providers and optionally prompt for connection.
|
|
34
|
+
* Used in the setup wizard.
|
|
35
|
+
*/
|
|
36
|
+
export declare function ensureProviderConnected(log: (msg: string) => void): Promise<boolean>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=provider-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-auth.d.ts","sourceRoot":"","sources":["../../src/lib/provider-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAeH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEnD,wBAAgB,YAAY,IAAI,QAAQ,CAOvC;AASD,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAKhD;AAED,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAMD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,EAAE,YAAY,EAMnC,CAAC;AAoEF;;;GAGG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiFxB;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,OAAO,CAAC,CAkBlB"}
|