@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.
Files changed (66) hide show
  1. package/dist/cli/commands/context/inject.js +1 -1
  2. package/dist/cli/commands/context/list.js +1 -1
  3. package/dist/cli/commands/context/publish.js +1 -1
  4. package/dist/cli/commands/context/read.js +1 -1
  5. package/dist/cli/commands/daemon.js +1 -1
  6. package/dist/cli/commands/history/index.d.ts +13 -2
  7. package/dist/cli/commands/history/index.d.ts.map +1 -1
  8. package/dist/cli/commands/history/index.js +2 -2
  9. package/dist/cli/commands/login.js +2 -2
  10. package/dist/cli/commands/logout.js +1 -1
  11. package/dist/cli/commands/preview/index.js +2 -2
  12. package/dist/cli/commands/preview/list.js +2 -2
  13. package/dist/cli/commands/preview/status.js +2 -2
  14. package/dist/cli/commands/preview/stop.js +2 -2
  15. package/dist/cli/commands/push.js +2 -2
  16. package/dist/cli/commands/session/list.js +1 -1
  17. package/dist/cli/commands/session/mark-done.js +1 -1
  18. package/dist/cli/commands/session/replay.js +1 -1
  19. package/dist/cli/commands/session/start.js +1 -1
  20. package/dist/cli/commands/session/stop.js +1 -1
  21. package/dist/cli/commands/start.d.ts +2 -1
  22. package/dist/cli/commands/start.d.ts.map +1 -1
  23. package/dist/cli/commands/start.js +17 -12
  24. package/dist/cli/commands/status.js +2 -2
  25. package/dist/cli/commands/sync.js +2 -2
  26. package/dist/cli/commands/windows/list.js +1 -1
  27. package/dist/lib/active-sessions.js +6 -6
  28. package/dist/lib/annotations-convex.js +1 -1
  29. package/dist/lib/events.js +1 -1
  30. package/dist/lib/provider-auth.d.ts +38 -0
  31. package/dist/lib/provider-auth.d.ts.map +1 -0
  32. package/dist/lib/provider-auth.js +193 -0
  33. package/dist/lib/report.js +1 -1
  34. package/dist/lib/runner.js +4 -4
  35. package/extensions/abbie/index.ts +63 -0
  36. package/oclif.manifest.json +1 -1
  37. package/package.json +3 -3
  38. package/src/cli/commands/__tests__/daemon.test.ts +1 -1
  39. package/src/cli/commands/context/inject.ts +1 -1
  40. package/src/cli/commands/context/list.ts +1 -1
  41. package/src/cli/commands/context/publish.ts +1 -1
  42. package/src/cli/commands/context/read.ts +1 -1
  43. package/src/cli/commands/daemon.ts +1 -1
  44. package/src/cli/commands/history/index.ts +15 -3
  45. package/src/cli/commands/login.ts +2 -2
  46. package/src/cli/commands/logout.ts +1 -1
  47. package/src/cli/commands/preview/index.ts +2 -2
  48. package/src/cli/commands/preview/list.ts +2 -2
  49. package/src/cli/commands/preview/status.ts +2 -2
  50. package/src/cli/commands/preview/stop.ts +2 -2
  51. package/src/cli/commands/push.ts +2 -2
  52. package/src/cli/commands/session/list.ts +1 -1
  53. package/src/cli/commands/session/mark-done.ts +1 -1
  54. package/src/cli/commands/session/replay.ts +1 -1
  55. package/src/cli/commands/session/start.ts +1 -1
  56. package/src/cli/commands/session/stop.ts +1 -1
  57. package/src/cli/commands/start.ts +19 -13
  58. package/src/cli/commands/status.ts +2 -2
  59. package/src/cli/commands/sync.ts +2 -2
  60. package/src/cli/commands/windows/list.ts +1 -1
  61. package/src/lib/active-sessions.ts +6 -6
  62. package/src/lib/annotations-convex.ts +1 -1
  63. package/src/lib/events.ts +1 -1
  64. package/src/lib/provider-auth.ts +258 -0
  65. package/src/lib/report.ts +1 -1
  66. package/src/lib/runner.ts +4 -4
@@ -1,4 +1,4 @@
1
- import { getHttpClient, api } from "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
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 = Doc<"reports">;
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":"AAAA,OAAO,EAAO,KAAK,GAAG,EAAiB,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,KAAK,YAAY,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;AAEnC,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
+ {"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 "@abbie/sdk/convex";
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 "@abbie/sdk/config";
14
- import { api, getHttpClient, isConvexConfigured } from "@abbie/sdk/convex";
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 "@abbie/sdk/config";
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 "@abbie/sdk/config";
4
- import { api, getHttpClient, isConvexConfigured } from "@abbie/sdk/convex";
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 "@abbie/sdk/config";
2
- import { api, getHttpClient, isConvexConfigured } from "@abbie/sdk/convex";
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 "@abbie/sdk/config";
3
- import { api, getHttpClient, isConvexConfigured } from "@abbie/sdk/convex";
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 "@abbie/sdk/config";
3
- import { api, getHttpClient, isConvexConfigured } from "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
10
- import { getStoredClerkId } from "@abbie/sdk/config";
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 "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
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 "@abbie/sdk/convex";
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. Launch Pi (extension auto-starts bridge)
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;;;;;;;;;;;GAWG;AAQH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAmCjD,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;YAsDnB,QAAQ;IAoFtB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAmB5B"}
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. Launch Pi (extension auto-starts bridge)
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 needsSetup = flags.setup || !pi.installed || !configured || !extOk;
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/3] installing pi...");
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/3] pi ${pi.version} ✓`);
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/3] installing abbie extension...");
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/3] extension ✓");
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/3] authenticating...");
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/3] authenticated ✓");
202
+ this.log(" [3/4] authenticated ✓");
198
203
  }
199
204
  this.log("");
200
- this.log(" setup complete");
205
+ // Step 4: Connect AI provider
206
+ await ensureProviderConnected((msg) => this.log(msg));
201
207
  this.log("");
202
- this.log(" tip: open Pi and type /login to connect an AI provider");
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 "@abbie/sdk/convex";
13
- import { getStoredClerkId } from "@abbie/sdk/config";
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 "@abbie/sdk/convex";
16
- import { getStoredClerkId } from "@abbie/sdk/config";
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 "@abbie/sdk/convex";
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("@abbie/sdk/convex");
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("@abbie/sdk/convex");
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("@abbie/sdk/convex");
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("@abbie/sdk/convex");
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("@abbie/sdk/convex");
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("@abbie/sdk/convex");
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 "@abbie/sdk/convex";
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) {
@@ -50,7 +50,7 @@ export class EventStore {
50
50
  */
51
51
  async appendToStore(event) {
52
52
  try {
53
- const { getHttpClient, api } = await import("@abbie/sdk/convex");
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"}