@avocadostudio-ai/orchestrator-core 0.1.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.
- package/LICENSE +201 -0
- package/dist/agent/agent-context.d.ts +19 -0
- package/dist/agent/agent-context.js +67 -0
- package/dist/agent/agent-logger.d.ts +5 -0
- package/dist/agent/agent-logger.js +22 -0
- package/dist/agent/agent-loop-openai.d.ts +8 -0
- package/dist/agent/agent-loop-openai.js +172 -0
- package/dist/agent/agent-loop.d.ts +56 -0
- package/dist/agent/agent-loop.js +167 -0
- package/dist/agent/agent-provider.d.ts +28 -0
- package/dist/agent/agent-provider.js +63 -0
- package/dist/agent/agent-tools.d.ts +28 -0
- package/dist/agent/agent-tools.js +899 -0
- package/dist/agent/context/editing-guidelines.md +46 -0
- package/dist/agent/context/role.md +39 -0
- package/dist/agent/integration-prompt.d.ts +9 -0
- package/dist/agent/integration-prompt.js +154 -0
- package/dist/agent/sites-agent-context.d.ts +12 -0
- package/dist/agent/sites-agent-context.js +316 -0
- package/dist/agent/sites-agent-shared.d.ts +161 -0
- package/dist/agent/sites-agent-shared.js +1101 -0
- package/dist/agent/sites-agent-tools.d.ts +18 -0
- package/dist/agent/sites-agent-tools.js +1227 -0
- package/dist/chat/anthropic-cache.d.ts +20 -0
- package/dist/chat/anthropic-cache.js +54 -0
- package/dist/chat/anthropic-planner.d.ts +98 -0
- package/dist/chat/anthropic-planner.js +1012 -0
- package/dist/chat/changelog-coverage-validator.d.ts +37 -0
- package/dist/chat/changelog-coverage-validator.js +215 -0
- package/dist/chat/chat-pipeline-context.d.ts +211 -0
- package/dist/chat/chat-pipeline-context.js +249 -0
- package/dist/chat/chat-pipeline-deterministic.d.ts +61 -0
- package/dist/chat/chat-pipeline-deterministic.js +407 -0
- package/dist/chat/chat-pipeline-image.d.ts +86 -0
- package/dist/chat/chat-pipeline-image.js +897 -0
- package/dist/chat/chat-pipeline-shared.d.ts +69 -0
- package/dist/chat/chat-pipeline-shared.js +212 -0
- package/dist/chat/chat-pipeline-translation.d.ts +27 -0
- package/dist/chat/chat-pipeline-translation.js +417 -0
- package/dist/chat/chat-pipeline-ui.d.ts +14 -0
- package/dist/chat/chat-pipeline-ui.js +244 -0
- package/dist/chat/chat-pipeline.d.ts +99 -0
- package/dist/chat/chat-pipeline.js +3999 -0
- package/dist/chat/decomposer.d.ts +21 -0
- package/dist/chat/decomposer.js +65 -0
- package/dist/chat/gemini-planner.d.ts +70 -0
- package/dist/chat/gemini-planner.js +541 -0
- package/dist/chat/hallucination-validator.d.ts +36 -0
- package/dist/chat/hallucination-validator.js +110 -0
- package/dist/chat/locale-strings.d.ts +47 -0
- package/dist/chat/locale-strings.js +100 -0
- package/dist/chat/plan-json-schema.d.ts +133 -0
- package/dist/chat/plan-json-schema.js +112 -0
- package/dist/chat/planner-types.d.ts +120 -0
- package/dist/chat/planner-types.js +66 -0
- package/dist/chat/planner.d.ts +148 -0
- package/dist/chat/planner.js +1361 -0
- package/dist/chat/prompts.d.ts +67 -0
- package/dist/chat/prompts.js +356 -0
- package/dist/chat/provider-routing.d.ts +14 -0
- package/dist/chat/provider-routing.js +27 -0
- package/dist/chat/variation-pipeline.d.ts +135 -0
- package/dist/chat/variation-pipeline.js +837 -0
- package/dist/chat/vision-alt-generator.d.ts +35 -0
- package/dist/chat/vision-alt-generator.js +152 -0
- package/dist/cms/adapter.d.ts +62 -0
- package/dist/cms/adapter.js +1 -0
- package/dist/cms/bootstrap.d.ts +17 -0
- package/dist/cms/bootstrap.js +85 -0
- package/dist/cms/editor-api-adapter.d.ts +23 -0
- package/dist/cms/editor-api-adapter.js +71 -0
- package/dist/cms/index.d.ts +4 -0
- package/dist/cms/index.js +3 -0
- package/dist/cms/json-file-adapter.d.ts +11 -0
- package/dist/cms/json-file-adapter.js +62 -0
- package/dist/demo-mode.d.ts +59 -0
- package/dist/demo-mode.js +201 -0
- package/dist/errors.d.ts +67 -0
- package/dist/errors.js +129 -0
- package/dist/http/chat-stream-resumable.d.ts +108 -0
- package/dist/http/chat-stream-resumable.js +290 -0
- package/dist/http/chat-stream.d.ts +99 -0
- package/dist/http/chat-stream.js +92 -0
- package/dist/image/gdrive-client.d.ts +22 -0
- package/dist/image/gdrive-client.js +215 -0
- package/dist/image/image-helpers.d.ts +95 -0
- package/dist/image/image-helpers.js +488 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/jira/jira-approval.d.ts +22 -0
- package/dist/jira/jira-approval.js +51 -0
- package/dist/jira/jira-client.d.ts +44 -0
- package/dist/jira/jira-client.js +313 -0
- package/dist/jira/jira-poller.d.ts +46 -0
- package/dist/jira/jira-poller.js +184 -0
- package/dist/jira/jira-processor.d.ts +103 -0
- package/dist/jira/jira-processor.js +1085 -0
- package/dist/jira/jira-types.d.ts +117 -0
- package/dist/jira/jira-types.js +38 -0
- package/dist/logger.d.ts +12 -0
- package/dist/logger.js +28 -0
- package/dist/migration/mcp-server-stdio.d.ts +8 -0
- package/dist/migration/mcp-server-stdio.js +672 -0
- package/dist/migration/migration-prompt.d.ts +7 -0
- package/dist/migration/migration-prompt.js +197 -0
- package/dist/migration/migration-tools.d.ts +17 -0
- package/dist/migration/migration-tools.js +159 -0
- package/dist/migration/scrape-cache.d.ts +9 -0
- package/dist/migration/scrape-cache.js +19 -0
- package/dist/nlp/deterministic-planner-context.d.ts +141 -0
- package/dist/nlp/deterministic-planner-context.js +362 -0
- package/dist/nlp/deterministic-planner-pages.d.ts +26 -0
- package/dist/nlp/deterministic-planner-pages.js +170 -0
- package/dist/nlp/deterministic-planner-patches.d.ts +80 -0
- package/dist/nlp/deterministic-planner-patches.js +508 -0
- package/dist/nlp/deterministic-planner-refs.d.ts +33 -0
- package/dist/nlp/deterministic-planner-refs.js +164 -0
- package/dist/nlp/deterministic-planner-suggestions.d.ts +49 -0
- package/dist/nlp/deterministic-planner-suggestions.js +579 -0
- package/dist/nlp/deterministic-planner.d.ts +85 -0
- package/dist/nlp/deterministic-planner.js +1631 -0
- package/dist/nlp/intent-detection.d.ts +309 -0
- package/dist/nlp/intent-detection.js +730 -0
- package/dist/nlp/intent-helpers.d.ts +15 -0
- package/dist/nlp/intent-helpers.js +243 -0
- package/dist/nlp/intent-patterns.d.ts +40 -0
- package/dist/nlp/intent-patterns.js +223 -0
- package/dist/nlp/plan-normalizer.d.ts +41 -0
- package/dist/nlp/plan-normalizer.js +1537 -0
- package/dist/ops/destructive-action-gate.d.ts +44 -0
- package/dist/ops/destructive-action-gate.js +90 -0
- package/dist/ops/ops-engine.d.ts +151 -0
- package/dist/ops/ops-engine.js +1394 -0
- package/dist/publish/diff-engine.d.ts +18 -0
- package/dist/publish/diff-engine.js +305 -0
- package/dist/publish/publish-helpers.d.ts +87 -0
- package/dist/publish/publish-helpers.js +521 -0
- package/dist/publish/publish-target-registry.d.ts +7 -0
- package/dist/publish/publish-target-registry.js +61 -0
- package/dist/publish/publish-target.d.ts +81 -0
- package/dist/publish/publish-target.js +1 -0
- package/dist/publish/targets/deploy-hook.d.ts +13 -0
- package/dist/publish/targets/deploy-hook.js +123 -0
- package/dist/publish/targets/git.d.ts +13 -0
- package/dist/publish/targets/git.js +55 -0
- package/dist/publish/targets/site-contract.d.ts +19 -0
- package/dist/publish/targets/site-contract.js +124 -0
- package/dist/state/content-source.d.ts +17 -0
- package/dist/state/content-source.js +1 -0
- package/dist/state/in-memory-content-source.d.ts +27 -0
- package/dist/state/in-memory-content-source.js +51 -0
- package/dist/state/session-lock.d.ts +13 -0
- package/dist/state/session-lock.js +29 -0
- package/dist/state/session-state.d.ts +310 -0
- package/dist/state/session-state.js +1083 -0
- package/dist/state/sqlite-store-singleton.d.ts +31 -0
- package/dist/state/sqlite-store-singleton.js +170 -0
- package/dist/state/sqlite-store.d.ts +135 -0
- package/dist/state/sqlite-store.js +421 -0
- package/dist/telemetry/chat-telemetry.d.ts +105 -0
- package/dist/telemetry/chat-telemetry.js +247 -0
- package/dist/telemetry/eval-candidate-store.d.ts +50 -0
- package/dist/telemetry/eval-candidate-store.js +120 -0
- package/dist/telemetry/feedback-store.d.ts +34 -0
- package/dist/telemetry/feedback-store.js +76 -0
- package/dist/telemetry/jira-telemetry.d.ts +57 -0
- package/dist/telemetry/jira-telemetry.js +68 -0
- package/dist/telemetry/migration-telemetry.d.ts +35 -0
- package/dist/telemetry/migration-telemetry.js +40 -0
- package/dist/telemetry/usage.d.ts +24 -0
- package/dist/telemetry/usage.js +80 -0
- package/dist/tools/builtin-registrations.d.ts +12 -0
- package/dist/tools/builtin-registrations.js +33 -0
- package/dist/tools/builtins/gdrive-browse.d.ts +3 -0
- package/dist/tools/builtins/gdrive-browse.js +68 -0
- package/dist/tools/builtins/image-generate.d.ts +3 -0
- package/dist/tools/builtins/image-generate.js +211 -0
- package/dist/tools/builtins/unsplash-get-by-id.d.ts +23 -0
- package/dist/tools/builtins/unsplash-get-by-id.js +119 -0
- package/dist/tools/builtins/unsplash-search.d.ts +3 -0
- package/dist/tools/builtins/unsplash-search.js +74 -0
- package/dist/tools/executor.d.ts +23 -0
- package/dist/tools/executor.js +169 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.js +5 -0
- package/dist/tools/registry.d.ts +21 -0
- package/dist/tools/registry.js +75 -0
- package/dist/tools/runtime.d.ts +27 -0
- package/dist/tools/runtime.js +48 -0
- package/dist/tools/schema-validator.d.ts +24 -0
- package/dist/tools/schema-validator.js +88 -0
- package/dist/tools/types.d.ts +86 -0
- package/dist/tools/types.js +1 -0
- package/dist/variation-images.d.ts +19 -0
- package/dist/variation-images.js +12 -0
- package/package.json +78 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Logger } from "../logger.ts";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type BlockType, type PageDoc } from "@avocadostudio-ai/shared";
|
|
4
|
+
import { type AIProvider, type ModelKey } from "../state/session-state.ts";
|
|
5
|
+
import { resolveUnsplashImage } from "../image/image-helpers.ts";
|
|
6
|
+
import type { UnsplashImage } from "../variation-images.ts";
|
|
7
|
+
export declare const variationRequestBodySchema: z.ZodObject<{
|
|
8
|
+
session: z.ZodOptional<z.ZodString>;
|
|
9
|
+
siteId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
sitePurpose: z.ZodOptional<z.ZodString>;
|
|
11
|
+
siteHosting: z.ZodOptional<z.ZodString>;
|
|
12
|
+
businessContext: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
13
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
14
|
+
tone: z.ZodOptional<z.ZodString>;
|
|
15
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
17
|
+
siteContext: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
18
|
+
siteId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
siteName: z.ZodOptional<z.ZodString>;
|
|
20
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
21
|
+
hosting: z.ZodOptional<z.ZodString>;
|
|
22
|
+
tone: z.ZodOptional<z.ZodString>;
|
|
23
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
25
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
26
|
+
message: z.ZodOptional<z.ZodString>;
|
|
27
|
+
modelKey: z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
fast: "fast";
|
|
29
|
+
balanced: "balanced";
|
|
30
|
+
reasoning: "reasoning";
|
|
31
|
+
codex: "codex";
|
|
32
|
+
}>>;
|
|
33
|
+
provider: z.ZodOptional<z.ZodEnum<{
|
|
34
|
+
openai: "openai";
|
|
35
|
+
anthropic: "anthropic";
|
|
36
|
+
gemini: "gemini";
|
|
37
|
+
}>>;
|
|
38
|
+
activeBlockId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
activeBlockType: z.ZodOptional<z.ZodString>;
|
|
40
|
+
activeEditablePath: z.ZodOptional<z.ZodString>;
|
|
41
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type VariationRequestBody = z.infer<typeof variationRequestBodySchema>;
|
|
44
|
+
export type VariationOption = {
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
summary: string;
|
|
48
|
+
patch: Record<string, unknown>;
|
|
49
|
+
changedKeys: string[];
|
|
50
|
+
};
|
|
51
|
+
export type VariationResult = {
|
|
52
|
+
status: "ok";
|
|
53
|
+
summary: string;
|
|
54
|
+
blockId: string;
|
|
55
|
+
blockType: BlockType;
|
|
56
|
+
pageSlug: string;
|
|
57
|
+
baseProps: Record<string, unknown>;
|
|
58
|
+
variations: VariationOption[];
|
|
59
|
+
suggestions?: string[];
|
|
60
|
+
plannerSource: "openai" | "anthropic" | "gemini" | "demo";
|
|
61
|
+
modelUsed: string;
|
|
62
|
+
modelKey: ModelKey;
|
|
63
|
+
usage?: {
|
|
64
|
+
inputTokens: number;
|
|
65
|
+
outputTokens: number;
|
|
66
|
+
totalTokens: number;
|
|
67
|
+
cacheCreationInputTokens?: number;
|
|
68
|
+
cacheReadInputTokens?: number;
|
|
69
|
+
estimatedUsd: number | null;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export type VariationIntent = "generate" | "regenerate" | "show";
|
|
73
|
+
export declare function getCachedVariations(session: string, blockId: string): VariationResult | null;
|
|
74
|
+
export type VariationPipelineContext = {
|
|
75
|
+
log: Logger;
|
|
76
|
+
modelLookup: Record<AIProvider, Record<ModelKey, string>>;
|
|
77
|
+
availableProviders: AIProvider[];
|
|
78
|
+
};
|
|
79
|
+
export declare function setResolveUnsplashImageForTests(fn?: typeof resolveUnsplashImage): void;
|
|
80
|
+
type GenerateVariationImageFn = (args: {
|
|
81
|
+
prompt: string;
|
|
82
|
+
altText: string;
|
|
83
|
+
}) => Promise<UnsplashImage | null>;
|
|
84
|
+
export declare function setGenerateVariationImageForTests(fn?: GenerateVariationImageFn): void;
|
|
85
|
+
export declare function parseJsonMaybe(text: string): unknown;
|
|
86
|
+
export declare function requestedVariationCount(message: string): number;
|
|
87
|
+
export declare function withDefaultImageVariations(args: {
|
|
88
|
+
block: PageDoc["blocks"][number];
|
|
89
|
+
message: string;
|
|
90
|
+
variations: VariationOption[];
|
|
91
|
+
page?: PageDoc;
|
|
92
|
+
log?: Logger;
|
|
93
|
+
}): Promise<VariationOption[]>;
|
|
94
|
+
export type VariationImageUpdate = {
|
|
95
|
+
variationId: string;
|
|
96
|
+
index: number;
|
|
97
|
+
patch: Record<string, unknown>;
|
|
98
|
+
changedKeys: string[];
|
|
99
|
+
imageUrl?: string;
|
|
100
|
+
imageAlt?: string;
|
|
101
|
+
};
|
|
102
|
+
export type StreamingVariationsPlan = {
|
|
103
|
+
initial: VariationOption[];
|
|
104
|
+
run: (onProgress: (update: VariationImageUpdate) => void) => Promise<VariationOption[]>;
|
|
105
|
+
};
|
|
106
|
+
export declare function planDefaultImageVariations(args: {
|
|
107
|
+
block: PageDoc["blocks"][number];
|
|
108
|
+
message: string;
|
|
109
|
+
variations: VariationOption[];
|
|
110
|
+
page?: PageDoc;
|
|
111
|
+
log?: Logger;
|
|
112
|
+
}): StreamingVariationsPlan;
|
|
113
|
+
export declare function runVariationPipeline(ctx: VariationPipelineContext, body: VariationRequestBody, options?: {
|
|
114
|
+
intent?: VariationIntent;
|
|
115
|
+
}): Promise<{
|
|
116
|
+
code: number;
|
|
117
|
+
payload: VariationResult | {
|
|
118
|
+
error: string;
|
|
119
|
+
};
|
|
120
|
+
}>;
|
|
121
|
+
export type VariationStreamPipelineHooks = {
|
|
122
|
+
onInitial: (result: VariationResult & {
|
|
123
|
+
imagesPending: boolean;
|
|
124
|
+
}) => void;
|
|
125
|
+
onImageResolved: (update: VariationImageUpdate) => void;
|
|
126
|
+
};
|
|
127
|
+
export declare function runVariationPipelineStreaming(ctx: VariationPipelineContext, body: VariationRequestBody, hooks: VariationStreamPipelineHooks, options?: {
|
|
128
|
+
intent?: VariationIntent;
|
|
129
|
+
}): Promise<{
|
|
130
|
+
code: number;
|
|
131
|
+
payload: VariationResult | {
|
|
132
|
+
error: string;
|
|
133
|
+
};
|
|
134
|
+
}>;
|
|
135
|
+
export {};
|