@wix/ditto-codegen-public 1.0.506 → 1.0.507
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
CHANGED
|
@@ -13886,14 +13886,10 @@ var require_checkpoint = __commonJS({
|
|
|
13886
13886
|
"use strict";
|
|
13887
13887
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
13888
13888
|
exports2.checkpointPluginFactory = void 0;
|
|
13889
|
-
var fs_1 = require("fs");
|
|
13890
|
-
var path_12 = require("path");
|
|
13891
13889
|
var http_1 = require_http_impl2();
|
|
13892
13890
|
var types_1 = require_types_impl3();
|
|
13893
13891
|
var http_client_1 = require_index_node();
|
|
13894
13892
|
var ditto_codegen_types_12 = require_dist4();
|
|
13895
|
-
var FALLBACK_COMMIT_MESSAGE = "Auto-save";
|
|
13896
|
-
var SET_COMMIT_MESSAGE_TOOL = "set-commit-message";
|
|
13897
13893
|
var MAX_CHECKPOINT_ERROR_LENGTH = 1e3;
|
|
13898
13894
|
var TRUNCATION_SUFFIX = "\u2026";
|
|
13899
13895
|
var COMMON_CONFIG_BY_ENVIRONMENT = {
|
|
@@ -13903,20 +13899,6 @@ var require_checkpoint = __commonJS({
|
|
|
13903
13899
|
const mapping = process.env.CODEGEN_ENVIRONMENT ? COMMON_CONFIG_BY_ENVIRONMENT[process.env.CODEGEN_ENVIRONMENT] : void 0;
|
|
13904
13900
|
return mapping ? encodeURIComponent(JSON.stringify(mapping)) : void 0;
|
|
13905
13901
|
})();
|
|
13906
|
-
var ASSETS_DIR = (0, path_12.join)(__dirname, "..", "assets");
|
|
13907
|
-
var readAsset = (name) => (0, fs_1.readFileSync)((0, path_12.join)(ASSETS_DIR, name), "utf-8");
|
|
13908
|
-
var buildCheckpointRules = () => [
|
|
13909
|
-
{
|
|
13910
|
-
filename: "checkpoint-commit-message.md",
|
|
13911
|
-
content: readAsset("commit-message-rule.md")
|
|
13912
|
-
}
|
|
13913
|
-
];
|
|
13914
|
-
var buildCheckpointTools = () => [
|
|
13915
|
-
{
|
|
13916
|
-
filename: "set-commit-message.ts",
|
|
13917
|
-
source: readAsset("set-commit-message.ts")
|
|
13918
|
-
}
|
|
13919
|
-
];
|
|
13920
13902
|
var truncate = (value, maxLength) => {
|
|
13921
13903
|
if (value.length <= maxLength)
|
|
13922
13904
|
return value;
|
|
@@ -14009,15 +13991,6 @@ Likely cause: a context provider's or function library's moduleSpecifier either
|
|
|
14009
13991
|
}));
|
|
14010
13992
|
return resp.data?.jobId ?? void 0;
|
|
14011
13993
|
};
|
|
14012
|
-
var readToolCommitMessage = (input) => {
|
|
14013
|
-
if (typeof input !== "object" || input === null)
|
|
14014
|
-
return void 0;
|
|
14015
|
-
const value = input.commitMessage;
|
|
14016
|
-
if (typeof value !== "string")
|
|
14017
|
-
return void 0;
|
|
14018
|
-
const trimmed = value.trim();
|
|
14019
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
14020
|
-
};
|
|
14021
13994
|
var checkpointPluginFactory = (ctx) => {
|
|
14022
13995
|
const { host, job } = ctx;
|
|
14023
13996
|
const accessToken = host.auth.getAccessToken();
|
|
@@ -14029,8 +14002,7 @@ Likely cause: a context provider's or function library's moduleSpecifier either
|
|
|
14029
14002
|
}
|
|
14030
14003
|
});
|
|
14031
14004
|
let outcome;
|
|
14032
|
-
|
|
14033
|
-
const commitCheckpoint = async (commitMessage) => {
|
|
14005
|
+
const commitCheckpoint = async () => {
|
|
14034
14006
|
if (!job)
|
|
14035
14007
|
return;
|
|
14036
14008
|
try {
|
|
@@ -14043,8 +14015,7 @@ Likely cause: a context provider's or function library's moduleSpecifier either
|
|
|
14043
14015
|
projectId: job.projectId,
|
|
14044
14016
|
checkpointId,
|
|
14045
14017
|
commitHash,
|
|
14046
|
-
overrideId
|
|
14047
|
-
commitMessage
|
|
14018
|
+
overrideId
|
|
14048
14019
|
});
|
|
14049
14020
|
} catch (error) {
|
|
14050
14021
|
const checkpointExists = outcome?.status === "created";
|
|
@@ -14119,20 +14090,6 @@ Likely cause: a context provider's or function library's moduleSpecifier either
|
|
|
14119
14090
|
};
|
|
14120
14091
|
return {
|
|
14121
14092
|
name: "checkpoint",
|
|
14122
|
-
rules: buildCheckpointRules(),
|
|
14123
|
-
tools: buildCheckpointTools(),
|
|
14124
|
-
// The agent calls `set-commit-message` (registered as a host tool from
|
|
14125
|
-
// the plugin's `tools` field) as the first thing it does. We capture the
|
|
14126
|
-
// value here and use it for the checkpoint at flow end.
|
|
14127
|
-
async onToolUse({ tool, state }) {
|
|
14128
|
-
if (state.status === "error")
|
|
14129
|
-
return;
|
|
14130
|
-
if (tool !== SET_COMMIT_MESSAGE_TOOL)
|
|
14131
|
-
return;
|
|
14132
|
-
const message = readToolCommitMessage(state.input);
|
|
14133
|
-
if (message)
|
|
14134
|
-
capturedCommitMessage = message;
|
|
14135
|
-
},
|
|
14136
14093
|
// Creates the checkpoint once the flow is over. Throws on failure, which
|
|
14137
14094
|
// the runner reports as a plugin failure. A conflict handed off to AI
|
|
14138
14095
|
// resolution is not a failure.
|
|
@@ -14141,8 +14098,7 @@ Likely cause: a context provider's or function library's moduleSpecifier either
|
|
|
14141
14098
|
return;
|
|
14142
14099
|
if (!filesChanged)
|
|
14143
14100
|
return;
|
|
14144
|
-
|
|
14145
|
-
await commitCheckpoint(commitMessage);
|
|
14101
|
+
await commitCheckpoint();
|
|
14146
14102
|
}
|
|
14147
14103
|
};
|
|
14148
14104
|
};
|
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.507",
|
|
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": "614f75ed056063e03a3de948850c0c2f0036507720563ace81e083bc"
|
|
33
33
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { tool } from "@opencode-ai/plugin";
|
|
2
|
-
|
|
3
|
-
export default tool({
|
|
4
|
-
description:
|
|
5
|
-
"Set the commit message for this codegen run. The message becomes the " +
|
|
6
|
-
"subject of a real `git commit -m` for the run, visible to " +
|
|
7
|
-
"non-technical users in their checkpoint history. Call this once, as " +
|
|
8
|
-
"the first thing you do, before writing any code.",
|
|
9
|
-
args: {
|
|
10
|
-
commitMessage: tool.schema
|
|
11
|
-
.string()
|
|
12
|
-
.min(1)
|
|
13
|
-
.describe(
|
|
14
|
-
"One-line summary of the user's request. " +
|
|
15
|
-
'Imperative mood (e.g. "Add", "Fix", "Update"). ' +
|
|
16
|
-
"No trailing period, no quotes, no prefix. " +
|
|
17
|
-
"Ideally under 150 characters.",
|
|
18
|
-
),
|
|
19
|
-
},
|
|
20
|
-
async execute(args) {
|
|
21
|
-
return `Commit message set: ${args.commitMessage}`;
|
|
22
|
-
},
|
|
23
|
-
});
|