copilotz 1.0.0-rc.58 → 1.0.0-rc.59

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/AGENTS.md CHANGED
@@ -4,7 +4,7 @@ A guide for coding agents (Claude Code, Codex, Cursor, Gemini) building an app w
4
4
  it whole before you write code. The last section is for work on Copilotz itself.
5
5
 
6
6
  It ships in the package (`node_modules/copilotz/AGENTS.md`, and `@copilotz/copilotz` on JSR) and
7
- goes with `copilotz@1.0.0-rc.58`. Every docs page is Markdown at
7
+ goes with `copilotz@1.0.0-rc.59`. Every docs page is Markdown at
8
8
  `https://copilotz.com/docs/<slug>.md`, and https://copilotz.com/llms.txt lists them all. When you're
9
9
  unsure of a name, fetch its page or read the package's types (`node_modules/copilotz/**/*.d.ts`).
10
10
  Don't guess.
@@ -64,12 +64,12 @@ There's no project generator. Set a project up as the docs' courses do, on Node
64
64
  ```sh
65
65
  mkdir my-app && cd my-app
66
66
  npm init -y && npm pkg set type=module
67
- npm install copilotz@1.0.0-rc.58 react@19 react-dom@19
67
+ npm install copilotz@1.0.0-rc.59 react@19 react-dom@19
68
68
  npm install -D typescript @types/node @types/react @types/react-dom esbuild
69
69
  ```
70
70
 
71
71
  Pin the version: npm's `latest` tag still points at an early release candidate. On Deno, run
72
- `deno add jsr:@copilotz/copilotz` and map `"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.58"` in
72
+ `deno add jsr:@copilotz/copilotz` and map `"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.59"` in
73
73
  `deno.json`, so imports read the same.
74
74
 
75
75
  Node runs `.ts` files as they are, so there's no build step. It doesn't run `.tsx`: tests that load
@@ -110,7 +110,7 @@ line `@AGENTS.md` (Claude Code reads `CLAUDE.md`, and follows the import). Keep
110
110
  ```markdown
111
111
  # AGENTS.md
112
112
 
113
- This app runs on Copilotz (copilotz@1.0.0-rc.58). Read node_modules/copilotz/AGENTS.md first;
113
+ This app runs on Copilotz (copilotz@1.0.0-rc.59). Read node_modules/copilotz/AGENTS.md first;
114
114
  https://copilotz.com/llms.txt lists the docs, as Markdown.
115
115
 
116
116
  - `npm test` runs every test offline, with a scripted model: run it after each change.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 1.0.0-rc.59 — 2026-11-21
2
+
3
+ A person's plan answers its agents' steps however long its model thinks, and an agent waiting on
4
+ another goes on for the same person when that one fails: two reasons plan steps went to an API key.
5
+
6
+ **Fixed:**
7
+
8
+ - **Work streamed from a plugin's worker isn't cut at 30 seconds.** A job's call to the owner ended
9
+ 30 seconds after it opened, however much it had streamed (Oxian's default for host calls). So a
10
+ model's step on a person's plan whose model thought longer than that before its first word (Claude
11
+ Fable, Opus) was cut, and handed over to the next model of its list, an API key, while the plan's
12
+ CLI went on with it; and a browser's actions past 30 seconds failed. Work sent on to a worker now
13
+ lasts up to an hour (`WORK_MS`, the most a request lasts on Cloud Run), on both ends; a storage op
14
+ keeps its 30 seconds (`OP_MS`).
15
+ - **An agent waiting on another goes on for the same person when that one fails.** A turn that
16
+ failed for good answered as the system, so the agent waiting on it went on as the system: on no
17
+ one's plan (a person's plan runs only for a person, so it went to an API key), past anyone's
18
+ reach. Its answer is now its agent's, for whom its turn worked, as an answer that came is; a final
19
+ `processor.failed` carries the failed event's `actor` for that.
20
+
1
21
  ## 1.0.0-rc.58 — 2026-11-21
2
22
 
3
23
  Files go between a chat and a computer both ways, and people put files on a computer from its page.
package/README.md CHANGED
@@ -152,7 +152,7 @@ ana sees: Tue 10:00, Wed 15:00
152
152
  ```sh
153
153
  npm install copilotz@next # Node 24+ (npm, pnpm, yarn)
154
154
  bun add copilotz@next # Bun
