@wix/ditto-codegen-public 1.0.443 → 1.0.444
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/out.js +201 -53
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -11810,6 +11810,84 @@ ${closeBrace}${tail}`;
|
|
|
11810
11810
|
}
|
|
11811
11811
|
});
|
|
11812
11812
|
|
|
11813
|
+
// dist/opencode-integration/model-knobs.js
|
|
11814
|
+
var require_model_knobs = __commonJS({
|
|
11815
|
+
"dist/opencode-integration/model-knobs.js"(exports2) {
|
|
11816
|
+
"use strict";
|
|
11817
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11818
|
+
exports2.DEFAULT_SMALL_MODEL = exports2.DEFAULT_MODEL = void 0;
|
|
11819
|
+
exports2.isOpenAiModel = isOpenAiModel;
|
|
11820
|
+
exports2.getModel = getModel;
|
|
11821
|
+
exports2.getSmallModel = getSmallModel;
|
|
11822
|
+
exports2.hasModelOverride = hasModelOverride;
|
|
11823
|
+
exports2.getReasoningEffort = getReasoningEffort;
|
|
11824
|
+
exports2.getSmallReasoningEffort = getSmallReasoningEffort;
|
|
11825
|
+
exports2.hasSmallReasoningEffortOverride = hasSmallReasoningEffortOverride;
|
|
11826
|
+
exports2.getOpenAiServiceTier = getOpenAiServiceTier;
|
|
11827
|
+
exports2.DEFAULT_MODEL = "anthropic/claude-sonnet-4-6";
|
|
11828
|
+
exports2.DEFAULT_SMALL_MODEL = "anthropic/claude-haiku-4-5-20251001";
|
|
11829
|
+
var SMALL_MODEL_REASONING_EFFORT = "medium";
|
|
11830
|
+
var REASONING_EFFORTS = ["xhigh", "high", "medium", "low"];
|
|
11831
|
+
var VALID_OPENAI_SERVICE_TIERS = [
|
|
11832
|
+
"auto",
|
|
11833
|
+
"default",
|
|
11834
|
+
"flex",
|
|
11835
|
+
"priority"
|
|
11836
|
+
];
|
|
11837
|
+
function isOpenAiModel(model) {
|
|
11838
|
+
return model.startsWith("openai/");
|
|
11839
|
+
}
|
|
11840
|
+
function getModel() {
|
|
11841
|
+
return process.env.CODEGEN_MODEL_OVERRIDE || exports2.DEFAULT_MODEL;
|
|
11842
|
+
}
|
|
11843
|
+
function getSmallModel() {
|
|
11844
|
+
return process.env.CODEGEN_SMALL_MODEL_OVERRIDE || exports2.DEFAULT_SMALL_MODEL;
|
|
11845
|
+
}
|
|
11846
|
+
function hasModelOverride() {
|
|
11847
|
+
return !!process.env.CODEGEN_MODEL_OVERRIDE;
|
|
11848
|
+
}
|
|
11849
|
+
function readEnumEnv(name, allowed) {
|
|
11850
|
+
const value = process.env[name];
|
|
11851
|
+
if (!value)
|
|
11852
|
+
return void 0;
|
|
11853
|
+
if (!allowed.includes(value)) {
|
|
11854
|
+
throw new Error(`Unsupported ${name}: ${value} (expected one of ${allowed.join(", ")})`);
|
|
11855
|
+
}
|
|
11856
|
+
return value;
|
|
11857
|
+
}
|
|
11858
|
+
function getReasoningEffort() {
|
|
11859
|
+
const effort = readEnumEnv("CODEGEN_REASONING_EFFORT", REASONING_EFFORTS);
|
|
11860
|
+
if (!effort)
|
|
11861
|
+
return void 0;
|
|
11862
|
+
if (!isOpenAiModel(getModel()) || !isOpenAiModel(getSmallModel())) {
|
|
11863
|
+
throw new Error("CODEGEN_REASONING_EFFORT requires BOTH the main and small models to be openai/* \u2014 set CODEGEN_MODEL_OVERRIDE and CODEGEN_SMALL_MODEL_OVERRIDE (reasoning-effort variants are invalid on Anthropic models).");
|
|
11864
|
+
}
|
|
11865
|
+
return effort;
|
|
11866
|
+
}
|
|
11867
|
+
function getSmallReasoningEffort() {
|
|
11868
|
+
const effort = readEnumEnv("CODEGEN_SMALL_MODEL_REASONING_EFFORT", REASONING_EFFORTS);
|
|
11869
|
+
if (!effort)
|
|
11870
|
+
return SMALL_MODEL_REASONING_EFFORT;
|
|
11871
|
+
if (!isOpenAiModel(getSmallModel())) {
|
|
11872
|
+
throw new Error("CODEGEN_SMALL_MODEL_REASONING_EFFORT requires the small model to be openai/* \u2014 set CODEGEN_SMALL_MODEL_OVERRIDE (reasoning-effort variants are invalid on Anthropic models).");
|
|
11873
|
+
}
|
|
11874
|
+
return effort;
|
|
11875
|
+
}
|
|
11876
|
+
function hasSmallReasoningEffortOverride() {
|
|
11877
|
+
return !!process.env.CODEGEN_SMALL_MODEL_REASONING_EFFORT;
|
|
11878
|
+
}
|
|
11879
|
+
function getOpenAiServiceTier() {
|
|
11880
|
+
const tier = readEnumEnv("CODEGEN_OPENAI_SERVICE_TIER", VALID_OPENAI_SERVICE_TIERS);
|
|
11881
|
+
if (!tier)
|
|
11882
|
+
return void 0;
|
|
11883
|
+
if (!isOpenAiModel(getModel()) && !isOpenAiModel(getSmallModel())) {
|
|
11884
|
+
throw new Error("CODEGEN_OPENAI_SERVICE_TIER requires the main or small model to be openai/* \u2014 set CODEGEN_MODEL_OVERRIDE and/or CODEGEN_SMALL_MODEL_OVERRIDE (serviceTier applies only to openai models).");
|
|
11885
|
+
}
|
|
11886
|
+
return tier;
|
|
11887
|
+
}
|
|
11888
|
+
}
|
|
11889
|
+
});
|
|
11890
|
+
|
|
11813
11891
|
// dist/opencode-integration/types.js
|
|
11814
11892
|
var require_types4 = __commonJS({
|
|
11815
11893
|
"dist/opencode-integration/types.js"(exports2) {
|
|
@@ -11828,15 +11906,18 @@ var require_types4 = __commonJS({
|
|
|
11828
11906
|
}
|
|
11829
11907
|
});
|
|
11830
11908
|
|
|
11831
|
-
// dist/opencode-integration/
|
|
11832
|
-
var
|
|
11833
|
-
"dist/opencode-integration/
|
|
11909
|
+
// dist/opencode-integration/agents.js
|
|
11910
|
+
var require_agents = __commonJS({
|
|
11911
|
+
"dist/opencode-integration/agents.js"(exports2) {
|
|
11834
11912
|
"use strict";
|
|
11835
11913
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11836
11914
|
exports2.SUBAGENT_AGENT_NAMES = exports2.WDS_DOCS_SUBAGENT_NAME = exports2.WIX_DOCS_SUBAGENT_NAME = exports2.VALIDATOR_SUBAGENT_NAME = exports2.PRIMARY_AGENT_NAME = void 0;
|
|
11837
11915
|
exports2.getAgentConfig = getAgentConfig;
|
|
11916
|
+
exports2.getMainAgentModel = getMainAgentModel;
|
|
11917
|
+
exports2.getSubagentModel = getSubagentModel;
|
|
11838
11918
|
var types_1 = require_types4();
|
|
11839
11919
|
var constants_1 = require_constants5();
|
|
11920
|
+
var model_knobs_1 = require_model_knobs();
|
|
11840
11921
|
exports2.PRIMARY_AGENT_NAME = "codegen";
|
|
11841
11922
|
exports2.VALIDATOR_SUBAGENT_NAME = "codegen-validator";
|
|
11842
11923
|
exports2.WIX_DOCS_SUBAGENT_NAME = "codegen-wix-docs";
|
|
@@ -11986,10 +12067,26 @@ skills already cover. Read-only.`;
|
|
|
11986
12067
|
/* OpenCodeTool.BatchWrite */
|
|
11987
12068
|
]: "allow"
|
|
11988
12069
|
};
|
|
11989
|
-
|
|
12070
|
+
var MODEL_VARIANTS = {
|
|
12071
|
+
"openai/gpt-5.6-luna": ["xhigh", "high", "medium", "low"],
|
|
12072
|
+
"openai/gpt-5.6-sol": ["xhigh", "high", "medium", "low"],
|
|
12073
|
+
"openai/gpt-5.6-terra": ["xhigh", "high", "medium", "low"]
|
|
12074
|
+
};
|
|
12075
|
+
function agentModel(model, opts = {}) {
|
|
12076
|
+
if (opts.variant && !MODEL_VARIANTS[model]?.includes(opts.variant)) {
|
|
12077
|
+
throw new Error(`Model ${model} does not support reasoning variant "${opts.variant}"`);
|
|
12078
|
+
}
|
|
12079
|
+
return {
|
|
12080
|
+
model,
|
|
12081
|
+
...opts.variant ? { variant: opts.variant } : {},
|
|
12082
|
+
...opts.options ? { options: opts.options } : {}
|
|
12083
|
+
};
|
|
12084
|
+
}
|
|
12085
|
+
function getAgentConfig(main2, subagent) {
|
|
11990
12086
|
return {
|
|
11991
12087
|
[exports2.PRIMARY_AGENT_NAME]: {
|
|
11992
12088
|
mode: "primary",
|
|
12089
|
+
...main2 ?? {},
|
|
11993
12090
|
permission: {
|
|
11994
12091
|
[
|
|
11995
12092
|
"task"
|
|
@@ -12004,7 +12101,7 @@ skills already cover. Read-only.`;
|
|
|
12004
12101
|
},
|
|
12005
12102
|
[exports2.VALIDATOR_SUBAGENT_NAME]: {
|
|
12006
12103
|
mode: "subagent",
|
|
12007
|
-
|
|
12104
|
+
...subagent,
|
|
12008
12105
|
steps: 80,
|
|
12009
12106
|
description: VALIDATOR_DESCRIPTION,
|
|
12010
12107
|
prompt: VALIDATOR_PROMPT,
|
|
@@ -12030,7 +12127,7 @@ skills already cover. Read-only.`;
|
|
|
12030
12127
|
},
|
|
12031
12128
|
[exports2.WIX_DOCS_SUBAGENT_NAME]: {
|
|
12032
12129
|
mode: "subagent",
|
|
12033
|
-
|
|
12130
|
+
...subagent,
|
|
12034
12131
|
steps: 15,
|
|
12035
12132
|
description: WIX_DOCS_DESCRIPTION,
|
|
12036
12133
|
prompt: WIX_DOCS_PROMPT,
|
|
@@ -12050,7 +12147,7 @@ skills already cover. Read-only.`;
|
|
|
12050
12147
|
},
|
|
12051
12148
|
[exports2.WDS_DOCS_SUBAGENT_NAME]: {
|
|
12052
12149
|
mode: "subagent",
|
|
12053
|
-
|
|
12150
|
+
...subagent,
|
|
12054
12151
|
steps: 15,
|
|
12055
12152
|
description: WDS_DOCS_DESCRIPTION,
|
|
12056
12153
|
permission: {
|
|
@@ -12070,6 +12167,29 @@ skills already cover. Read-only.`;
|
|
|
12070
12167
|
}
|
|
12071
12168
|
};
|
|
12072
12169
|
}
|
|
12170
|
+
function serviceTierOptions(model) {
|
|
12171
|
+
const tier = (0, model_knobs_1.getOpenAiServiceTier)();
|
|
12172
|
+
return tier && (0, model_knobs_1.isOpenAiModel)(model) ? { serviceTier: tier } : void 0;
|
|
12173
|
+
}
|
|
12174
|
+
function getMainAgentModel() {
|
|
12175
|
+
const effort = (0, model_knobs_1.getReasoningEffort)();
|
|
12176
|
+
const options = serviceTierOptions((0, model_knobs_1.getModel)());
|
|
12177
|
+
if (!effort && !options && !(0, model_knobs_1.hasModelOverride)())
|
|
12178
|
+
return void 0;
|
|
12179
|
+
return agentModel((0, model_knobs_1.getModel)(), {
|
|
12180
|
+
...effort ? { variant: effort } : {},
|
|
12181
|
+
...options ? { options } : {}
|
|
12182
|
+
});
|
|
12183
|
+
}
|
|
12184
|
+
function getSubagentModel() {
|
|
12185
|
+
const hasEffort = Boolean((0, model_knobs_1.getReasoningEffort)()) || (0, model_knobs_1.hasSmallReasoningEffortOverride)();
|
|
12186
|
+
const effort = hasEffort ? (0, model_knobs_1.getSmallReasoningEffort)() : void 0;
|
|
12187
|
+
const options = serviceTierOptions((0, model_knobs_1.getSmallModel)());
|
|
12188
|
+
return agentModel((0, model_knobs_1.getSmallModel)(), {
|
|
12189
|
+
...effort ? { variant: effort } : {},
|
|
12190
|
+
...options ? { options } : {}
|
|
12191
|
+
});
|
|
12192
|
+
}
|
|
12073
12193
|
}
|
|
12074
12194
|
});
|
|
12075
12195
|
|
|
@@ -15378,7 +15498,7 @@ MINIMIZE TEXT OUTPUT \u2014 CRITICAL:
|
|
|
15378
15498
|
|
|
15379
15499
|
TOOL USAGE:
|
|
15380
15500
|
- \`validate\` (tsc + build) is run by the \`codegen-validator\` subagent \u2014 do NOT call it directly; delegate via \`task\` at step 5.
|
|
15381
|
-
- \`task\` delegates to
|
|
15501
|
+
- \`task\` delegates to subagents: \`codegen-validator\` (step 5; see step 5 for the exact prompt), \`codegen-wix-docs\` (step 2; to SEARCH/discover an unknown Wix SDK method/shape/scope ID via wix-mcp), \`codegen-wds-docs\` (step 2; to discover WDS components/props you don't know). Docs subagents are for DISCOVERY only \u2014 give them a QUESTION ("which method lists X?"), never a known article URL to fetch.
|
|
15382
15502
|
- Each \`task\` round-trip is EXPENSIVE (~90s of subagent startup, regardless of how small the question). So minimize them: ask ONE comprehensive question per API that returns everything you need at once \u2014 method name + FULL call signature + parameter shapes + required scope IDs. NEVER do a broad "find the X SDK" call and then a follow-up "what's the exact signature" call \u2014 that is two ~90s round-trips for one answer. Batch all your unknowns for a domain into a single delegation.
|
|
15383
15503
|
- If BOTH docs subagents are needed, fire both \`task\` calls in ONE response (parallel), never serially.
|
|
15384
15504
|
- \`uuid\` to generate UUIDs (supports count param for multiple). Do NOT use bash.
|
|
@@ -15680,25 +15800,31 @@ var require_config = __commonJS({
|
|
|
15680
15800
|
"dist/opencode-integration/config.js"(exports2) {
|
|
15681
15801
|
"use strict";
|
|
15682
15802
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15683
|
-
exports2.
|
|
15803
|
+
exports2.DEFAULT_TIMEOUT_MS = void 0;
|
|
15684
15804
|
exports2.getAnthropicBaseUrl = getAnthropicBaseUrl;
|
|
15805
|
+
exports2.getOpenAiBaseUrl = getOpenAiBaseUrl;
|
|
15685
15806
|
exports2.setCurrentAccessToken = setCurrentAccessToken;
|
|
15686
15807
|
exports2.getCurrentAccessToken = getCurrentAccessToken;
|
|
15687
15808
|
exports2.getOpenCodeEnv = getOpenCodeEnv;
|
|
15688
15809
|
var os_1 = require("os");
|
|
15689
15810
|
var ditto_codegen_types_12 = require_dist4();
|
|
15690
15811
|
var constants_1 = require_constants5();
|
|
15691
|
-
var
|
|
15812
|
+
var model_knobs_1 = require_model_knobs();
|
|
15813
|
+
var agents_1 = require_agents();
|
|
15692
15814
|
var rules_writer_12 = require_rules_writer();
|
|
15693
15815
|
var environments_12 = require_environments();
|
|
15694
15816
|
var CodeGenService_12 = require_CodeGenService();
|
|
15695
15817
|
exports2.DEFAULT_TIMEOUT_MS = 20 * 60 * 1e3;
|
|
15696
|
-
|
|
15697
|
-
|
|
15818
|
+
function usesOpenAiProvider() {
|
|
15819
|
+
return (0, model_knobs_1.isOpenAiModel)((0, model_knobs_1.getModel)()) || (0, model_knobs_1.isOpenAiModel)((0, model_knobs_1.getSmallModel)());
|
|
15820
|
+
}
|
|
15698
15821
|
var AI_PROXY_BASE_URL = process.env.CODEGEN_AI_PROXY_BASE_URL || "http://localhost:3001";
|
|
15699
15822
|
function getAnthropicBaseUrl(projectId) {
|
|
15700
15823
|
return `${AI_PROXY_BASE_URL}/projects/${projectId}/genai/anthropic`;
|
|
15701
15824
|
}
|
|
15825
|
+
function getOpenAiBaseUrl(projectId) {
|
|
15826
|
+
return `${AI_PROXY_BASE_URL}/projects/${projectId}/genai/openai`;
|
|
15827
|
+
}
|
|
15702
15828
|
var currentAccessToken = process.env.WIX_ACCESS_TOKEN;
|
|
15703
15829
|
function setCurrentAccessToken(token) {
|
|
15704
15830
|
currentAccessToken = token;
|
|
@@ -15713,7 +15839,7 @@ var require_config = __commonJS({
|
|
|
15713
15839
|
".git/**",
|
|
15714
15840
|
".astro/**"
|
|
15715
15841
|
];
|
|
15716
|
-
function getProviderConfig() {
|
|
15842
|
+
function getProviderConfig(projectId) {
|
|
15717
15843
|
const environment = (0, environments_12.getValidatedCodegenEnvironment)();
|
|
15718
15844
|
const chargingMode = (0, environments_12.getCodegenEnvironmentConfig)().chargingMode ?? "app";
|
|
15719
15845
|
const headers = {
|
|
@@ -15726,7 +15852,7 @@ var require_config = __commonJS({
|
|
|
15726
15852
|
// authorize the project.
|
|
15727
15853
|
...currentAccessToken ? { Authorization: `Bearer ${currentAccessToken}` } : {}
|
|
15728
15854
|
};
|
|
15729
|
-
|
|
15855
|
+
const provider = {
|
|
15730
15856
|
anthropic: {
|
|
15731
15857
|
options: {
|
|
15732
15858
|
apiKey: "proxy-handled",
|
|
@@ -15735,6 +15861,19 @@ var require_config = __commonJS({
|
|
|
15735
15861
|
}
|
|
15736
15862
|
}
|
|
15737
15863
|
};
|
|
15864
|
+
if (usesOpenAiProvider()) {
|
|
15865
|
+
provider.openai = {
|
|
15866
|
+
options: {
|
|
15867
|
+
// Load-bearing: @ai-sdk/openai turns this into `Authorization: Bearer
|
|
15868
|
+
// proxy-handled`; only the headers-spread order lets the Wix token win, so
|
|
15869
|
+
// don't "clean up" apiKey — removing it 403s every openai request.
|
|
15870
|
+
apiKey: "proxy-handled",
|
|
15871
|
+
baseURL: getOpenAiBaseUrl(projectId),
|
|
15872
|
+
headers
|
|
15873
|
+
}
|
|
15874
|
+
};
|
|
15875
|
+
}
|
|
15876
|
+
return provider;
|
|
15738
15877
|
}
|
|
15739
15878
|
var WIX_MCP_CONFIG = {
|
|
15740
15879
|
[constants_1.WIX_MCP_SERVER_NAME]: {
|
|
@@ -15827,11 +15966,13 @@ var require_config = __commonJS({
|
|
|
15827
15966
|
]: "deny",
|
|
15828
15967
|
external_directory: READABLE_EXTERNAL_DIRS
|
|
15829
15968
|
};
|
|
15830
|
-
function buildConfig(instructionPaths, permission, { isCodeWritingFlow = false, withAgents = false } = {}) {
|
|
15969
|
+
function buildConfig(projectId, instructionPaths, permission, { isCodeWritingFlow = false, withAgents = false } = {}) {
|
|
15970
|
+
const main2 = (0, agents_1.getMainAgentModel)();
|
|
15971
|
+
const subagent = (0, agents_1.getSubagentModel)();
|
|
15831
15972
|
return {
|
|
15832
|
-
model:
|
|
15833
|
-
small_model:
|
|
15834
|
-
provider: getProviderConfig(),
|
|
15973
|
+
model: (0, model_knobs_1.getModel)(),
|
|
15974
|
+
small_model: (0, model_knobs_1.getSmallModel)(),
|
|
15975
|
+
provider: getProviderConfig(projectId),
|
|
15835
15976
|
compaction: { prune: true },
|
|
15836
15977
|
// drop old tool outputs so --continue replays stay bounded
|
|
15837
15978
|
permission,
|
|
@@ -15844,8 +15985,8 @@ var require_config = __commonJS({
|
|
|
15844
15985
|
// not: its primary agent re-opens `task`, which would let the write-capable
|
|
15845
15986
|
// validator subagent run in a flow meant to stay read-only.
|
|
15846
15987
|
...withAgents ? {
|
|
15847
|
-
agent: (0,
|
|
15848
|
-
default_agent:
|
|
15988
|
+
agent: (0, agents_1.getAgentConfig)(main2, subagent),
|
|
15989
|
+
default_agent: agents_1.PRIMARY_AGENT_NAME
|
|
15849
15990
|
} : {}
|
|
15850
15991
|
};
|
|
15851
15992
|
}
|
|
@@ -15863,6 +16004,9 @@ var require_config = __commonJS({
|
|
|
15863
16004
|
...process.env,
|
|
15864
16005
|
PATH: ensureOpenCodeInPath(),
|
|
15865
16006
|
ANTHROPIC_BASE_URL: anthropicBaseUrl,
|
|
16007
|
+
// The provider block sets baseURL too; this also covers any AI-SDK path that
|
|
16008
|
+
// reads the env.
|
|
16009
|
+
...usesOpenAiProvider() ? { OPENAI_BASE_URL: getOpenAiBaseUrl(projectId) } : {},
|
|
15866
16010
|
OPENCODE_CONFIG_CONTENT: JSON.stringify(config),
|
|
15867
16011
|
OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: exports2.DEFAULT_TIMEOUT_MS.toString(),
|
|
15868
16012
|
OPENCODE_DISABLE_LSP_DOWNLOAD: "true",
|
|
@@ -15870,21 +16014,21 @@ var require_config = __commonJS({
|
|
|
15870
16014
|
};
|
|
15871
16015
|
}
|
|
15872
16016
|
function getOpenCodeEnv(projectId, kind) {
|
|
15873
|
-
return buildOpenCodeEnv(projectId, buildConfigForKind(kind));
|
|
16017
|
+
return buildOpenCodeEnv(projectId, buildConfigForKind(projectId, kind));
|
|
15874
16018
|
}
|
|
15875
|
-
function buildConfigForKind(kind) {
|
|
16019
|
+
function buildConfigForKind(projectId, kind) {
|
|
15876
16020
|
const env = (0, environments_12.getCodegenEnvironmentConfig)();
|
|
15877
16021
|
const paths = (rules) => rules.map((r) => (0, rules_writer_12.getRulePath)(r.filename));
|
|
15878
16022
|
switch (kind) {
|
|
15879
16023
|
case CodeGenService_12.TaskKind.ASK_CODEGEN:
|
|
15880
|
-
return buildConfig(paths(env.askRules), ASK_PERMISSIONS);
|
|
16024
|
+
return buildConfig(projectId, paths(env.askRules), ASK_PERMISSIONS);
|
|
15881
16025
|
case CodeGenService_12.TaskKind.FIX_GIT_CONFLICTS:
|
|
15882
|
-
return buildConfig(paths(env.gitConflictsRules), GIT_CONFLICTS_PERMISSIONS, {
|
|
16026
|
+
return buildConfig(projectId, paths(env.gitConflictsRules), GIT_CONFLICTS_PERMISSIONS, {
|
|
15883
16027
|
isCodeWritingFlow: true,
|
|
15884
16028
|
withAgents: true
|
|
15885
16029
|
});
|
|
15886
16030
|
default:
|
|
15887
|
-
return buildConfig(paths(env.codegenRules), CODEGEN_PERMISSIONS, {
|
|
16031
|
+
return buildConfig(projectId, paths(env.codegenRules), CODEGEN_PERMISSIONS, {
|
|
15888
16032
|
isCodeWritingFlow: true,
|
|
15889
16033
|
withAgents: true
|
|
15890
16034
|
});
|
|
@@ -15922,7 +16066,7 @@ var require_subagent_tool_logger = __commonJS({
|
|
|
15922
16066
|
exports2.buildSubagentToolLoggerPluginSource = buildSubagentToolLoggerPluginSource;
|
|
15923
16067
|
exports2.writeSubagentToolLoggerPlugin = writeSubagentToolLoggerPlugin;
|
|
15924
16068
|
var generated_plugins_1 = require_generated_plugins();
|
|
15925
|
-
var
|
|
16069
|
+
var agents_1 = require_agents();
|
|
15926
16070
|
exports2.SUBAGENT_TOOL_EVENT_TYPE = "subagent_tool_use";
|
|
15927
16071
|
exports2.SUBAGENT_STARTED_EVENT_TYPE = "subagent_started";
|
|
15928
16072
|
var PLUGIN_FILENAME = "subagent-tool-logger.ts";
|
|
@@ -15930,7 +16074,7 @@ var require_subagent_tool_logger = __commonJS({
|
|
|
15930
16074
|
return `// Generated by @wix/ditto-codegen (subagent-tool-logger) \u2014 do not edit.
|
|
15931
16075
|
const EVENT_TYPE = ${JSON.stringify(exports2.SUBAGENT_TOOL_EVENT_TYPE)};
|
|
15932
16076
|
const STARTED_EVENT_TYPE = ${JSON.stringify(exports2.SUBAGENT_STARTED_EVENT_TYPE)};
|
|
15933
|
-
const SUBAGENT_AGENTS = new Set(${JSON.stringify(
|
|
16077
|
+
const SUBAGENT_AGENTS = new Set(${JSON.stringify(agents_1.SUBAGENT_AGENT_NAMES)});
|
|
15934
16078
|
|
|
15935
16079
|
export const SubagentToolLogger = async () => {
|
|
15936
16080
|
// sessionID -> agent name, learned from session.* / message.updated (both
|
|
@@ -16060,7 +16204,7 @@ var require_parser = __commonJS({
|
|
|
16060
16204
|
exports2.parseValidatorTaskOutputs = parseValidatorTaskOutputs;
|
|
16061
16205
|
exports2.summarizeOpenCodeLine = summarizeOpenCodeLine;
|
|
16062
16206
|
var types_1 = require_types4();
|
|
16063
|
-
var
|
|
16207
|
+
var agents_1 = require_agents();
|
|
16064
16208
|
var subagent_tool_logger_12 = require_subagent_tool_logger();
|
|
16065
16209
|
function parseRequiredPermissions(output) {
|
|
16066
16210
|
let permissions = [];
|
|
@@ -16204,7 +16348,7 @@ var require_parser = __commonJS({
|
|
|
16204
16348
|
continue;
|
|
16205
16349
|
}
|
|
16206
16350
|
const { title, output, input } = event.part.state;
|
|
16207
|
-
const isValidator = input?.subagent_type ===
|
|
16351
|
+
const isValidator = input?.subagent_type === agents_1.VALIDATOR_SUBAGENT_NAME || title?.includes(agents_1.VALIDATOR_SUBAGENT_NAME);
|
|
16208
16352
|
if (isValidator && output) {
|
|
16209
16353
|
outputs.push(output.trim());
|
|
16210
16354
|
}
|
|
@@ -16458,11 +16602,11 @@ var require_derived_progress = __commonJS({
|
|
|
16458
16602
|
exports2.deriveProgressSteps = deriveProgressSteps;
|
|
16459
16603
|
var ditto_codegen_types_12 = require_dist4();
|
|
16460
16604
|
var constants_1 = require_constants5();
|
|
16461
|
-
var
|
|
16605
|
+
var agents_1 = require_agents();
|
|
16462
16606
|
var SUBAGENT_STEPS = {
|
|
16463
|
-
[
|
|
16464
|
-
[
|
|
16465
|
-
[
|
|
16607
|
+
[agents_1.VALIDATOR_SUBAGENT_NAME]: "Building project",
|
|
16608
|
+
[agents_1.WIX_DOCS_SUBAGENT_NAME]: "Reading documentation",
|
|
16609
|
+
[agents_1.WDS_DOCS_SUBAGENT_NAME]: "Reading documentation"
|
|
16466
16610
|
};
|
|
16467
16611
|
var REGISTRY_FILE_PATTERN = /(^|\/)extensions\.ts$/;
|
|
16468
16612
|
var EXTENSION_DEFINITION_PATTERN = /\.extension\.ts$/;
|
|
@@ -22830,7 +22974,7 @@ var require_opencode_init = __commonJS({
|
|
|
22830
22974
|
var types_1 = require_types_impl();
|
|
22831
22975
|
var context_12 = require_context();
|
|
22832
22976
|
var logger_12 = require_logger();
|
|
22833
|
-
var
|
|
22977
|
+
var model_knobs_1 = require_model_knobs();
|
|
22834
22978
|
var git_file_changes_1 = require_git_file_changes();
|
|
22835
22979
|
var inject_created_by_1 = require_inject_created_by();
|
|
22836
22980
|
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
@@ -22850,6 +22994,7 @@ var require_opencode_init = __commonJS({
|
|
|
22850
22994
|
const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
|
|
22851
22995
|
const flowStartTime = Date.now();
|
|
22852
22996
|
store.flowStartTime = flowStartTime;
|
|
22997
|
+
const taskModel = (0, model_knobs_1.getModel)();
|
|
22853
22998
|
const biBase = {
|
|
22854
22999
|
jobId,
|
|
22855
23000
|
taskId,
|
|
@@ -22864,7 +23009,7 @@ var require_opencode_init = __commonJS({
|
|
|
22864
23009
|
logger_12.logger.info("[OpenCode Init] Marked task RUNNING", { taskId });
|
|
22865
23010
|
await (0, biEvents_1.reportSessionStart)({
|
|
22866
23011
|
...biBase,
|
|
22867
|
-
taskModel
|
|
23012
|
+
taskModel,
|
|
22868
23013
|
taskType: kind,
|
|
22869
23014
|
jobInput: userInput
|
|
22870
23015
|
});
|
|
@@ -22918,7 +23063,7 @@ var require_opencode_init = __commonJS({
|
|
|
22918
23063
|
}
|
|
22919
23064
|
await (0, biEvents_1.reportSessionEnd)({
|
|
22920
23065
|
...biBase,
|
|
22921
|
-
taskModel
|
|
23066
|
+
taskModel,
|
|
22922
23067
|
taskType: kind,
|
|
22923
23068
|
taskCost: Math.round(result.usage.cost * 1e6),
|
|
22924
23069
|
taskStatus: ditto_codegen_types_12.Status.COMPLETED,
|
|
@@ -22937,7 +23082,7 @@ var require_opencode_init = __commonJS({
|
|
|
22937
23082
|
const taskCost = orchestrator.lastUsage ? Math.round(orchestrator.lastUsage.cost * 1e6) : void 0;
|
|
22938
23083
|
await (0, biEvents_1.reportSessionEnd)({
|
|
22939
23084
|
...biBase,
|
|
22940
|
-
taskModel
|
|
23085
|
+
taskModel,
|
|
22941
23086
|
taskType: kind,
|
|
22942
23087
|
taskCost,
|
|
22943
23088
|
taskStatus: ditto_codegen_types_12.Status.FAILED,
|
|
@@ -22946,7 +23091,7 @@ var require_opencode_init = __commonJS({
|
|
|
22946
23091
|
});
|
|
22947
23092
|
await (0, biEvents_1.reportSessionError)({
|
|
22948
23093
|
...biBase,
|
|
22949
|
-
taskModel
|
|
23094
|
+
taskModel,
|
|
22950
23095
|
taskType: kind,
|
|
22951
23096
|
agentOutput: JSON.stringify(codegenError),
|
|
22952
23097
|
errorDesc: codegenError.errorType,
|
|
@@ -23039,7 +23184,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
23039
23184
|
var ditto_codegen_types_2 = require_dist4();
|
|
23040
23185
|
var context_12 = require_context();
|
|
23041
23186
|
var logger_12 = require_logger();
|
|
23042
|
-
var
|
|
23187
|
+
var model_knobs_1 = require_model_knobs();
|
|
23043
23188
|
var git_file_changes_1 = require_git_file_changes();
|
|
23044
23189
|
var inject_created_by_1 = require_inject_created_by();
|
|
23045
23190
|
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
@@ -23057,6 +23202,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
23057
23202
|
const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
|
|
23058
23203
|
const flowStartTime = Date.now();
|
|
23059
23204
|
store.flowStartTime = flowStartTime;
|
|
23205
|
+
const taskModel = (0, model_knobs_1.getModel)();
|
|
23060
23206
|
const biBase = {
|
|
23061
23207
|
jobId,
|
|
23062
23208
|
taskId,
|
|
@@ -23071,7 +23217,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
23071
23217
|
logger_12.logger.info("[OpenCode Iterate] Marked task RUNNING", { taskId });
|
|
23072
23218
|
await (0, biEvents_1.reportSessionStart)({
|
|
23073
23219
|
...biBase,
|
|
23074
|
-
taskModel
|
|
23220
|
+
taskModel,
|
|
23075
23221
|
taskType: kind,
|
|
23076
23222
|
jobInput: userInput
|
|
23077
23223
|
});
|
|
@@ -23115,7 +23261,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
23115
23261
|
});
|
|
23116
23262
|
await (0, biEvents_1.reportSessionEnd)({
|
|
23117
23263
|
...biBase,
|
|
23118
|
-
taskModel
|
|
23264
|
+
taskModel,
|
|
23119
23265
|
taskType: kind,
|
|
23120
23266
|
taskCost: Math.round(result.usage.cost * 1e6),
|
|
23121
23267
|
taskStatus: ditto_codegen_types_12.Status.COMPLETED,
|
|
@@ -23134,7 +23280,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
23134
23280
|
const taskCost = iterationOrchestrator.lastUsage ? Math.round(iterationOrchestrator.lastUsage.cost * 1e6) : void 0;
|
|
23135
23281
|
await (0, biEvents_1.reportSessionEnd)({
|
|
23136
23282
|
...biBase,
|
|
23137
|
-
taskModel
|
|
23283
|
+
taskModel,
|
|
23138
23284
|
taskType: kind,
|
|
23139
23285
|
taskCost,
|
|
23140
23286
|
taskStatus: ditto_codegen_types_12.Status.FAILED,
|
|
@@ -23143,7 +23289,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
23143
23289
|
});
|
|
23144
23290
|
await (0, biEvents_1.reportSessionError)({
|
|
23145
23291
|
...biBase,
|
|
23146
|
-
taskModel
|
|
23292
|
+
taskModel,
|
|
23147
23293
|
taskType: kind,
|
|
23148
23294
|
agentOutput: JSON.stringify(codegenError),
|
|
23149
23295
|
errorDesc: codegenError.errorType,
|
|
@@ -23233,7 +23379,7 @@ var require_opencode_ask = __commonJS({
|
|
|
23233
23379
|
var ditto_codegen_types_2 = require_dist4();
|
|
23234
23380
|
var context_12 = require_context();
|
|
23235
23381
|
var logger_12 = require_logger();
|
|
23236
|
-
var
|
|
23382
|
+
var model_knobs_1 = require_model_knobs();
|
|
23237
23383
|
var git_file_changes_1 = require_git_file_changes();
|
|
23238
23384
|
var inject_created_by_1 = require_inject_created_by();
|
|
23239
23385
|
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
@@ -23248,6 +23394,7 @@ var require_opencode_ask = __commonJS({
|
|
|
23248
23394
|
const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
|
|
23249
23395
|
const flowStartTime = Date.now();
|
|
23250
23396
|
store.flowStartTime = flowStartTime;
|
|
23397
|
+
const taskModel = (0, model_knobs_1.getModel)();
|
|
23251
23398
|
const biBase = {
|
|
23252
23399
|
jobId,
|
|
23253
23400
|
taskId,
|
|
@@ -23262,7 +23409,7 @@ var require_opencode_ask = __commonJS({
|
|
|
23262
23409
|
logger_12.logger.info("[OpenCode Ask] Marked task RUNNING", { taskId });
|
|
23263
23410
|
await (0, biEvents_1.reportSessionStart)({
|
|
23264
23411
|
...biBase,
|
|
23265
|
-
taskModel
|
|
23412
|
+
taskModel,
|
|
23266
23413
|
taskType: kind,
|
|
23267
23414
|
jobInput: userInput
|
|
23268
23415
|
});
|
|
@@ -23293,7 +23440,7 @@ var require_opencode_ask = __commonJS({
|
|
|
23293
23440
|
});
|
|
23294
23441
|
await (0, biEvents_1.reportSessionEnd)({
|
|
23295
23442
|
...biBase,
|
|
23296
|
-
taskModel
|
|
23443
|
+
taskModel,
|
|
23297
23444
|
taskType: kind,
|
|
23298
23445
|
taskCost: Math.round(result.usage.cost * 1e6),
|
|
23299
23446
|
taskStatus: ditto_codegen_types_12.Status.COMPLETED,
|
|
@@ -23315,7 +23462,7 @@ var require_opencode_ask = __commonJS({
|
|
|
23315
23462
|
const taskCost = askOrchestrator.lastUsage ? Math.round(askOrchestrator.lastUsage.cost * 1e6) : void 0;
|
|
23316
23463
|
await (0, biEvents_1.reportSessionEnd)({
|
|
23317
23464
|
...biBase,
|
|
23318
|
-
taskModel
|
|
23465
|
+
taskModel,
|
|
23319
23466
|
taskType: kind,
|
|
23320
23467
|
taskCost,
|
|
23321
23468
|
taskStatus: ditto_codegen_types_12.Status.FAILED,
|
|
@@ -23324,7 +23471,7 @@ var require_opencode_ask = __commonJS({
|
|
|
23324
23471
|
});
|
|
23325
23472
|
await (0, biEvents_1.reportSessionError)({
|
|
23326
23473
|
...biBase,
|
|
23327
|
-
taskModel
|
|
23474
|
+
taskModel,
|
|
23328
23475
|
taskType: kind,
|
|
23329
23476
|
agentOutput: JSON.stringify(codegenError),
|
|
23330
23477
|
errorDesc: codegenError.errorType,
|
|
@@ -23413,7 +23560,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
|
|
|
23413
23560
|
var codegen_flow_helpers_12 = require_codegen_flow_helpers();
|
|
23414
23561
|
var context_12 = require_context();
|
|
23415
23562
|
var logger_12 = require_logger();
|
|
23416
|
-
var
|
|
23563
|
+
var model_knobs_1 = require_model_knobs();
|
|
23417
23564
|
var git_file_changes_1 = require_git_file_changes();
|
|
23418
23565
|
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
23419
23566
|
var executor_1 = require_executor();
|
|
@@ -23430,6 +23577,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
|
|
|
23430
23577
|
const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
|
|
23431
23578
|
const flowStartTime = Date.now();
|
|
23432
23579
|
store.flowStartTime = flowStartTime;
|
|
23580
|
+
const taskModel = (0, model_knobs_1.getModel)();
|
|
23433
23581
|
const biBase = {
|
|
23434
23582
|
jobId,
|
|
23435
23583
|
taskId,
|
|
@@ -23444,7 +23592,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
|
|
|
23444
23592
|
logger_12.logger.info("[OpenCode Git Conflicts] Marked task RUNNING", { taskId });
|
|
23445
23593
|
await (0, biEvents_1.reportSessionStart)({
|
|
23446
23594
|
...biBase,
|
|
23447
|
-
taskModel
|
|
23595
|
+
taskModel,
|
|
23448
23596
|
taskType: kind
|
|
23449
23597
|
});
|
|
23450
23598
|
const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
|
|
@@ -23483,7 +23631,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
|
|
|
23483
23631
|
});
|
|
23484
23632
|
await (0, biEvents_1.reportSessionEnd)({
|
|
23485
23633
|
...biBase,
|
|
23486
|
-
taskModel
|
|
23634
|
+
taskModel,
|
|
23487
23635
|
taskType: kind,
|
|
23488
23636
|
taskCost: Math.round(result.usage.cost * 1e6),
|
|
23489
23637
|
taskStatus: ditto_codegen_types_12.Status.COMPLETED,
|
|
@@ -23507,7 +23655,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
|
|
|
23507
23655
|
const taskCost = orchestrator.lastUsage ? Math.round(orchestrator.lastUsage.cost * 1e6) : void 0;
|
|
23508
23656
|
await (0, biEvents_1.reportSessionEnd)({
|
|
23509
23657
|
...biBase,
|
|
23510
|
-
taskModel
|
|
23658
|
+
taskModel,
|
|
23511
23659
|
taskType: kind,
|
|
23512
23660
|
taskCost,
|
|
23513
23661
|
taskStatus: ditto_codegen_types_12.Status.FAILED,
|
|
@@ -23516,7 +23664,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
|
|
|
23516
23664
|
});
|
|
23517
23665
|
await (0, biEvents_1.reportSessionError)({
|
|
23518
23666
|
...biBase,
|
|
23519
|
-
taskModel
|
|
23667
|
+
taskModel,
|
|
23520
23668
|
taskType: kind,
|
|
23521
23669
|
agentOutput: JSON.stringify(codegenError),
|
|
23522
23670
|
errorDesc: codegenError.errorType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/ditto-codegen-public",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.444",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"esbuild": "^0.27.2",
|
|
30
30
|
"vitest": "^4.0.16"
|
|
31
31
|
},
|
|
32
|
-
"falconPackageHash": "
|
|
32
|
+
"falconPackageHash": "5586151659b98dc4763183479e5853a3d0c6e39e3187fd3a48a7096e"
|
|
33
33
|
}
|