runwork 0.34.0 → 0.36.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.
package/README.md CHANGED
@@ -59,8 +59,19 @@ runwork dev # Start developing with live preview
59
59
  | `runwork deploy` | Deploy to production |
60
60
  | `runwork git <args>` | Run git in an app folder with Runwork's own git, signed in to the app's Runwork remote |
61
61
  | `runwork spaces` | Spaces: containers for one kind of work |
62
+ | `runwork whoami` | Show the signed-in account, how it signed in, the platform (flagged when not production) and the active workspace. Exits 1 when signed out or rejected. `--json` for scripts |
63
+ | `runwork info` | App and workspace context as JSON, starting with the same `identity` block as `whoami` |
64
+ | `runwork files` | Workspace file storage: `list` (buckets), `ls`, `download`, `upload` (infers Content-Type from the extension, `--content-type` overrides), `link`, `delete` |
62
65
  | `runwork logout` | Remove stored credentials |
63
66
 
67
+ ### `runwork files link`
68
+
69
+ ```bash
70
+ runwork files link <bucket> <key> [--expires 10m|24h|7d|<seconds>] [--workspace <name-or-id>] [--json]
71
+ ```
72
+
73
+ Prints a read link for a file in a workspace file storage bucket. The default is 1 hour and the maximum 7 days. Anyone with the link can open the file until it expires. `--json` gives `{url, expiresAt, bucket, key}`. Files in a space are not reachable this way.
74
+
64
75
  ### `runwork dev`
65
76
 
66
77
  The main development command. When you run `runwork dev`:
@@ -25,6 +25,7 @@ import { z } from 'zod';
25
25
  import type { Env } from './core-utils';
26
26
  import type { IntegrationClient } from './core-integrations';
27
27
  import type { ExecutionLimits } from './task-delegation/types';
28
+ import type { $ZodType } from 'zod/v4/core';
28
29
  /**
29
30
  * Agent state persisted across conversations
30
31
  */
@@ -121,13 +122,15 @@ export declare function parseAppEndpointRef(ref: string): AppEndpointRef | null;
121
122
  * stays readable; the full path is in the tool description.
122
123
  */
123
124
  export declare function appEndpointToolName(ref: AppEndpointRef): string;
125
+ /** A zod object schema, written with zod 3 or zod 4. */
126
+ export type AnyZodObject = z.ZodObject<z.ZodRawShape> | $ZodType<Record<string, unknown>>;
124
127
  /**
125
128
  * Custom tool definition for agents
126
129
  */
127
130
  export interface AgentToolDefinition {
128
131
  name: string;
129
132
  description: string;
130
- parameters: z.ZodObject<z.ZodRawShape>;
133
+ parameters: AnyZodObject;
131
134
  execute: (args: Record<string, unknown>, context: AgentToolContext) => Promise<unknown>;
132
135
  }
133
136
  /**
@@ -182,13 +185,12 @@ export interface AgentToolMeta {
182
185
  description: string;
183
186
  source: 'entity' | 'integration' | 'custom';
184
187
  sourceId?: string;
188
+ /** JSON Schema (draft 7) of the tool's input. */
185
189
  parameters: {
186
190
  type: 'object';
187
- properties: Record<string, {
188
- type: string;
189
- description?: string;
190
- }>;
191
+ properties: Record<string, Record<string, unknown>>;
191
192
  required?: string[];
193
+ [keyword: string]: unknown;
192
194
  };
193
195
  }
194
196
  /**
@@ -199,7 +201,7 @@ export interface AgentToolDef {
199
201
  description: string;
200
202
  source: 'entity' | 'integration' | 'custom';
201
203
  sourceId?: string;
202
- parameters: z.ZodObject<z.ZodRawShape>;
204
+ parameters: AnyZodObject;
203
205
  }
204
206
  /** Zod schema for entity list tool */
205
207
  export declare const entityListSchema: z.ZodObject<{
@@ -6,9 +6,14 @@
6
6
  * that external systems can consume with API key authentication or public access.
7
7
  */
8
8
  import { type Env } from './core-utils';
9
- import { z } from 'zod';
10
9
  import type { Hono } from 'hono';
11
- type ZodSchema = z.ZodType<any, any, any>;
10
+ import type { z as zod3 } from 'zod';
11
+ import type { ZodType as Zod4Type } from 'zod/v4';
12
+ /**
13
+ * A schema an endpoint validates with: zod 3, or zod 4's classic API (which
14
+ * keeps `safeParse` as a method).
15
+ */
16
+ type ZodSchema = zod3.ZodTypeAny | Zod4Type;
12
17
  /**
13
18
  * Authentication requirement declared by an endpoint definition.
14
19
  */
@@ -142,8 +147,8 @@ export declare function jsonResponse<T>(data: T, status?: number): Response;
142
147
  */
143
148
  export declare function errorResponse(message: string, status?: number, code?: string): Response;
144
149
  /**
145
- * Convert Zod schema to JSON Schema for documentation
146
- * This is a simplified conversion that handles common cases
150
+ * JSON Schema for an endpoint's query, body or response schema, for the
151
+ * endpoint docs registered with the platform. Accepts zod 3 and zod 4 schemas.
147
152
  */
148
153
  export declare function zodToJsonSchema(schema: ZodSchema | undefined): Record<string, unknown> | undefined;
149
154
  /**
@@ -142,5 +142,23 @@ export declare class EntityDO extends DurableObject<Env> {
142
142
  }>): {
143
143
  imported: number;
144
144
  };
145
+ /**
146
+ * One page of a restore that replaces the whole entity, so a large entity
147
+ * never has to arrive in a single request. Pages are staged; the final page
148
+ * swaps the staged rows in and the old rows out in one transaction, so a
149
+ * restore that stops part way leaves the live rows untouched. `first`
150
+ * discards anything staged by an earlier attempt.
151
+ */
152
+ importPage(importId: string, items: Array<{
153
+ key: string;
154
+ v: number;
155
+ data: unknown;
156
+ }>, options: {
157
+ first: boolean;
158
+ final: boolean;
159
+ }): {
160
+ staged: number;
161
+ imported: number | null;
162
+ };
145
163
  }
146
164
  export {};
@@ -2,8 +2,8 @@
2
2
  * Test Entry Point
3
3
  *
4
4
  * Minimal entry point for vitest-pool-workers that exports only
5
- * the DOs needed for testing, avoiding dependencies that don't work in
6
- * the miniflare test environment (agents, ai SDK, MCP, etc.)
5
+ * the DOs needed for testing. BaseAgent is a stub under its own binding; the
6
+ * real one is exported as ChatAgentUnderTest for the chat agent tests.
7
7
  */
8
8
  export { EntityDO } from './core-entity-do';
9
9
  export { SchedulerDO } from './core-scheduler';
@@ -13,6 +13,7 @@ export declare class BaseAgent {
13
13
  constructor(state: DurableObjectState, env: unknown);
14
14
  fetch(_request: Request): Promise<Response>;
15
15
  }
16
+ export { BaseAgent as ChatAgentUnderTest } from './core-base-agent';
16
17
  export { WorkflowInstanceDO } from './core-workflow-instance';
17
18
  export { WorkflowCoordinator } from './core-workflow-coordinator';
18
19
  declare const _default: {