diff --git a/bun.lock b/bun.lock index c57e95e..61a6832 100644 --- a/bun.lock +++ b/bun.lock @@ -5,12 +5,12 @@ "": { "name": "notes", "dependencies": { - "@effect/platform-node": "4.0.0-rc.117", + "@effect/platform-node": "4.0.0-rc.118", "@opentui/core": "^0.5.12", - "@timmo001/effect-gh": "0.1.0", - "@timmo001/effect-herdr": "0.8.2-timmo001.1", + "@timmo001/effect-gh": "0.2.0", + "@timmo001/effect-herdr": "0.8.2-timmo001.2", "@tuiparts/core": "^0.0.6", - "effect": "4.0.0-rc.117", + "effect": "4.0.0-rc.118", "fuse.js": "^7.5.0", "proper-lockfile": "^4.1.2", "yaml": "^2.9.1", @@ -32,13 +32,13 @@ "@effect/tsgo", ], "overrides": { - "@effect/platform-node-shared": "4.0.0-rc.117", - "effect": "4.0.0-rc.117", + "@effect/platform-node-shared": "4.0.0-rc.118", + "effect": "4.0.0-rc.118", }, "packages": { - "@effect/platform-node": ["@effect/platform-node@4.0.0-rc.117", "", { "dependencies": { "@effect/platform-node-shared": "^4.0.0-rc.117", "undici": "^8.10.2" }, "peerDependencies": { "effect": "^4.0.0-rc.117", "redis": ">=5.0.0 <7.0.0" } }, "sha512-WbPcvQDkqXFnCeG6LohJ9eVNapCDhZbCpezhYKxm0IsZEk7swakRh7RkC1t2CXzd3hGmszTv2k9e/pXyZuL+wQ=="], + "@effect/platform-node": ["@effect/platform-node@4.0.0-rc.118", "", { "dependencies": { "@effect/platform-node-shared": "^4.0.0-rc.118", "undici": "^8.11.2" }, "peerDependencies": { "effect": "^4.0.0-rc.118", "redis": ">=5.0.0 <7.0.0" } }, "sha512-qdAxPZ+5bKxVnzkwziqcHZTHRHz2hyfFX6NhwEmm75CBpmaIzXIZR2LRqGd1/8eI3J3cOrXcAYzByhln7T1/EA=="], - "@effect/platform-node-shared": ["@effect/platform-node-shared@4.0.0-rc.117", "", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.21.3" }, "peerDependencies": { "effect": "^4.0.0-rc.117" } }, "sha512-GyRkEfLBG49MwJe+/XDPiXYcQ44RA9p2z0AurlsWhR1cd1PqOUMEZU1pORL+/R5hR8aH6ZuqoJYD8lAc6h+wlA=="], + "@effect/platform-node-shared": ["@effect/platform-node-shared@4.0.0-rc.118", "", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.22.0" }, "peerDependencies": { "effect": "^4.0.0-rc.118" } }, "sha512-pNbmIlxbAUxAthUNsp2xm1NLG9kxoYecsPkoYl9mNF2oxPcKDxAvkOar7tYnLSUpXJeATm4pxYVipdZjQfqO4Q=="], "@effect/tsgo": ["@effect/tsgo@0.46.1", "", { "optionalDependencies": { "@effect/tsgo-darwin-arm64": "0.46.1", "@effect/tsgo-darwin-x64": "0.46.1", "@effect/tsgo-linux-arm": "0.46.1", "@effect/tsgo-linux-arm64": "0.46.1", "@effect/tsgo-linux-x64": "0.46.1", "@effect/tsgo-win32-arm64": "0.46.1", "@effect/tsgo-win32-x64": "0.46.1" }, "bin": { "effect-tsgo": "dist/effect-tsgo.cjs" } }, "sha512-DMcBCg5nWLufejRlyqFEkXmbtaLUJ56NKny6L1LTtimvz0U3VNj9H6ZUXV4WeeWvJzVyL0y7G2wsCBAFUgy1jw=="], @@ -136,9 +136,9 @@ "@redis/time-series": ["@redis/time-series@6.2.1", "", { "peerDependencies": { "@redis/client": "^6.2.1" } }, "sha512-kiYniph04dJOole+L359B6C9E+jYS2uDP7hca6Onj0xF38ZIpyxARO0Iq0W4ZRn1e8Q6vqW00QFZVSMRA/2Ijw=="], - "@timmo001/effect-gh": ["@timmo001/effect-gh@0.1.0", "", { "peerDependencies": { "effect": "4.0.0-rc.117" } }, "sha512-i+/kJa4+IgBesWvdrZhD0Y6XY0KDJNTVIzxhtiQpXeyZO1HAO3eChNVe/r2n1YyF0T98cMONqRLiLbzJTGHgZA=="], + "@timmo001/effect-gh": ["@timmo001/effect-gh@0.2.0", "", { "peerDependencies": { "effect": "4.0.0-rc.118" } }, "sha512-+osMxyuXDzkzoNZo6oXcwwHPvUoU20COLZgwDQEmXP3pFHLvW71ko94ixHgUOyQNOJ4lOzWPchsMwaaN23CSrw=="], - "@timmo001/effect-herdr": ["@timmo001/effect-herdr@0.8.2-timmo001.1", "", { "dependencies": { "@effect/platform-node-shared": "4.0.0-rc.117", "ajv": "^8.20.0", "effect": "4.0.0-rc.117" } }, "sha512-GENgs0sbhHt1YEpIKsYzCxuycaniQ13oW1j9TLS7FtWmOG08D35B4f4b/rV2EOgAYnUpoJl67LfBfoR5R0acOw=="], + "@timmo001/effect-herdr": ["@timmo001/effect-herdr@0.8.2-timmo001.2", "", { "dependencies": { "@effect/platform-node-shared": "4.0.0-rc.118", "ajv": "^8.20.0", "effect": "4.0.0-rc.118" } }, "sha512-2mTplAybeXaUnctITNtmK3GRYtPUfZTMaJEVsTnSDOFjcgz/zoyQe5UEhEzIi0Rxzu13rA1bDMgiBBiJI09bTg=="], "@timmo001/oxlint-rules": ["@timmo001/oxlint-rules@0.3.6", "", { "peerDependencies": { "@oxlint/plugins": "1.85.0", "oxlint": "1.85.0" }, "bin": { "oxlint-rules": "dist/cli.js" } }, "sha512-9fAWa2fUwo7hOgwq/BHIsoKAIxDelsAvWf0ttpDMxgRp7M70vdEshQ6RM22j9ayof2ta23yzuj6bue/hQ7pgZQ=="], @@ -206,7 +206,7 @@ "diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="], - "effect": ["effect@4.0.0-rc.117", "", {}, "sha512-UUyi9QiOW4nySFIBM3KnYbNMd9EZliOdKfBcyLD0mPMPheO2fkuXS5y0opjWc9oqzlJxPQICEGm8gGw3kh9j/w=="], + "effect": ["effect@4.0.0-rc.118", "", {}, "sha512-hxhpCd+swzrtu9lnyPpEFre2ODQzJ9qxgyL1oHIEY8NKnW4PxTbM1XzplMZXiAsLD62HO+KJc41Nqxr9T791ZQ=="], "emoji-regex": ["emoji-regex@10.6.0", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="], diff --git a/capture/bun.lock b/capture/bun.lock index 72b7842..72e5e15 100644 --- a/capture/bun.lock +++ b/capture/bun.lock @@ -7,7 +7,7 @@ "dependencies": { "@astrojs/cloudflare": "^14.3.2", "astro": "^7.3.3", - "effect": "4.0.0-rc.117", + "effect": "4.0.0-rc.118", "jose": "^6.2.12", }, "devDependencies": { @@ -498,7 +498,7 @@ "dset": ["dset@3.1.4", "", {}, "sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA=="], - "effect": ["effect@4.0.0-rc.117", "", {}, "sha512-UUyi9QiOW4nySFIBM3KnYbNMd9EZliOdKfBcyLD0mPMPheO2fkuXS5y0opjWc9oqzlJxPQICEGm8gGw3kh9j/w=="], + "effect": ["effect@4.0.0-rc.118", "", {}, "sha512-hxhpCd+swzrtu9lnyPpEFre2ODQzJ9qxgyL1oHIEY8NKnW4PxTbM1XzplMZXiAsLD62HO+KJc41Nqxr9T791ZQ=="], "emmet": ["emmet@2.4.11", "", { "dependencies": { "@emmetio/abbreviation": "^2.3.3", "@emmetio/css-abbreviation": "^2.1.8" } }, "sha512-23QPJB3moh/U9sT4rQzGgeyyGIrcM+GH5uVYg2C6wZIxAIJq7Ng3QLT79tl8FUwDXhyq9SusfknOrofAKqvgyQ=="], diff --git a/capture/package.json b/capture/package.json index 689c714..f090e92 100644 --- a/capture/package.json +++ b/capture/package.json @@ -19,7 +19,7 @@ "dependencies": { "@astrojs/cloudflare": "^14.3.2", "astro": "^7.3.3", - "effect": "4.0.0-rc.117", + "effect": "4.0.0-rc.118", "jose": "^6.2.12" }, "devDependencies": { diff --git a/capture/worker-configuration.d.ts b/capture/worker-configuration.d.ts index 0078dde..5459265 100644 --- a/capture/worker-configuration.d.ts +++ b/capture/worker-configuration.d.ts @@ -1,6 +1,6 @@ /* eslint-disable */ // Generated by Wrangler by running `wrangler types --config=wrangler.example.jsonc` (hash: bafd5bcb018367e05055d8210b719369) -// Runtime types generated with workerd@1.20260921.1 2026-07-21 nodejs_compat +// Runtime types generated with workerd@1.20260926.1 2026-07-21 nodejs_compat interface __BaseEnv_Env { ACCESS_AUD: "development"; ACCESS_TEAM_DOMAIN: "example.cloudflareaccess.com"; @@ -454,7 +454,7 @@ type ExportedHandlerFetchHandler = (socket: Socket, env: Env, ctx: ExecutionContext) => void | Promise; type ExportedHandlerTailHandler = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise; type ExportedHandlerTraceHandler = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise; -type ExportedHandlerTailStreamHandler = (event: TailStream.TailEvent, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise; +type ExportedHandlerTailStreamHandler = (event: TailStream.TailEvent, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | undefined | Promise; type ExportedHandlerScheduledHandler = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise; type ExportedHandlerQueueHandler = (batch: MessageBatch, env: Env, ctx: ExecutionContext) => void | Promise; type ExportedHandlerTestHandler = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise; @@ -1436,7 +1436,7 @@ interface MessageEventInit { data?: any; origin?: string; lastEventId?: string; - source?: MessagePort; + source?: (MessagePort | null); ports?: MessagePort[]; } /** @@ -3435,7 +3435,7 @@ interface Container { setInactivityTimeout(durationMs: number | bigint): Promise; interceptOutboundHttp(addr: string, binding: Fetcher): Promise; interceptAllOutboundHttp(binding: Fetcher): Promise; - snapshotContainer(options: ContainerSnapshotOptions): Promise; + snapshotContainer(options?: ContainerSnapshotOptions): Promise; interceptOutboundHttps(addr: string, binding: Fetcher): Promise; exec(cmd: string[], options?: ContainerExecOptions): Promise; inspect(): Promise; @@ -3537,7 +3537,7 @@ declare class MessageChannel { interface MessagePortPostMessageOptions { transfer?: any[]; } -type LoopbackForExport Rpc.EntrypointBranded) | ExportedHandler | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? LoopbackServiceStub> : T extends new (...args: any[]) => Rpc.DurableObjectBranded ? LoopbackDurableObjectClass> : T extends ExportedHandler ? LoopbackServiceStub : undefined; +type LoopbackForExport Rpc.EntrypointBranded) | ExportedHandler | undefined = undefined> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded ? LoopbackServiceStub> : T extends new (...args: any[]) => Rpc.DurableObjectBranded ? LoopbackDurableObjectClass> : T extends new (...args: any[]) => CloudflareWorkersModule.WorkflowEntrypoint ? Workflow : T extends ExportedHandler ? LoopbackServiceStub : undefined; type LoopbackServiceStub = Fetcher & (T extends CloudflareWorkersModule.WorkerEntrypoint ? (opts: { props?: Props; }) => Fetcher : (opts: { @@ -3651,8 +3651,15 @@ declare abstract class Span { message: string; stack?: string; }): void; + updateName(name: string): this; + setStatus(status: TracingSpanStatus): this; end(): void; } +type TracingSpanStatusCode = "unset" | "ok" | "error"; +interface TracingSpanStatus { + code: TracingSpanStatusCode; + message?: string; +} /** * Represents the identity of a user authenticated via Cloudflare Access. * This matches the result of calling /cdn-cgi/access/get-identity. @@ -5165,8 +5172,13 @@ type WebSearchOptions = { search_context_size?: "low" | "medium" | "high"; user_location?: WebSearchUserLocation; }; +// Source of truth for per-model reasoning types: each model's `reasoning_effort` metadata +// in Workers AI ConfigAPI (supported efforts, aliases, defaults, and whether reasoning can +// be turned off). The Workers AI SDK type generator (cloudflare/ai/sdk, +// apps/worker-constellation-entry/scripts/build-types) turns it into the per-model +// `inputs` types below; the developer docs model schemas come from the same metadata. type ChatTemplateKwargs = { - /** Whether to enable reasoning, enabled by default. */ + /** Whether to enable reasoning. Support and defaults depend on the model. */ enable_thinking?: boolean; /** If false, preserves reasoning context between turns. */ clear_thinking?: boolean; @@ -5187,6 +5199,7 @@ type ChatCompletionsCommonOptions = { parallel_tool_calls?: boolean; prediction?: PredictionContent; presence_penalty?: number | null; + /** Reasoning effort. Supported levels depend on the model. */ reasoning_effort?: "low" | "medium" | "high" | null; chat_template_kwargs?: ChatTemplateKwargs; response_format?: ResponseFormat; @@ -9202,11 +9215,59 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 { postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output; } declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B { - inputs: XOR; + inputs: XOR & { + reasoning?: (Omit & { + /** + * Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled. + * + * @default "medium" + */ + effort?: "low" | "medium" | "high" | null; + }) | null; + }, Omit & { + /** + * Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled. + * + * @default "medium" + */ + reasoning_effort?: "low" | "medium" | "high" | null; + chat_template_kwargs?: Omit & { + /** + * Reasoning is always enabled for this model and cannot be disabled. + * + * @default true + */ + enable_thinking?: true; + }; + }>; postProcessedOutputs: XOR; } declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B { - inputs: XOR; + inputs: XOR & { + reasoning?: (Omit & { + /** + * Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled. + * + * @default "medium" + */ + effort?: "low" | "medium" | "high" | null; + }) | null; + }, Omit & { + /** + * Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled. + * + * @default "medium" + */ + reasoning_effort?: "low" | "medium" | "high" | null; + chat_template_kwargs?: Omit & { + /** + * Reasoning is always enabled for this model and cannot be disabled. + * + * @default true + */ + enable_thinking?: true; + }; + }>; postProcessedOutputs: XOR; } interface Ai_Cf_Leonardo_Phoenix_1_0_Input { @@ -10175,7 +10236,16 @@ declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B { postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Output; } declare abstract class Base_Ai_Cf_Zai_Org_Glm_4_7_Flash { - inputs: ChatCompletionsInput; + inputs: Omit & { + chat_template_kwargs?: Omit & { + /** + * Whether to enable reasoning for this model. This model has no reasoning effort levels. + * + * @default true + */ + enable_thinking?: boolean; + }; + }; postProcessedOutputs: ChatCompletionsOutput; } declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 { @@ -10183,23 +10253,146 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 { postProcessedOutputs: ChatCompletionsOutput; } declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 { - inputs: ChatCompletionsInput; + inputs: Omit & { + /** + * Reasoning effort. Supported levels: high, none. Compatibility aliases (accepted by the API, not by these types): low maps to high; medium maps to high; max maps to high. + * + * @default "high" + */ + reasoning_effort?: "high" | "none" | null; + chat_template_kwargs?: Omit & { + /** + * Whether to enable reasoning for this model. + * + * @default true + */ + enable_thinking?: boolean; + }; + }; postProcessedOutputs: ChatCompletionsOutput; } +type Ai_Cf_Nvidia_Nemotron_3_120B_A12B_Input = Omit & { + /** + * ID of the model to use (for example, '@cf/nvidia/nemotron-3-120b-a12b'). + */ + model?: ChatCompletionsInput["model"]; + /** + * The maximum number of tokens to generate. + */ + max_tokens?: ChatCompletionsInput["max_tokens"]; + /** + * Set of key-value pairs that can be attached to the object. + */ + metadata?: ChatCompletionsInput["metadata"]; + /** + * Output types requested from the model. + */ + modalities?: ChatCompletionsInput["modalities"]; + /** + * Nemotron chat-template controls for normal reasoning, low-effort reasoning, and non-reasoning responses. + */ + chat_template_kwargs?: { + /** + * Whether to enable reasoning. Reasoning is enabled by default. + */ + enable_thinking?: boolean; + /** + * When reasoning is enabled, use Nemotron's low-effort reasoning mode, which uses significantly fewer reasoning tokens. + */ + low_effort?: boolean; + /** + * For coding agent use, Nvidia suggests setting force_nonempty_content=true + */ + force_nonempty_content?: boolean; + }; + /** + * Whether to store the output for model distillation or evaluation. + * + * @default false + */ + store?: ChatCompletionsInput["store"]; +}; declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B { - inputs: ChatCompletionsInput; + inputs: Ai_Cf_Nvidia_Nemotron_3_120B_A12B_Input; postProcessedOutputs: ChatCompletionsOutput; } -declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT { - inputs: ChatCompletionsInput; +type Ai_Cf_Google_Gemma_4_26B_A4B_It_Input = Omit & { + chat_template_kwargs?: Omit & { + /** + * Whether to enable reasoning for this model. This model has no reasoning effort levels. + * + * @default true + */ + enable_thinking?: boolean; + }; +} & { + /** + * @default false + */ + skip_special_tokens?: boolean; +}; +declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_It { + inputs: Ai_Cf_Google_Gemma_4_26B_A4B_It_Input; postProcessedOutputs: ChatCompletionsOutput; } +/** @deprecated Use Base_Ai_Cf_Google_Gemma_4_26B_A4B_It. */ +declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT extends Base_Ai_Cf_Google_Gemma_4_26B_A4B_It { +} +type Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B_Input = { + /** + * readable stream with audio data and content-type specified for that data + */ + audio: { + body: object; + contentType: string; + }; +} | { + /** + * base64 encoded audio data + */ + audio: string; + encoding?: "wav" | "flac" | "ogg" | "linear16"; + sample_rate?: number; + channels?: number; +}; +interface Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B_Output { + text?: string; + duration?: number; +} +declare abstract class Base_Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B { + inputs: Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B_Input; + postProcessedOutputs: Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B_Output; +} declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code { - inputs: ChatCompletionsInput; + inputs: Omit & { + chat_template_kwargs?: Omit & { + /** + * Reasoning is always enabled for this model and cannot be disabled. This model has no reasoning effort levels. + * + * @default true + */ + enable_thinking?: true; + }; + }; postProcessedOutputs: ChatCompletionsOutput; } declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_2 { - inputs: ChatCompletionsInput; + inputs: Omit & { + /** + * Reasoning effort. Supported levels: max, high, none. Compatibility aliases (accepted by the API, not by these types): low maps to high; medium maps to high; xhigh maps to max; minimal maps to none. + * + * @default "max" + */ + reasoning_effort?: "max" | "high" | "none" | null; + chat_template_kwargs?: Omit & { + /** + * Whether to enable reasoning for this model. + * + * @default true + */ + enable_thinking?: boolean; + }; + }; postProcessedOutputs: ChatCompletionsOutput; } interface Ai_Cf_Moondream_Moondream3_1_9B_A2B_Input { @@ -10336,26 +10529,104 @@ declare abstract class Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B { postProcessedOutputs: Ai_Cf_Moondream_Moondream3_1_9B_A2B_Output; } declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731 { - inputs: ChatCompletionsInput; + inputs: Omit & { + /** + * Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases (accepted by the API, not by these types): minimal maps to low; medium maps to high; xhigh maps to high. + * + * @default "high" + */ + reasoning_effort?: "max" | "high" | "low" | "none" | null; + chat_template_kwargs?: Omit & { + /** + * Whether to enable reasoning for this model. + * + * @default true + */ + enable_thinking?: boolean; + }; + }; postProcessedOutputs: ChatCompletionsOutput; } declare abstract class Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813 { - inputs: ChatCompletionsInput; + inputs: Omit & { + /** + * Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases (accepted by the API, not by these types): minimal maps to low; medium maps to high; xhigh maps to high. + * + * @default "high" + */ + reasoning_effort?: "max" | "high" | "low" | "none" | null; + chat_template_kwargs?: Omit & { + /** + * Whether to enable reasoning for this model. + * + * @default true + */ + enable_thinking?: boolean; + }; + }; postProcessedOutputs: ChatCompletionsOutput; } declare abstract class Base_Ai_Cf_Qwen_Qwen3_8_27B { - inputs: ChatCompletionsInput; + inputs: Omit & { + /** + * Reasoning effort. Supported levels: low, medium, xhigh. + * + * @default "xhigh" + */ + reasoning_effort?: "low" | "medium" | "xhigh" | null; + chat_template_kwargs?: Omit & { + /** + * Whether to enable reasoning for this model. + * + * @default true + */ + enable_thinking?: boolean; + }; + }; + postProcessedOutputs: ChatCompletionsOutput; +} +declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3 { + inputs: Omit & { + /** + * Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases (accepted by the API, not by these types): none maps to max; minimal maps to max; medium maps to max; xhigh maps to max. + * + * @default "max" + */ + reasoning_effort?: "max" | "high" | "low" | null; + chat_template_kwargs?: Omit & { + /** + * Reasoning is always enabled for this model and cannot be disabled. + * + * @default true + */ + enable_thinking?: true; + }; + }; postProcessedOutputs: ChatCompletionsOutput; } declare abstract class Base_Ai_Cf_Zai_Org_Glm_5_3_Flash { - inputs: ChatCompletionsInput; + inputs: Omit & { + /** + * Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases (accepted by the API, not by these types): none maps to max; minimal maps to max; medium maps to max; xhigh maps to max. + * + * @default "max" + */ + reasoning_effort?: "max" | "high" | "low" | null; + chat_template_kwargs?: Omit & { + /** + * Reasoning is always enabled for this model and cannot be disabled. + * + * @default true + */ + enable_thinking?: true; + }; + }; postProcessedOutputs: ChatCompletionsOutput; } interface AiModels { "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification; "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage; "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage; - "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage; "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage; "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage; "@cf/myshell-ai/melotts": BaseAiTextToSpeech; @@ -10442,13 +10713,15 @@ interface AiModels { "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5; "@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6; "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B; - "@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT; + "@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_It; + "@cf/nvidia/nemotron-speech-streaming-en-0.6b": Base_Ai_Cf_Nvidia_Nemotron_Speech_Streaming_En_0_6B; "@cf/moonshotai/kimi-k2.7-code": Base_Ai_Cf_Moonshotai_Kimi_K2_7_Code; "@cf/zai-org/glm-5.2": Base_Ai_Cf_Zai_Org_Glm_5_2; "@cf/moondream/moondream3.1-9B-A2B": Base_Ai_Cf_Moondream_Moondream3_1_9B_A2B; "@cf/deepseek-ai/deepseek-v4-flash-0731": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Flash_0731; "@cf/deepseek-ai/deepseek-v4-pro-0813": Base_Ai_Cf_Deepseek_Ai_Deepseek_V4_Pro_0813; "@cf/qwen/qwen3.8-27b": Base_Ai_Cf_Qwen_Qwen3_8_27B; + "@cf/zai-org/glm-5.3": Base_Ai_Cf_Zai_Org_Glm_5_3; "@cf/zai-org/glm-5.3-flash": Base_Ai_Cf_Zai_Org_Glm_5_3_Flash; } type AiOptions = { @@ -10512,9 +10785,22 @@ type AiModelListType = Record; type AiAsyncBatchResponse = { request_id: string; }; +type AiWebSearchRequest = { + /** AI Gateway configuration used for this request. */ + gatewayId: string; + /** Search query. */ + query: string; + /** Maximum number of results. Defaults to 10 and is capped at 20. */ + limit?: number; + /** Optional BYOK web-search provider configured on the gateway. */ + provider?: string; + /** Optional BYOK key alias. Defaults to `default`. */ + byokAlias?: string; +}; declare abstract class Ai { aiGatewayLogId: string | null; gateway(gatewayId: string): AiGateway; + websearch(request: AiWebSearchRequest): Promise; /** * @deprecated Use the standalone `ai_search_namespaces` or `ai_search` Workers bindings instead. * See https://developers.cloudflare.com/ai-search/usage/workers-binding/ @@ -13920,7 +14206,7 @@ declare namespace CloudflareWorkersModule { queue?(batch: MessageBatch): void | Promise; scheduled?(controller: ScheduledController): void | Promise; tail?(events: TraceItem[]): void | Promise; - tailStream?(event: TailStream.TailEvent): TailStream.TailEventHandlerType | Promise; + tailStream?(event: TailStream.TailEvent): TailStream.TailEventHandlerType | undefined | Promise; test?(controller: TestController): void | Promise; trace?(traces: TraceItem[]): void | Promise; } @@ -14970,6 +15256,12 @@ declare namespace TailStream { readonly cpuTime: number; readonly wallTime: number; } + type SpanStatusCode = "unset" | "ok" | "error"; + interface SpanStatus { + readonly code: SpanStatusCode; + /** A developer-facing error message, present only when code is "error". */ + readonly message?: string; + } interface SpanOpen { readonly type: "spanOpen"; readonly name: string; @@ -14981,6 +15273,17 @@ declare namespace TailStream { readonly type: "spanClose"; readonly outcome: EventOutcome; } + type SpanUpdateInfo = { + readonly type: "name"; + readonly name: string; + } | { + readonly type: "status"; + readonly status: SpanStatus; + }; + interface SpanUpdate { + readonly type: "spanUpdate"; + readonly info: SpanUpdateInfo; + } interface DiagnosticChannelEvent { readonly type: "diagnosticChannel"; readonly channel: string; @@ -15034,7 +15337,7 @@ declare namespace TailStream { readonly type: "attributes"; readonly info: Attribute[]; } - type EventType = Onset | Outcome | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | StreamDiagnostic | Return | Attributes; + type EventType = Onset | Outcome | SpanOpen | SpanClose | SpanUpdate | DiagnosticChannelEvent | Exception | Log | StreamDiagnostic | Return | Attributes; // Context in which this trace event lives. interface SpanContext { // Single id for the entire top-level invocation @@ -15069,6 +15372,7 @@ declare namespace TailStream { outcome?: TailEventHandler; spanOpen?: TailEventHandler; spanClose?: TailEventHandler; + spanUpdate?: TailEventHandler; diagnosticChannel?: TailEventHandler; exception?: TailEventHandler; log?: TailEventHandler; diff --git a/package.json b/package.json index 04741e1..446c429 100644 --- a/package.json +++ b/package.json @@ -19,12 +19,12 @@ "prepare": "effect-tsgo patch" }, "dependencies": { - "@effect/platform-node": "4.0.0-rc.117", + "@effect/platform-node": "4.0.0-rc.118", "@opentui/core": "^0.5.12", - "@timmo001/effect-gh": "0.1.0", - "@timmo001/effect-herdr": "0.8.2-timmo001.1", + "@timmo001/effect-gh": "0.2.0", + "@timmo001/effect-herdr": "0.8.2-timmo001.2", "@tuiparts/core": "^0.0.6", - "effect": "4.0.0-rc.117", + "effect": "4.0.0-rc.118", "fuse.js": "^7.5.0", "proper-lockfile": "^4.1.2", "yaml": "^2.9.1" diff --git a/src/daemon/services/OpenCodeClient.ts b/src/daemon/services/OpenCodeClient.ts index c975b8a..8a3d8ba 100644 --- a/src/daemon/services/OpenCodeClient.ts +++ b/src/daemon/services/OpenCodeClient.ts @@ -7,7 +7,7 @@ import { Schema, Stream, } from "effect"; -import { ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcessSpawner } from "effect/process"; import type { DaemonConfig, OpenCodeModel } from "../schema.js"; import { createOpenCodeSession, diff --git a/src/daemon/services/OpenCodeSession.ts b/src/daemon/services/OpenCodeSession.ts index 566d5e5..742053c 100644 --- a/src/daemon/services/OpenCodeSession.ts +++ b/src/daemon/services/OpenCodeSession.ts @@ -1,5 +1,5 @@ import { Effect, Redacted, Schedule, Schema, Stream } from "effect"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { resolve } from "node:path"; import type { DaemonConfig } from "../schema.js"; diff --git a/src/index.ts b/src/index.ts index 02ed8ac..9653bc1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import { Cause, Console, Effect, Layer, Schema } from "effect"; import { NodeRuntime, NodeServices } from "@effect/platform-node"; import { herdrSdkLayer } from "@timmo001/effect-herdr"; -import { CliError, Command, Flag } from "effect/unstable/cli"; +import { CliError, Command, Flag } from "effect/cli"; import { basename } from "node:path"; import { detectAgentTargets, openNoteAgent } from "./notes/agentTargets.js"; import { activeNoteCount } from "./notes/activeCount.js"; diff --git a/src/mcp/resources/notes.ts b/src/mcp/resources/notes.ts index acee6c4..5296279 100644 --- a/src/mcp/resources/notes.ts +++ b/src/mcp/resources/notes.ts @@ -1,5 +1,5 @@ import { Effect, Schema } from "effect"; -import { McpSchema, McpServer } from "effect/unstable/ai"; +import { McpSchema, McpServer } from "effect/ai"; import { renderHelp } from "../../cli/help.js"; import { Notes } from "../../notes/services/Notes.js"; diff --git a/src/mcp/server.ts b/src/mcp/server.ts index 6931834..5c3071f 100644 --- a/src/mcp/server.ts +++ b/src/mcp/server.ts @@ -1,6 +1,6 @@ import { Effect, Layer, Logger } from "effect"; import { NodeStdio } from "@effect/platform-node"; -import { McpProtocol, McpServer } from "effect/unstable/ai"; +import { McpProtocol, McpServer } from "effect/ai"; import { Notifier } from "./services/Notifier.js"; import { registerNotesResources } from "./resources/notes.js"; import { registerNotesTools } from "./tools/notes.js"; diff --git a/src/mcp/tools/register.ts b/src/mcp/tools/register.ts index 8d3ed31..9a1f6de 100644 --- a/src/mcp/tools/register.ts +++ b/src/mcp/tools/register.ts @@ -1,5 +1,5 @@ import { Cause, Context, Effect, Schema } from "effect"; -import { McpSchema, McpServer, Tool } from "effect/unstable/ai"; +import { McpSchema, McpServer, Tool } from "effect/ai"; /** MCP tool annotations for a read-only, closed-world, idempotent tool. */ export const READONLY_HINTS = { diff --git a/tests/daemon/services/IssueQueue.test.ts b/tests/daemon/services/IssueQueue.test.ts index 5ab864b..e096576 100644 --- a/tests/daemon/services/IssueQueue.test.ts +++ b/tests/daemon/services/IssueQueue.test.ts @@ -12,7 +12,7 @@ import { Stream, } from "effect"; import { TestClock } from "effect/testing"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { DaemonConfig } from "../../../src/daemon/schema.js"; import { IssueQueue, diff --git a/tests/daemon/services/OpenCodeClient.test.ts b/tests/daemon/services/OpenCodeClient.test.ts index a7a5b67..a69020c 100644 --- a/tests/daemon/services/OpenCodeClient.test.ts +++ b/tests/daemon/services/OpenCodeClient.test.ts @@ -11,7 +11,7 @@ import { Stream, } from "effect"; import { TestClock } from "effect/testing"; -import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; +import { ChildProcess, ChildProcessSpawner } from "effect/process"; import { OpenCodeClient } from "../../../src/daemon/services/OpenCodeClient.js"; import { DaemonConfig } from "../../../src/daemon/schema.js"; diff --git a/tests/mcp/tools/notes.test.ts b/tests/mcp/tools/notes.test.ts index 57e2e5c..8775af2 100644 --- a/tests/mcp/tools/notes.test.ts +++ b/tests/mcp/tools/notes.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, test } from "bun:test"; import { Effect, Layer, Schema } from "effect"; -import { McpSchema, McpServer } from "effect/unstable/ai"; +import { McpSchema, McpServer } from "effect/ai"; import { existsSync, mkdirSync,