@zetaloop/chappie 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,5 +9,5 @@
9
9
  "cwd": "."
10
10
  }
11
11
  },
12
- "version": "1.0.0"
12
+ "version": "1.1.0"
13
13
  }
package/README.md CHANGED
@@ -16,7 +16,7 @@ Install Chappie in each participating agent:
16
16
  The broker connects these sessions to ChatGPT and to each other. Install it on one device:
17
17
 
18
18
  ```sh
19
- pnpm add -g @zetaloop/chappie
19
+ pnpm add -g @zetaloop/chappie@1
20
20
  ```
21
21
 
22
22
  ## With ChatGPT
@@ -12,7 +12,7 @@ import {
12
12
  toolResult,
13
13
  transferDescription,
14
14
  transferInput
15
- } from "./chunk-GWYP7B66.js";
15
+ } from "./chunk-ASDHNBR2.js";
16
16
 
17
17
  // src/local.ts
18
18
  var definitions = [
@@ -87,7 +87,7 @@ var definitions = [
87
87
  )
88
88
  ];
89
89
  function localTools(session) {
90
- return definitions.map((tool2) => ({
90
+ return definitions.filter((tool2) => session.localTools || tool2.name === "transfer").map((tool2) => ({
91
91
  ...tool2,
92
92
  async execute(args, signal, update) {
93
93
  const result = await tool2.execute(session, args, signal, update);
@@ -3,7 +3,7 @@ import { createRequire } from "node:module"; const require = createRequire(impor
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@zetaloop/chappie",
6
- version: "1.0.0",
6
+ version: "1.1.0",
7
7
  description: "Connect ChatGPT and coding agents across devices",
8
8
  devDependencies: {
9
9
  "@ai-sdk/provider": "^3.0.8",
@@ -11,7 +11,7 @@ import {
11
11
  resourceSessionId,
12
12
  transferFiles,
13
13
  transferResult
14
- } from "./chunk-GWYP7B66.js";
14
+ } from "./chunk-ASDHNBR2.js";
15
15
  import {
16
16
  __callDispose,
17
17
  __using
@@ -179,10 +179,7 @@ var Session = class {
179
179
  this.#config = config;
180
180
  }
181
181
  get localTools() {
182
- return Boolean(this.#config.localTools && !this.#host.active());
183
- }
184
- get active() {
185
- return this.#host.active();
182
+ return Boolean(this.#config.localTools);
186
183
  }
187
184
  deliveries() {
188
185
  return this.#receivedDeliveries.splice(0);
@@ -481,13 +478,11 @@ var Session = class {
481
478
  update() {
482
479
  const active = this.#host.active();
483
480
  const id = this.#host.describe().id;
484
- const changed = this.#sessionId !== id || this.#provider !== active;
485
- if (changed) {
481
+ if (this.#sessionId !== id || this.#provider !== active) {
486
482
  if (this.#connection) this.close();
487
483
  else this.resetInputs();
488
484
  }
489
485
  this.#provider = active;
490
- if (!active && !this.#config.localTools) return changed;
491
486
  if (!this.#connection) {
492
487
  this.#connection = new IpcClient(getDirectory(), this.#config.connect, {
493
488
  onOpen: async () => {
@@ -516,7 +511,6 @@ var Session = class {
516
511
  void this.#sync().catch(() => {
517
512
  });
518
513
  }
519
- return changed;
520
514
  }
521
515
  #description(sessionId = this.#sessionId) {
522
516
  if (sessionId !== this.#sessionId)
@@ -3,7 +3,7 @@ import {
3
3
  ZodIssueCode,
4
4
  coerce_exports,
5
5
  iso_exports
6
- } from "./chunk-GX4JWLHH.js";
6
+ } from "./chunk-RQKWETGT.js";
7
7
  import {
8
8
  NEVER,
9
9
  _enum,
@@ -28,7 +28,7 @@ import {
28
28
  union,
29
29
  unknown,
30
30
  url
31
- } from "./chunk-GWYP7B66.js";
31
+ } from "./chunk-ASDHNBR2.js";
32
32
 
33
33
  // node_modules/.pnpm/@modelcontextprotocol+server@2.0.0/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
34
34
  var __create = Object.create;
@@ -2,7 +2,7 @@ import { createRequire } from "node:module"; const require = createRequire(impor
2
2
  import {
3
3
  historyPage,
4
4
  historyResult
5
- } from "./chunk-GWYP7B66.js";
5
+ } from "./chunk-ASDHNBR2.js";
6
6
 
7
7
  // src/journal.ts
8
8
  function journalHistory(branch, sessionId, range) {
@@ -18,7 +18,7 @@ import {
18
18
  _isoDateTime,
19
19
  _isoDuration,
20
20
  _isoTime
21
- } from "./chunk-GWYP7B66.js";
21
+ } from "./chunk-ASDHNBR2.js";
22
22
  import {
23
23
  __export
24
24
  } from "./chunk-UOFCCHBS.js";
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
3
3
  import {
4
4
  package_default
5
- } from "./chunk-DN7OHZK6.js";
5
+ } from "./chunk-DDBZIUBF.js";
6
6
  import "./chunk-UOFCCHBS.js";
7
7
 
8
8
  // src/cli.ts
@@ -12,31 +12,38 @@ var { values, positionals } = parseArgs({
12
12
  options: {
13
13
  help: { type: "boolean", short: "h" },
14
14
  version: { type: "boolean", short: "v" },
15
- provider: { type: "boolean" },
16
- chatgpt: { type: "boolean" }
15
+ provider: { type: "boolean" }
17
16
  }
18
17
  });
18
+ var usage = "Usage: chappie [codex [setup]]";
19
19
  if (values.help) {
20
20
  console.log(
21
- "Usage: chappie [codex]\n\nRun the broker and ChatGPT MCP server.\nThe codex command runs the installed Codex plugin."
21
+ `${usage}
22
+
23
+ Run the broker and ChatGPT MCP server.
24
+ The codex command runs the installed Codex plugin.
25
+ Use codex setup to write the model catalog to ~/.chappie/codex.json.`
22
26
  );
23
27
  } else if (values.version) {
24
28
  console.log(package_default.version);
25
29
  } else {
26
30
  try {
27
- if (positionals.length === 1 && positionals[0] === "codex") {
31
+ if (positionals.length === 2 && positionals[0] === "codex" && positionals[1] === "setup" && !values.provider) {
32
+ const { setupCodex } = await import("./codex-plugin-BFH2DWSA.js");
33
+ console.log(await setupCodex());
34
+ } else if (positionals.length === 1 && positionals[0] === "codex") {
28
35
  if (values.provider) {
29
- const { serveCodex } = await import("./codex-RI2XL4HV.js");
36
+ const { serveCodex } = await import("./codex-XVRO56TR.js");
30
37
  await serveCodex();
31
38
  } else {
32
- const { serveCodexPlugin } = await import("./codex-plugin-NSKWB3WS.js");
33
- await serveCodexPlugin(values.chatgpt);
39
+ const { serveCodexPlugin } = await import("./codex-plugin-BFH2DWSA.js");
40
+ await serveCodexPlugin();
34
41
  }
35
- } else if (positionals.length === 0 && !values.provider && !values.chatgpt) {
36
- const { serve } = await import("./stdio-KJVCYPXJ.js");
42
+ } else if (positionals.length === 0 && !values.provider) {
43
+ const { serve } = await import("./stdio-OC7FLZCL.js");
37
44
  await serve();
38
45
  } else {
39
- throw new Error("Usage: chappie [codex]");
46
+ throw new Error(usage);
40
47
  }
41
48
  } catch (error) {
42
49
  const message = error instanceof Error ? error.message : String(error);