@cognolo/runtime 0.4.4 → 0.4.5

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/dist/agent.js CHANGED
@@ -100,7 +100,8 @@ export async function previewOf(def, ctx, input) {
100
100
  return def.preview ? await def.preview(ctx, input) : def.title;
101
101
  }
102
102
  catch (e) {
103
- return `${def.title} (${e instanceof Error ? e.message : "preview unavailable"})`;
103
+ console.error(`Cognolo: the preview of ${def.name} threw`, e);
104
+ return `${def.title} (preview unavailable)`;
104
105
  }
105
106
  }
106
107
  export async function runTurn(opts) {
package/dist/gate.d.ts CHANGED
@@ -34,6 +34,9 @@ export declare const split: (v: Verdict) => {
34
34
  };
35
35
  export declare const canon: (v: unknown) => string;
36
36
  export declare function summarize(outcome: ToolOutcome): string;
37
+ /** Said to the model when a tool's function crashes. A thrown error's own text can carry the values a query used (a database
38
+ * error), so it stays in the app's server log, as a Next.js form action shows the person only a digest (Fable, Dec 5 2026). */
39
+ export declare const TOOL_CRASHED = "The app hit an error while doing this, so it may not have finished. Don't try again; tell the person it didn't work and that the app's developer can see the error in the server log.";
37
40
  export declare function runTool<C>(def: ToolDef<C>, ctx: C, input: unknown): Promise<ToolOutcome>;
38
41
  export declare const ran: (def: {
39
42
  name: string;
package/dist/gate.js CHANGED
@@ -27,12 +27,14 @@ export function summarize(outcome) {
27
27
  return d.summary;
28
28
  return "Done";
29
29
  }
30
+ export const TOOL_CRASHED = "The app hit an error while doing this, so it may not have finished. Don't try again; tell the person it didn't work and that the app's developer can see the error in the server log.";
30
31
  export async function runTool(def, ctx, input) {
31
32
  try {
32
33
  return await def.run(ctx, input);
33
34
  }
34
35
  catch (e) {
35
- return { ok: false, error: e instanceof Error ? e.message : String(e), threw: true };
36
+ console.error(`Cognolo: the tool ${def.name} threw`, e);
37
+ return { ok: false, error: TOOL_CRASHED, threw: true };
36
38
  }
37
39
  }
38
40
  export const ran = (def, input, outcome) => ({ kind: "ran", tool: def.name, title: def.title, risk: def.risk, input, ok: outcome.ok, ...(!outcome.ok && outcome.threw ? { threw: true } : {}), summary: summarize(outcome), data: outcome.ok ? outcome.data : undefined });
package/dist/version.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** The runtime's version, reported to the cloud on every heartbeat. A test keeps it equal to package.json. */
2
- export declare const RUNTIME_VERSION = "0.4.4";
2
+ export declare const RUNTIME_VERSION = "0.4.5";
3
3
  /**
4
4
  * The deployed git commit: the app's own setting, then `COGNOLO_COMMIT`, then a host's own variable (only a plain git hash
5
5
  * counts from those). Null when nothing says, as when running on a developer's machine.
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- export const RUNTIME_VERSION = "0.4.4";
1
+ export const RUNTIME_VERSION = "0.4.5";
2
2
  const HOST_COMMIT_VARS = ["VERCEL_GIT_COMMIT_SHA", "RENDER_GIT_COMMIT", "RAILWAY_GIT_COMMIT_SHA", "COMMIT_REF", "CF_PAGES_COMMIT_SHA", "HEROKU_SLUG_COMMIT", "SOURCE_VERSION", "GITHUB_SHA"];
3
3
  export function deployedCommit(own, env = typeof process === "undefined" ? {} : process.env) {
4
4
  if (own)
@@ -14,6 +14,12 @@ export function deployedCommit(own, env = typeof process === "undefined" ? {} :
14
14
  }
15
15
  export const installSpec = (version) => `@cognolo/runtime@${version}`;
16
16
  export const RELEASES = [
17
+ {
18
+ version: "0.4.5",
19
+ date: "2026-12-05",
20
+ summary: "When one of the app's tools crashes, the assistant is told only that the app hit an error, not the error's own text, which can hold the values a database query used. The error itself goes to the app's server log, where the developer can see it. A preview that fails says \"preview unavailable\" the same way.",
21
+ steps: ["Nothing to do beyond the usual update. To see why a tool failed, look in the app's server log, not the conversation."],
22
+ },
17
23
  {
18
24
  version: "0.4.4",
19
25
  date: "2026-12-04",
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
- {
2
- "name": "@cognolo/runtime",
3
- "version": "0.4.4",
4
- "description": "Cognolo's runtime: an AI assistant inside your own web app that acts through your app's own functions and permission checks, with a person approving changes.",
5
- "type": "module",
6
- "license": "SEE LICENSE IN LICENSE",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
- "main": "./dist/index.js",
11
- "types": "./dist/index.d.ts",
12
- "bin": {
13
- "cognolo": "dist/init-cli.js"
14
- },
15
- "exports": {
16
- ".": {
17
- "types": "./dist/index.d.ts",
18
- "default": "./dist/index.js"
19
- },
20
- "./react": {
21
- "types": "./dist/react/index.d.ts",
22
- "default": "./dist/react/index.js"
23
- },
24
- "./setup": {
25
- "types": "./dist/setup.d.ts",
26
- "default": "./dist/setup.js"
27
- }
28
- },
29
- "files": [
30
- "dist",
31
- "docs/store.md"
32
- ],
33
- "sideEffects": false,
34
- "engines": {
35
- "node": ">=20"
36
- },
37
- "scripts": {
38
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json --removeComments && tsc -p tsconfig.build.json --emitDeclarationOnly",
39
- "prepare": "npm run build",
40
- "prepack": "npm run build",
41
- "smoke": "node scripts/smoke.mjs",
42
- "test": "tsx --import ./test/env.ts --test test/*.test.ts",
43
- "eval": "tsx eval/run.ts",
44
- "read": "tsx reader/cli.ts",
45
- "answer": "tsx scripts/answer.ts",
46
- "propose": "tsx reader/propose-cli.ts",
47
- "github-app": "tsx github/serve.ts",
48
- "typecheck": "tsc --noEmit"
49
- },
50
- "peerDependencies": {
51
- "@anthropic-ai/sdk": "^1.6.0",
52
- "zod": "^4.6.7",
53
- "react": "^18.2.0 || ^19.0.0"
54
- },
55
- "devDependencies": {
56
- "@anthropic-ai/sdk": "^1.6.0",
57
- "@types/node": "^20",
58
- "@types/react": "^19.3.0",
59
- "@types/react-dom": "^19.3.0",
60
- "react": "^19.3.1",
61
- "react-dom": "^19.3.1",
62
- "tsx": "^4.23.15",
63
- "typescript": "^5",
64
- "zod": "^4.6.7"
65
- },
66
- "peerDependenciesMeta": {
67
- "react": {
68
- "optional": true
69
- }
70
- }
71
- }
1
+ {
2
+ "name": "@cognolo/runtime",
3
+ "version": "0.4.5",
4
+ "description": "Cognolo's runtime: an AI assistant inside your own web app that acts through your app's own functions and permission checks, with a person approving changes.",
5
+ "type": "module",
6
+ "license": "SEE LICENSE IN LICENSE",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "bin": {
13
+ "cognolo": "dist/init-cli.js"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "./react": {
21
+ "types": "./dist/react/index.d.ts",
22
+ "default": "./dist/react/index.js"
23
+ },
24
+ "./setup": {
25
+ "types": "./dist/setup.d.ts",
26
+ "default": "./dist/setup.js"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "docs/store.md"
32
+ ],
33
+ "sideEffects": false,
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
37
+ "scripts": {
38
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json --removeComments && tsc -p tsconfig.build.json --emitDeclarationOnly",
39
+ "prepare": "npm run build",
40
+ "prepack": "npm run build",
41
+ "smoke": "node scripts/smoke.mjs",
42
+ "test": "tsx --import ./test/env.ts --test test/*.test.ts",
43
+ "eval": "tsx eval/run.ts",
44
+ "read": "tsx reader/cli.ts",
45
+ "answer": "tsx scripts/answer.ts",
46
+ "propose": "tsx reader/propose-cli.ts",
47
+ "github-app": "tsx github/serve.ts",
48
+ "typecheck": "tsc --noEmit"
49
+ },
50
+ "peerDependencies": {
51
+ "@anthropic-ai/sdk": "^1.6.0",
52
+ "zod": "^4.6.7",
53
+ "react": "^18.2.0 || ^19.0.0"
54
+ },
55
+ "devDependencies": {
56
+ "@anthropic-ai/sdk": "^1.6.0",
57
+ "@types/node": "^20",
58
+ "@types/react": "^19.3.0",
59
+ "@types/react-dom": "^19.3.0",
60
+ "react": "^19.3.1",
61
+ "react-dom": "^19.3.1",
62
+ "tsx": "^4.23.15",
63
+ "typescript": "^5",
64
+ "zod": "^4.6.7"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "react": {
68
+ "optional": true
69
+ }
70
+ }
71
+ }