155
- deno add jsr:@copilotz/copilotz@^1.0.0-rc.58 # Deno 2.9+ (or `deno add npm:copilotz@next`)
155
+ deno add jsr:@copilotz/copilotz@^1.0.0-rc.59 # Deno 2.9+ (or `deno add npm:copilotz@next`)
156
156
  ```
157
157
 
158
158
  Until 1.0, the release candidates are on npm's `next` tag, and a plain `npm install copilotz` or
@@ -166,7 +166,7 @@ OPENAI_API_KEY=sk-… node salon.ts # or bun salon.ts, or deno run -A salon.t
166
166
  ```
167
167
 
168
168
  On Deno, map the name `copilotz` in `deno.json`
169
- (`"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.58"`) so the imports read the same everywhere.
169
+ (`"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.59"`) so the imports read the same everywhere.
170
170
  Copilotz runs on Node 24+, Deno 2.9+ and Bun, and it's built on web standards for Cloudflare Workers
171
171
  and the browser.
172
172
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilotz",
3
- "version": "1.0.0-rc.58",
3
+ "version": "1.0.0-rc.59",
4
4
  "description": "The open-source runtime that makes your app usable by people, your own agents and their assistants.",
5
5
  "keywords": [
6
6
  "agents",
@@ -1,3 +1,3 @@
1
1
  /** A turn that failed for good, or was stopped, still answers, so whoever waits on it resumes. */
2
- import type { ProcessorDef } from "../../../../runtime/mod.js";
2
+ import { type ProcessorDef } from "../../../../runtime/mod.js";
3
3
  export declare const failedProcessor: ProcessorDef;
@@ -1,5 +1,8 @@
1
+ /** A turn that failed for good, or was stopped, still answers, so whoever waits on it resumes. */
2
+ import { principalOf, } from "../../../../runtime/mod.js";
1
3
  import { turnOf } from "../shared/agents.js";
2
4
  import { answer } from "../shared/delivery.js";
5
+ import { asAgent, spaceOf } from "./turn.js";
3
6
  export const failedProcessor = {
4
7
  on: "processor.failed",
5
8
  where: { processor: "chat.turn" },
@@ -11,10 +14,17 @@ export const failedProcessor = {
11
14
  * when that was surely an answer (its turn offered no tools). A refusal
12
15
  * written for people (a failure made public: the org's spending check, a
13
16
  * web line's budget) answers in its own words.
17
+ *
18
+ * Its answer is its agent's, working for whom its turn did (the failed
19
+ * event's actor), as an answer that came is: an agent waiting on it goes on
20
+ * for that person, with what's theirs (their plan, their reach), never as
21
+ * the system.
14
22
  */
15
- const failed = async (ctx, event) => {
16
- const { event: run, type, data, error } = event.data;
23
+ const failed = async (system, event) => {
24
+ const { event: run, type, data, error, actor } = event.data;
17
25
  const t = turnOf({ type, data });
26
+ const where = principalOf(actor) ? await spaceOf(system, t.thread) : undefined;
27
+ const ctx = asAgent(system, t.agent, t.thread, where, [], actor);
18
28
  const messages = ctx.db.collection("message");
19
29
  if (await messages.findOne({ _id: `${run}:reply` }))
20
30
  return;
@@ -1,3 +1,17 @@
1
1
  /** An agent's turn: model calls and tool steps until it answers, or waits for replies. */
2
- import { type ProcessorDef } from "../../../../runtime/mod.js";
2
+ import { type Context, type ProcessorDef } from "../../../../runtime/mod.js";
3
+ /**
4
+ * A turn someone started (a person, or a contact in its chat) acts as its
5
+ * agent, for them, where its conversation is (`in`, the thread's space) and
6
+ * in it (`thread`): with the access plugin, it reaches only what both reach
7
+ * there, and what everyone the conversation is shared with reaches (an agent
8
+ * is a member of spaces, like a person), and its tools know where they are
9
+ * (`ctx.in`). The places its person said yes to sharing into, for one call,
10
+ * it carries (`approved`). Without anyone, it runs as the system.
11
+ */
12
+ export declare const asAgent: (ctx: Context, agent: string, thread: string, where?: string, approved?: string[],
13
+ /** Whose writing set the turn going: by default, the event's (`ctx.actor`). */
14
+ by?: import("../../../../runtime/store.js").Actor | undefined) => Context;
15
+ /** The space a thread is in, where its turns work: what they write elsewhere needs a person. */
16
+ export declare const spaceOf: (ctx: Context, thread: string) => Promise<string | undefined>;
3
17
  export declare const turnProcessor: ProcessorDef;
@@ -20,8 +20,10 @@ import { settingsOf, } from "../shared/types.js";
20
20
  * (`ctx.in`). The places its person said yes to sharing into, for one call,
21
21
  * it carries (`approved`). Without anyone, it runs as the system.
22
22
  */
23
- const asAgent = (ctx, agent, thread, where, approved = []) => {
24
- const principal = principalOf(ctx.actor);
23
+ export const asAgent = (ctx, agent, thread, where, approved = [],
24
+ /** Whose writing set the turn going: by default, the event's (`ctx.actor`). */
25
+ by = ctx.actor) => {
26
+ const principal = principalOf(by);
25
27
  return principal
26
28
  ? ctx.as({
27
29
  kind: "agent",
@@ -34,7 +36,7 @@ const asAgent = (ctx, agent, thread, where, approved = []) => {
34
36
  : ctx;
35
37
  };
36
38
  /** The space a thread is in, where its turns work: what they write elsewhere needs a person. */
37
- const spaceOf = async (ctx, thread) => (await ctx.as().db.collection("thread").findOne({ _id: thread }))?.in;
39
+ export const spaceOf = async (ctx, thread) => (await ctx.as().db.collection("thread").findOne({ _id: thread }))?.in;
38
40
  /**
39
41
  * The model it thinks with this turn: what the `agentModel` resource says for
40
42
  * it in this conversation and space (with the kind it works `like`, else its
@@ -1,2 +1,2 @@
1
1
  /** The computer program's version, as `computer.info` and `--version` say it, and its builds are named. */
2
- export declare const VERSION = "1.0.0-rc.58";
2
+ export declare const VERSION = "1.0.0-rc.59";
@@ -1,2 +1,2 @@
1
1
  /** The computer program's version, as `computer.info` and `--version` say it, and its builds are named. */
2
- export const VERSION = "1.0.0-rc.58";
2
+ export const VERSION = "1.0.0-rc.59";
@@ -10,7 +10,7 @@ export type BrowserSearch = (input: SearchInput & {
10
10
  blocked: boolean;
11
11
  }>;
12
12
  /** Who the fetch says it is: itself, not a browser it isn't. */
13
- export declare const AGENT = "copilotz-computer/1.0.0-rc.58";
13
+ export declare const AGENT = "copilotz-computer/1.0.0-rc.59";
14
14
  /** The results in a DuckDuckGo HTML page, in order. */
15
15
  export declare function parseResults(html: string, base?: string): SearchResult[];
16
16
  /** Whether a page is DuckDuckGo turning a robot away. */
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * ```ts
16
16
  * plugins: [...plugins, await computerDownloads()]
17
- * plugins: [...plugins, await computerDownloads({ dir: "dist/computer/1.0.0-rc.58" })]
17
+ * plugins: [...plugins, await computerDownloads({ dir: "dist/computer/1.0.0-rc.59" })]
18
18
  * plugins: [...plugins, await computerDownloads({ url: "https://downloads.example.com/computer/" })]
19
19
  * ```
20
20
  */
@@ -13,7 +13,7 @@ import { querying as queryingOver, reading as readingOver } from "./reads.js";
13
13
  import { noMetrics } from "./metrics.js";
14
14
  import { allows, whereOf } from "./actor.js";
15
15
  import { forbidden } from "./errors.js";
16
- import { decode, DISPATCH, encode, failure, OP, output, raise, RUN, } from "./wire.js";
16
+ import { decode, DISPATCH, encode, failure, OP, OP_MS, output, raise, RUN, WORK_MS, } from "./wire.js";
17
17
  /** Ops whose result the caller already knows, so a transaction can send them later. */
18
18
  const UNANSWERED = new Set(["emit", "insert", "link", "unlink"]);
19
19
  /** Whether ops for `a` and `b` may go in one request. */
@@ -59,7 +59,11 @@ const acting = (actor, other) => other
59
59
  }
60
60
  : undefined;
61
61
  const reply = async (callHost, request) => {
62
- const call = await callHost({ workload: OP, body: encode(request) });
62
+ const call = await callHost({
63
+ workload: OP,
64
+ body: encode(request),
65
+ deadlineAtMs: Date.now() + OP_MS,
66
+ });
63
67
  const answer = await decode(call.output);
64
68
  await call.completed;
65
69
  if ("error" in answer)
@@ -703,7 +707,8 @@ export function createExecutor(options) {
703
707
  id: options.id ?? `executor-${crypto.randomUUID()}`,
704
708
  transport: options.transport,
705
709
  capacity: options.capacity ?? 256,
706
- hostCalls: { maxConcurrent: 1_024 },
710
+ // A call may last as long as work sent on to a worker does; a storage op says its own deadline.
711
+ hostCalls: { maxConcurrent: 1_024, timeoutMs: WORK_MS },
707
712
  workloads: {
708
713
  [RUN]: async ({ input, callHost, signal }) => {
709
714
  const request = await decode(input);
package/runtime/owner.js CHANGED
@@ -26,7 +26,7 @@ import { memoryStore } from "./memory.js";
26
26
  import { isRead, perform, privateIn, read, } from "./ops.js";
27
27
  import { check, checkPath, checkProjection, get, matches, project } from "./mongo.js";
28
28
  import { canonical, checked, compile, described, events, fingerprint, invalid, json, merge, unprivate, } from "./registry.js";
29
- import { decode, DISPATCH, encode, failure, lines, OP, raise, RUN, } from "./wire.js";
29
+ import { decode, DISPATCH, encode, failure, lines, OP, raise, RUN, WORK_MS, } from "./wire.js";
30
30
  const SYSTEM = "sys.";
31
31
  const WRITES = ["insert", "update", "replace", "delete"];
32
32
  /**
@@ -1211,6 +1211,8 @@ export async function createOwner(options) {
1211
1211
  workerCalls: {
1212
1212
  maxConcurrent: 65_536,
1213
1213
  maxPerConnection: 1_024,
1214
+ // As long as work sent on to a worker lasts (see `WORK_MS`); a storage op ends sooner.
1215
+ timeoutMs: WORK_MS,
1214
1216
  admit: (context) => {
1215
1217
  const job = context.parent?.operationId;
1216
1218
  // Only executors, in a job, reach storage or send work on: browsers and plugins'
@@ -1630,13 +1632,14 @@ export async function createOwner(options) {
1630
1632
  await commit((tx) => Promise.resolve(tx.emit({
1631
1633
  id: `${event.id}:${name}:${last ? "failed" : `retry:${attempt + 1}`}`,
1632
1634
  type: last ? "processor.failed" : "processor.retried",
1633
- // A final failure carries what failed, so a processor can answer for it.
1635
+ // A final failure carries what failed, and for whom, so a processor can answer for it.
1634
1636
  data: last
1635
1637
  ? {
1636
1638
  processor: name,
1637
1639
  event: event.id,
1638
1640
  type: event.type,
1639
1641
  data: event.data,
1642
+ ...(event.actor ? { actor: event.actor } : {}),
1640
1643
  error: failure(error),
1641
1644
  attempts: attempt,
1642
1645
  }
package/runtime/wire.d.ts CHANGED
@@ -15,6 +15,17 @@ export declare const OP = "core.op";
15
15
  * input, and its output the worker's, as it comes.
16
16
  */
17
17
  export declare const DISPATCH = "core.dispatch";
18
+ /**
19
+ * How long a job's call to the owner may last, from when it opens (Oxian's
20
+ * host calls end there, however much they've streamed): a storage op, 30
21
+ * seconds; work sent on to a worker, an hour, the most a request lasts on
22
+ * Cloud Run. Work streams for as long as it's done: a model's step on a
23
+ * plan's CLI thinks a while before it says anything, and a browser's actions
24
+ * take minutes. Cut at 30 seconds, such a step handed over to the next model
25
+ * of its list while the CLI went on with it.
26
+ */
27
+ export declare const OP_MS = 30000;
28
+ export declare const WORK_MS: number;
18
29
  export type Job =
19
30
  /** `id` is the call's id; a retried call says why its previous attempt ended. */
20
31
  {
package/runtime/wire.js CHANGED
@@ -7,6 +7,17 @@ export const OP = "core.op";
7
7
  * input, and its output the worker's, as it comes.
8
8
  */
9
9
  export const DISPATCH = "core.dispatch";
10
+ /**
11
+ * How long a job's call to the owner may last, from when it opens (Oxian's
12
+ * host calls end there, however much they've streamed): a storage op, 30
13
+ * seconds; work sent on to a worker, an hour, the most a request lasts on
14
+ * Cloud Run. Work streams for as long as it's done: a model's step on a
15
+ * plan's CLI thinks a while before it says anything, and a browser's actions
16
+ * take minutes. Cut at 30 seconds, such a step handed over to the next model
17
+ * of its list while the CLI went on with it.
18
+ */
19
+ export const OP_MS = 30_000;
20
+ export const WORK_MS = 60 * 60_000;
10
21
  /** An error's `detail`, kept only as strings (and none of an error's own names). */
11
22
  const detailOf = (error) => {
12
23
  const detail = error?.detail;