libretto 0.5.4 → 0.5.6
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 +23 -10
- package/README.template.md +23 -10
- package/dist/cli/cli.js +10 -0
- package/dist/cli/commands/ai.js +77 -2
- package/dist/cli/commands/browser.js +71 -6
- package/dist/cli/commands/execution.js +101 -44
- package/dist/cli/commands/setup.js +376 -0
- package/dist/cli/commands/snapshot.js +2 -2
- package/dist/cli/commands/status.js +62 -0
- package/dist/cli/core/{snapshot-api-config.js → ai-model.js} +81 -7
- package/dist/cli/core/api-snapshot-analyzer.js +7 -5
- package/dist/cli/core/browser.js +81 -42
- package/dist/cli/core/{ai-config.js → config.js} +13 -79
- package/dist/cli/core/context.js +1 -25
- package/dist/cli/core/deploy-artifact.js +121 -61
- package/dist/cli/core/readonly-exec.js +231 -0
- package/dist/{shared/llm/client.js → cli/core/resolve-model.js} +4 -68
- package/dist/cli/core/session.js +44 -0
- package/dist/cli/core/skill-version.js +73 -0
- package/dist/cli/core/telemetry.js +1 -54
- package/dist/cli/index.js +1 -7
- package/dist/cli/router.js +4 -4
- package/dist/cli/workers/run-integration-runtime.js +29 -25
- package/dist/cli/workers/run-integration-worker-protocol.js +3 -2
- package/dist/index.d.ts +2 -4
- package/dist/index.js +2 -2
- package/dist/runtime/extract/extract.d.ts +2 -2
- package/dist/runtime/extract/extract.js +4 -2
- package/dist/runtime/extract/index.d.ts +1 -1
- package/dist/runtime/recovery/agent.d.ts +2 -3
- package/dist/runtime/recovery/agent.js +5 -3
- package/dist/runtime/recovery/errors.d.ts +2 -3
- package/dist/runtime/recovery/errors.js +4 -2
- package/dist/runtime/recovery/index.d.ts +1 -2
- package/dist/runtime/recovery/recovery.d.ts +2 -3
- package/dist/runtime/recovery/recovery.js +3 -3
- package/dist/shared/debug/pause.js +4 -21
- package/dist/shared/run/api.d.ts +2 -0
- package/dist/shared/run/browser.d.ts +4 -1
- package/dist/shared/run/browser.js +5 -3
- package/dist/shared/state/index.d.ts +1 -1
- package/dist/shared/state/index.js +2 -0
- package/dist/shared/state/session-state.d.ts +10 -1
- package/dist/shared/state/session-state.js +3 -0
- package/dist/shared/workflow/workflow.d.ts +2 -3
- package/dist/shared/workflow/workflow.js +16 -9
- package/package.json +3 -4
- package/scripts/postinstall.mjs +13 -11
- package/scripts/skills-libretto.mjs +14 -4
- package/skills/AGENTS.md +11 -0
- package/skills/libretto/SKILL.md +30 -9
- package/skills/libretto/references/auth-profiles.md +1 -1
- package/skills/libretto/references/code-generation-rules.md +6 -6
- package/skills/libretto/references/configuration-file-reference.md +11 -6
- package/skills/libretto-readonly/SKILL.md +95 -0
- package/src/cli/cli.ts +10 -0
- package/src/cli/commands/ai.ts +111 -1
- package/src/cli/commands/browser.ts +81 -7
- package/src/cli/commands/execution.ts +128 -61
- package/src/cli/commands/setup.ts +499 -0
- package/src/cli/commands/snapshot.ts +2 -2
- package/src/cli/commands/status.ts +77 -0
- package/src/cli/core/{snapshot-api-config.ts → ai-model.ts} +154 -14
- package/src/cli/core/api-snapshot-analyzer.ts +7 -5
- package/src/cli/core/browser.ts +107 -45
- package/src/cli/core/{ai-config.ts → config.ts} +13 -108
- package/src/cli/core/context.ts +1 -45
- package/src/cli/core/deploy-artifact.ts +141 -71
- package/src/cli/core/readonly-exec.ts +284 -0
- package/src/{shared/llm/client.ts → cli/core/resolve-model.ts} +3 -85
- package/src/cli/core/session.ts +62 -2
- package/src/cli/core/skill-version.ts +93 -0
- package/src/cli/core/telemetry.ts +0 -52
- package/src/cli/index.ts +0 -6
- package/src/cli/router.ts +4 -4
- package/src/cli/workers/run-integration-runtime.ts +36 -31
- package/src/cli/workers/run-integration-worker-protocol.ts +2 -1
- package/src/index.ts +1 -7
- package/src/runtime/extract/extract.ts +6 -5
- package/src/runtime/recovery/agent.ts +5 -4
- package/src/runtime/recovery/errors.ts +4 -3
- package/src/runtime/recovery/recovery.ts +4 -4
- package/src/shared/debug/pause.ts +4 -23
- package/src/shared/run/browser.ts +5 -1
- package/src/shared/state/index.ts +2 -0
- package/src/shared/state/session-state.ts +3 -0
- package/src/shared/workflow/workflow.ts +24 -15
- package/dist/cli/commands/init.js +0 -286
- package/dist/cli/commands/logs.js +0 -117
- package/dist/shared/llm/ai-sdk-adapter.d.ts +0 -22
- package/dist/shared/llm/ai-sdk-adapter.js +0 -49
- package/dist/shared/llm/client.d.ts +0 -13
- package/dist/shared/llm/index.d.ts +0 -5
- package/dist/shared/llm/index.js +0 -6
- package/dist/shared/llm/types.d.ts +0 -67
- package/dist/shared/llm/types.js +0 -0
- package/src/cli/commands/init.ts +0 -331
- package/src/cli/commands/logs.ts +0 -128
- package/src/shared/llm/ai-sdk-adapter.ts +0 -81
- package/src/shared/llm/index.ts +0 -3
- package/src/shared/llm/types.ts +0 -63
package/src/shared/llm/types.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type z from "zod";
|
|
2
|
-
|
|
3
|
-
export type MessageContentPart =
|
|
4
|
-
| { type: "text"; text: string }
|
|
5
|
-
| { type: "image"; image: string | Uint8Array; mediaType?: string };
|
|
6
|
-
|
|
7
|
-
export type Message = {
|
|
8
|
-
role: "user" | "assistant";
|
|
9
|
-
content: string | MessageContentPart[];
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Pluggable LLM client interface.
|
|
14
|
-
*
|
|
15
|
-
* Users provide their own implementation backed by any LLM provider
|
|
16
|
-
* (OpenAI, Anthropic, etc.). Libretto uses this interface for AI extraction,
|
|
17
|
-
* recovery agents, and error detection.
|
|
18
|
-
*
|
|
19
|
-
* **Error handling:** implementations should throw on failure rather than
|
|
20
|
-
* returning sentinel values (e.g. `null` or `undefined`). Libretto relies
|
|
21
|
-
* on exceptions to trigger retry/recovery logic.
|
|
22
|
-
*
|
|
23
|
-
* A ready-made adapter for the Vercel AI SDK is available via
|
|
24
|
-
* {@link createLLMClientFromModel} in `libretto/llm`.
|
|
25
|
-
*/
|
|
26
|
-
export interface LLMClient {
|
|
27
|
-
/**
|
|
28
|
-
* Generate a structured object from a single text prompt.
|
|
29
|
-
*
|
|
30
|
-
* The underlying model **must** support structured / JSON output so that
|
|
31
|
-
* the response can be parsed and validated against the provided Zod schema.
|
|
32
|
-
*
|
|
33
|
-
* @param opts.prompt - The text prompt sent to the model.
|
|
34
|
-
* @param opts.schema - A Zod schema describing the expected response shape.
|
|
35
|
-
* @param opts.temperature - Sampling temperature (default chosen by implementation, typically 0).
|
|
36
|
-
* @returns The parsed object matching the schema.
|
|
37
|
-
* @throws On LLM or parsing failure.
|
|
38
|
-
*/
|
|
39
|
-
generateObject<T extends z.ZodType>(opts: {
|
|
40
|
-
prompt: string;
|
|
41
|
-
schema: T;
|
|
42
|
-
temperature?: number;
|
|
43
|
-
}): Promise<z.output<T>>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Generate a structured object from a conversation-style message array.
|
|
47
|
-
*
|
|
48
|
-
* Messages may contain **image content** (base64 data URIs via
|
|
49
|
-
* {@link MessageContentPart}), so the backing model must support
|
|
50
|
-
* vision / multimodal input when images are present.
|
|
51
|
-
*
|
|
52
|
-
* @param opts.messages - Ordered list of user/assistant messages, potentially multimodal.
|
|
53
|
-
* @param opts.schema - A Zod schema describing the expected response shape.
|
|
54
|
-
* @param opts.temperature - Sampling temperature (default chosen by implementation, typically 0).
|
|
55
|
-
* @returns The parsed object matching the schema.
|
|
56
|
-
* @throws On LLM or parsing failure.
|
|
57
|
-
*/
|
|
58
|
-
generateObjectFromMessages<T extends z.ZodType>(opts: {
|
|
59
|
-
messages: Message[];
|
|
60
|
-
schema: T;
|
|
61
|
-
temperature?: number;
|
|
62
|
-
}): Promise<z.output<T>>;
|
|
63
|
-
}
|