dopus 0.2.0 → 0.2.1

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
@@ -115,7 +115,7 @@ Only two kinds of error message reach the model:
115
115
  - a `ToolError` you throw on purpose, such as `throw new ToolError('Order o-1 has already shipped')`;
116
116
  - Next.js `redirect()`, `notFound()`, `forbidden()` and `unauthorized()`, which are translated into plain messages such as "the user is not signed in".
117
117
 
118
- Any other error goes to `onError` and is replaced with a generic message, so database errors and stack details stay on the server. The browser only ever sees a generic error text.
118
+ Any other error goes to `onError` and is replaced with a generic message, so database errors and stack details stay on the server. The browser sees the same text as the model: the `ToolError` message, or the generic one.
119
119
 
120
120
  ## Permissions and security
121
121
 
@@ -274,6 +274,7 @@ Planned next:
274
274
  pnpm install
275
275
  pnpm build && pnpm lint && pnpm typecheck && pnpm test
276
276
  pnpm example:build && pnpm example:e2e # next start + scripted model
277
+ pnpm example:live # real model from examples/next-app/.env.local (costs cents)
277
278
  pnpm smoke # packed tarball → fresh app → dopus init → next build
278
279
  pnpm aws:emu # OpenNext build → local Lambda streaming invoke
279
280
  pnpm cf:e2e # dopus infra cloudflare → wrangler dev (workerd) → e2e
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as PROVIDERS, t as VERSION } from "./version-DOEBWDfi.js";
2
+ import { n as PROVIDERS, t as VERSION } from "./version-BWFAqCId.js";
3
3
  import { execFileSync, spawn } from "node:child_process";
4
4
  import { parseArgs } from "node:util";
5
5
  import * as p from "@clack/prompts";
package/dist/index.d.ts CHANGED
@@ -103,7 +103,7 @@ interface AgentConfig<TOOLS extends DopusToolSet = DopusToolSet> {
103
103
  approvalSecret?: string;
104
104
  /** Extra `streamText` settings (temperature, providerOptions, ...). */
105
105
  callOptions?: Pick<StreamTextOptions, 'temperature' | 'maxOutputTokens' | 'providerOptions' | 'maxRetries' | 'headers' | 'onEnd' | 'onStepEnd'>;
106
- /** Called for errors; the client only ever sees a generic message. */
106
+ /** Called for unexpected errors (not `ToolError`); the client only sees a generic message for those. */
107
107
  onError?: (error: unknown) => void;
108
108
  /**
109
109
  * While the stream is idle (e.g. a slow tool), send an SSE comment every this many ms so proxies
@@ -150,5 +150,5 @@ interface ProviderInfo {
150
150
  }
151
151
  /** Verified against @ai-sdk/openai@4.0.111, @ai-sdk/anthropic@4.0.99, @ai-sdk/google@4.0.114. */
152
152
  export declare const PROVIDERS: Record<ProviderId, ProviderInfo>;
153
- export declare const VERSION = "0.2.0";
153
+ export declare const VERSION = "0.2.1";
154
154
  export type { AgentConfig, AgentUser, ClientContext, ConfirmOption, DopusTool, DopusToolSet, PromptLayers, ProviderId, ProviderInfo, RuntimeContext, ToolContext, ToolOptions };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as PROVIDERS, t as VERSION } from "./version-DOEBWDfi.js";
1
+ import { n as PROVIDERS, t as VERSION } from "./version-BWFAqCId.js";
2
2
  import { convertToModelMessages, createUIMessageStreamResponse, isStepCount, safeValidateUIMessages, streamText, toUIMessageStream, tool } from "ai";
3
3
  // src/next-errors.ts
4
4
  /**
@@ -268,6 +268,7 @@ function createAgentHandler(config) {
268
268
  tools,
269
269
  originalMessages: messages,
270
270
  onError: (error) => {
271
+ if (error instanceof ToolError) return error.message;
271
272
  report(error);
272
273
  return "Something went wrong. Please try again.";
273
274
  }
@@ -27,5 +27,5 @@ const PROVIDERS = {
27
27
  }
28
28
  };
29
29
  // src/version.ts
30
- const VERSION = "0.2.0";
30
+ const VERSION = "0.2.1";
31
31
  export { PROVIDERS as n, VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dopus",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Drop an AI agent into your existing Next.js app — your server functions become its tools.",
5
5
  "license": "MIT",
6
6
  "author": "akodm",