@fungi.computer/truffle 0.6.0 → 0.7.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.
@@ -2,6 +2,9 @@ export type LocalFailureMetadata = Readonly<{
2
2
  source: "local-runtime";
3
3
  operation: string;
4
4
  failureKind: "Error" | "NonErrorThrown";
5
+ /** Closed, content-free diagnostics for the Mule listener's store failure. */
6
+ recorderCause?: string;
7
+ sqliteCause?: string;
5
8
  }>;
6
9
  /** The only persistable projection of a caught Local failure. */
7
10
  export declare function localFailureMetadata(operation: string, cause: unknown): LocalFailureMetadata;
package/dist/log-event.js CHANGED
@@ -1,11 +1,29 @@
1
1
  import * as Redacted from "effect/Redacted";
2
+ import { ShiitakeError } from "@fungi.computer/shiitake";
3
+ import { privateSqliteFailureCode } from "./private-sqlite-owner.js";
4
+ import { z } from "zod";
5
+ const listenerFailureSchema = z.object({
6
+ _tag: z.literal("MuleError"),
7
+ phase: z.literal("listener"),
8
+ cause: z.instanceof(ShiitakeError),
9
+ });
2
10
  /** The only persistable projection of a caught Local failure. */
3
11
  export function localFailureMetadata(operation, cause) {
4
- return {
12
+ const underlying = cause instanceof ShiitakeError ? cause.underlying : undefined;
13
+ const metadata = {
5
14
  source: "local-runtime",
6
15
  operation,
7
16
  failureKind: cause instanceof Error ? "Error" : "NonErrorThrown",
8
17
  };
18
+ const parsed = listenerFailureSchema.safeParse(underlying);
19
+ if (!parsed.success)
20
+ return metadata;
21
+ const store = parsed.data.cause;
22
+ const recorderCause = `${store.boundary}:${store.cause}`;
23
+ const sqlite = privateSqliteFailureCode(store.underlying);
24
+ if (sqlite === undefined)
25
+ return { ...metadata, recorderCause };
26
+ return { ...metadata, recorderCause, sqliteCause: sqlite };
9
27
  }
10
28
  /** Retain the original Local failure without printing exception or input text. */
11
29
  export function logEvent(operation, cause) {
@@ -69,9 +69,9 @@ declare const wireResultSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.
69
69
  "access_token.sub": "access_token.sub";
70
70
  }>;
71
71
  problem: z.ZodEnum<{
72
+ invalid: "invalid";
72
73
  absent: "absent";
73
74
  malformed: "malformed";
74
- invalid: "invalid";
75
75
  }>;
76
76
  claimNames: z.ZodArray<z.ZodString>;
77
77
  authClaimNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1,6 +1,7 @@
1
1
  import * as Schema from "effect/Schema";
2
2
  import { z } from "zod";
3
- import { agentScheduleListInputSchema, agentSchedulePageSchema, agentScheduleTargetSchema, readAgentSchedulePage, } from "@fungi.computer/shiitake-extensions/schedules";
3
+ import { agentScheduleListInputSchema, agentSchedulePageSchema, agentScheduleTargetSchema, } from "@fungi.computer/shiitake-extensions/schedules";
4
+ import { readAgentSchedulePage } from "@fungi.computer/shiitake-extensions/schedules/client";
4
5
  import { logEvent } from "./log-event.js";
5
6
  /** Private service ingress, never a Team/member or machine-link request. */
6
7
  export const localScheduleListInputSchema = z.strictObject({
@@ -141,9 +141,9 @@ export declare const archiveRequestSchema: z.ZodObject<{
141
141
  export declare const archiveRefusalSchema: z.ZodObject<{
142
142
  code: z.ZodLiteral<"agent_archive_refused">;
143
143
  reason: z.ZodEnum<{
144
+ archived: "archived";
144
145
  pending: "pending";
145
146
  running: "running";
146
- archived: "archived";
147
147
  not_creator: "not_creator";
148
148
  self: "self";
149
149
  unreadable: "unreadable";
@@ -153,7 +153,7 @@ serviceNative?: () => NonNullable<Parameters<typeof openPrivateLocalRuntimeHost>
153
153
  readonly schedule: {
154
154
  readonly sessionId: string;
155
155
  readonly loopId: string;
156
- readonly origin: "human" | "model";
156
+ readonly origin: "model" | "human";
157
157
  readonly expiresAt: number | null;
158
158
  readonly prompt: string;
159
159
  readonly mode: "self_paced" | "fixed_interval";
@@ -202,7 +202,7 @@ serviceNative?: () => NonNullable<Parameters<typeof openPrivateLocalRuntimeHost>
202
202
  readonly schedule: {
203
203
  readonly sessionId: string;
204
204
  readonly loopId: string;
205
- readonly origin: "human" | "model";
205
+ readonly origin: "model" | "human";
206
206
  readonly expiresAt: number | null;
207
207
  readonly prompt: string;
208
208
  readonly mode: "self_paced" | "fixed_interval";
@@ -241,7 +241,7 @@ serviceNative?: () => NonNullable<Parameters<typeof openPrivateLocalRuntimeHost>
241
241
  readonly schedule: {
242
242
  readonly sessionId: string;
243
243
  readonly loopId: string;
244
- readonly origin: "human" | "model";
244
+ readonly origin: "model" | "human";
245
245
  readonly expiresAt: number | null;
246
246
  readonly prompt: string;
247
247
  readonly mode: "self_paced" | "fixed_interval";
@@ -25,7 +25,7 @@ import { createLocalMeshLinks, localMeshLinkKey, } from "./private-local-mesh-li
25
25
  import { agentMailAddressSchema, machineAgentRequestSchema, machineDirectorySchema, } from "@fungi.computer/seam/machine-link-protocol";
26
26
  import { commandSettlementSchema, settlementReadableBy, } from "@fungi.computer/shiitake/fleet";
27
27
  import { BirdDogMailSchema } from "@fungi.computer/bird-dog/effect";
28
- import { controlAgentScheduleWithContent } from "@fungi.computer/shiitake-extensions/schedules";
28
+ import { controlAgentScheduleWithContent } from "@fungi.computer/shiitake-extensions/schedules/client";
29
29
  import { localScheduleControlInputSchema, localScheduleListInputSchema, readLocalSchedulePage, } from "./private-local-schedules.js";
30
30
  export class LocalSessionPathConflict extends Error {
31
31
  name = "LocalSessionPathConflict";
@@ -142,8 +142,8 @@ export declare function createMcpFormSession(): {
142
142
  readonly command: string;
143
143
  readonly cwd: string;
144
144
  readonly justification: string;
145
- readonly argv?: readonly string[];
146
145
  readonly prefix?: readonly string[];
146
+ readonly argv?: readonly string[];
147
147
  readonly warning?: string;
148
148
  readonly alwaysAllowCoverage?: string;
149
149
  readonly alwaysAllowUnavailableReason?: string;
@@ -204,8 +204,8 @@ export declare function createMcpFormSession(): {
204
204
  readonly command: string;
205
205
  readonly cwd: string;
206
206
  readonly justification: string;
207
- readonly argv?: readonly string[];
208
207
  readonly prefix?: readonly string[];
208
+ readonly argv?: readonly string[];
209
209
  readonly warning?: string;
210
210
  readonly alwaysAllowCoverage?: string;
211
211
  readonly alwaysAllowUnavailableReason?: string;
@@ -11,9 +11,9 @@ export declare const openAIIdentityDetailSchema: z.ZodObject<{
11
11
  "access_token.sub": "access_token.sub";
12
12
  }>;
13
13
  problem: z.ZodEnum<{
14
+ invalid: "invalid";
14
15
  absent: "absent";
15
16
  malformed: "malformed";
16
- invalid: "invalid";
17
17
  }>;
18
18
  claimNames: z.ZodArray<z.ZodString>;
19
19
  authClaimNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/truffle",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "private": false,
5
5
  "description": "Truffle: Fungi's local Agent runtime, bundled into the fungi command",
6
6
  "type": "module",
@@ -77,7 +77,7 @@
77
77
  "@cf-wasm/photon": "0.4.0",
78
78
  "@earendil-works/pi-ai": "1.3.0",
79
79
  "@effect/platform-node": "4.0.2",
80
- "@fungi.computer/agar": "0.6.0",
80
+ "@fungi.computer/agar": "0.6.1",
81
81
  "@fungi.computer/approvals": "0.2.0",
82
82
  "@fungi.computer/bird-dog": "0.3.1",
83
83
  "@fungi.computer/cairn": "0.1.0",
@@ -85,18 +85,18 @@
85
85
  "@fungi.computer/carrier": "0.2.0",
86
86
  "@fungi.computer/cordyceps": "0.4.0",
87
87
  "@fungi.computer/gills": "0.2.0",
88
- "@fungi.computer/graft": "0.1.5",
89
- "@fungi.computer/knapsack": "0.4.1",
88
+ "@fungi.computer/graft": "0.1.6",
89
+ "@fungi.computer/knapsack": "0.4.2",
90
90
  "@fungi.computer/lantern": "0.3.1",
91
- "@fungi.computer/mycelium": "0.3.0",
92
- "@fungi.computer/nacre": "0.1.1",
91
+ "@fungi.computer/mycelium": "0.3.1",
92
+ "@fungi.computer/nacre": "0.1.2",
93
93
  "@fungi.computer/seam": "0.2.0",
94
- "@fungi.computer/shiitake": "0.7.0",
95
- "@fungi.computer/shiitake-extensions": "0.5.0",
96
- "@fungi.computer/veil": "0.2.1",
94
+ "@fungi.computer/shiitake": "0.8.0",
95
+ "@fungi.computer/shiitake-extensions": "0.6.0",
96
+ "@fungi.computer/veil": "0.3.0",
97
97
  "@fungi.computer/watchdog": "0.1.0",
98
98
  "@fungi.computer/whistle": "0.3.0",
99
- "@fungi.computer/zookeeper": "0.0.6",
99
+ "@fungi.computer/zookeeper": "0.0.7",
100
100
  "@jellybrick/dbus-next": "0.11.4",
101
101
  "@modelcontextprotocol/client": "2.0.0",
102
102
  "@napi-rs/keyring": "2.1.2",