@eworkbase/sdk 0.8.4 → 0.8.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/dist/{ExecutionLog.dto-ig9GUWhK.d.ts → ExecutionLog.dto-Bq2u5C90.d.ts} +1 -1
- package/dist/build.d.ts +54 -0
- package/dist/build.js +78 -0
- package/dist/components-DxL-99bM.js +131 -0
- package/dist/host-services-cIH3aYQD.js +5 -0
- package/dist/index.d.ts +20 -14
- package/dist/index.js +143 -245
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.js +9 -2
- package/dist/style.css +4 -98
- package/dist/{types-2X-_T_W_.d.ts → types-DDEHTBRv.d.ts} +39 -101
- package/dist/{types-CRYQB_Tb.d.ts → types-b6G-gae3.d.ts} +29 -6
- package/dist/ui/components.d.ts +55 -0
- package/dist/ui/components.js +2 -0
- package/dist/ui/execution-log.d.ts +6 -2
- package/dist/ui/execution-log.js +11 -20
- package/dist/ui/hooks.d.ts +70 -0
- package/dist/ui/hooks.js +262 -0
- package/dist/ui/index.css +38 -165
- package/dist/ui/index.d.ts +44 -2
- package/dist/ui/index.js +3 -300
- package/dist/ui/markdown-links.d.ts +1 -1
- package/dist/ui/markdown-links.js +44 -34
- package/dist/ui/model.d.ts +1 -2
- package/dist/ui/model.js +1 -8
- package/dist/ui/theme.css +123 -1
- package/dist/ui-DGLeDJDe.js +436 -0
- package/package.json +40 -8
- package/tsconfig.node.json +13 -0
- package/tsconfig.ui.json +18 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { n as MAXIMUM_VIEW_STATE_BYTES, t as DEFAULT_VIEW_STATE_TOPIC } from "./host-services-cIH3aYQD.js";
|
|
2
|
+
import { ZodError, z, z as z$1 } from "zod";
|
|
3
|
+
//#region src/error.ts
|
|
4
|
+
var PluginError = class extends Error {
|
|
5
|
+
code;
|
|
6
|
+
details;
|
|
7
|
+
retryable;
|
|
8
|
+
constructor({ code, message, details, retryable = false }) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "PluginError";
|
|
11
|
+
this.code = code;
|
|
12
|
+
this.retryable = retryable;
|
|
13
|
+
if (details !== void 0) this.details = details;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function createPluginError(options) {
|
|
17
|
+
return new PluginError(options);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/definition.ts
|
|
21
|
+
const PLUGIN_API_VERSION = 2;
|
|
22
|
+
const PLUGIN_ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
23
|
+
function definePlugin(definition) {
|
|
24
|
+
validateDefinition(definition);
|
|
25
|
+
return Object.freeze({
|
|
26
|
+
...definition,
|
|
27
|
+
dependencies: Object.freeze([...definition.dependencies ?? []])
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function isDefinedPlugin(value) {
|
|
31
|
+
try {
|
|
32
|
+
validateDefinition(value);
|
|
33
|
+
return true;
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function validateDefinition(definition) {
|
|
39
|
+
if (!isRecord(definition)) throw new TypeError("definePlugin requires a plugin definition object.");
|
|
40
|
+
if (typeof definition.id !== "string" || !PLUGIN_ID_PATTERN.test(definition.id)) throw new TypeError("Plugin id must use lowercase kebab-case.");
|
|
41
|
+
if (typeof definition.setup !== "function") throw new TypeError("Plugin setup must be a function.");
|
|
42
|
+
if (typeof definition.title !== "string" || definition.title.trim() === "") throw new TypeError("Plugin title must be a non-empty string.");
|
|
43
|
+
const dependencies = definition.dependencies ?? [];
|
|
44
|
+
if (!Array.isArray(dependencies) || dependencies.some((id) => typeof id !== "string" || !PLUGIN_ID_PATTERN.test(id) || id === definition.id) || new Set(dependencies).size !== dependencies.length) throw new TypeError("Plugin dependencies must be unique plugin ids and cannot include itself.");
|
|
45
|
+
}
|
|
46
|
+
function isRecord(value) {
|
|
47
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
3
50
|
//#region src/types.ts
|
|
4
51
|
let PluginHookId = /* @__PURE__ */ function(PluginHookId) {
|
|
5
52
|
PluginHookId["ProjectReconcile"] = "project.reconcile";
|
|
@@ -50,19 +97,6 @@ let PluginCommandTransaction = /* @__PURE__ */ function(PluginCommandTransaction
|
|
|
50
97
|
PluginCommandTransaction["ProjectMutation"] = "projectMutation";
|
|
51
98
|
return PluginCommandTransaction;
|
|
52
99
|
}({});
|
|
53
|
-
let PluginCommandCategory = /* @__PURE__ */ function(PluginCommandCategory) {
|
|
54
|
-
PluginCommandCategory["Build"] = "build";
|
|
55
|
-
PluginCommandCategory["Publish"] = "publish";
|
|
56
|
-
PluginCommandCategory["Run"] = "run";
|
|
57
|
-
PluginCommandCategory["Settings"] = "settings";
|
|
58
|
-
return PluginCommandCategory;
|
|
59
|
-
}({});
|
|
60
|
-
let PluginCommandExecutionMode = /* @__PURE__ */ function(PluginCommandExecutionMode) {
|
|
61
|
-
PluginCommandExecutionMode["Async"] = "async";
|
|
62
|
-
PluginCommandExecutionMode["Persistent"] = "persistent";
|
|
63
|
-
PluginCommandExecutionMode["Sync"] = "sync";
|
|
64
|
-
return PluginCommandExecutionMode;
|
|
65
|
-
}({});
|
|
66
100
|
let PluginLifecyclePolicy = /* @__PURE__ */ function(PluginLifecyclePolicy) {
|
|
67
101
|
PluginLifecyclePolicy["BestEffort"] = "bestEffort";
|
|
68
102
|
PluginLifecyclePolicy["FailFast"] = "failFast";
|
|
@@ -105,125 +139,15 @@ let PluginViewMethod = /* @__PURE__ */ function(PluginViewMethod) {
|
|
|
105
139
|
return PluginViewMethod;
|
|
106
140
|
}({});
|
|
107
141
|
//#endregion
|
|
108
|
-
//#region src/publication.ts
|
|
109
|
-
async function readPublicationChanges({ project, process, signal }, directory) {
|
|
110
|
-
const working = /* @__PURE__ */ new Set();
|
|
111
|
-
if (!project.publicationBranch) return {
|
|
112
|
-
files: [],
|
|
113
|
-
working,
|
|
114
|
-
partiallyStaged: false
|
|
115
|
-
};
|
|
116
|
-
const read = async (args, allowMissingAncestor = false) => {
|
|
117
|
-
const result = await process.run({
|
|
118
|
-
program: "git",
|
|
119
|
-
arguments: args,
|
|
120
|
-
currentDirectory: project.root,
|
|
121
|
-
outputMode: "content",
|
|
122
|
-
environment: {
|
|
123
|
-
GIT_OPTIONAL_LOCKS: "0",
|
|
124
|
-
GIT_LITERAL_PATHSPECS: "1",
|
|
125
|
-
GIT_TERMINAL_PROMPT: "0"
|
|
126
|
-
}
|
|
127
|
-
}, signal);
|
|
128
|
-
if (allowMissingAncestor && result.exitCode === 1 && !result.standardError && !result.timedOut && !result.wasCancelled) return "";
|
|
129
|
-
if (result.failed || result.timedOut || result.wasCancelled || result.standardOutputTruncated !== false) throw new Error("无法完整读取文件的发布状态。");
|
|
130
|
-
return result.standardOutput;
|
|
131
|
-
};
|
|
132
|
-
const names = async (args) => (await read([
|
|
133
|
-
...args,
|
|
134
|
-
"--",
|
|
135
|
-
directory
|
|
136
|
-
])).split("\0").filter((file) => file && !file.endsWith("/"));
|
|
137
|
-
const remote = "refs/remotes/origin/" + project.publicationBranch;
|
|
138
|
-
const common = (await read([
|
|
139
|
-
"merge-base",
|
|
140
|
-
"HEAD",
|
|
141
|
-
remote
|
|
142
|
-
], true)).trim();
|
|
143
|
-
const baseline = (await read([
|
|
144
|
-
"for-each-ref",
|
|
145
|
-
"--format=%(objectname)",
|
|
146
|
-
`refs/workbase/publications/${project.publicationBranch}/${common || "unrelated"}`
|
|
147
|
-
])).trim() || common;
|
|
148
|
-
if (!baseline) throw new Error("远端分支历史已更换,请先确认团队配置版本。");
|
|
149
|
-
const diff = [
|
|
150
|
-
"diff",
|
|
151
|
-
"--relative",
|
|
152
|
-
"--ignore-submodules=all",
|
|
153
|
-
"--no-renames",
|
|
154
|
-
"--name-only",
|
|
155
|
-
"-z"
|
|
156
|
-
];
|
|
157
|
-
const [unstaged, staged, committed, unequal, untracked] = await Promise.all([
|
|
158
|
-
names(diff),
|
|
159
|
-
names([...diff, "--cached"]),
|
|
160
|
-
names([
|
|
161
|
-
...diff,
|
|
162
|
-
baseline,
|
|
163
|
-
"HEAD"
|
|
164
|
-
]),
|
|
165
|
-
names([
|
|
166
|
-
...diff,
|
|
167
|
-
remote,
|
|
168
|
-
"HEAD"
|
|
169
|
-
]),
|
|
170
|
-
names([
|
|
171
|
-
"ls-files",
|
|
172
|
-
"--others",
|
|
173
|
-
"--exclude-standard",
|
|
174
|
-
"-z"
|
|
175
|
-
])
|
|
176
|
-
]);
|
|
177
|
-
[...unstaged, ...untracked].forEach((file) => working.add(file));
|
|
178
|
-
const partiallyStaged = staged.some((file) => working.has(file));
|
|
179
|
-
staged.forEach((file) => working.add(file));
|
|
180
|
-
const unpublished = new Set(unequal);
|
|
181
|
-
return {
|
|
182
|
-
files: [.../* @__PURE__ */ new Set([...working, ...committed.filter((file) => unpublished.has(file))])].sort(),
|
|
183
|
-
working,
|
|
184
|
-
partiallyStaged
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region src/definition.ts
|
|
189
|
-
const PLUGIN_API_VERSION = 2;
|
|
190
|
-
const PLUGIN_ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
191
|
-
function definePlugin(definition) {
|
|
192
|
-
validateDefinition(definition);
|
|
193
|
-
return Object.freeze({
|
|
194
|
-
...definition,
|
|
195
|
-
dependencies: Object.freeze([...definition.dependencies ?? []])
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function isDefinedPlugin(value) {
|
|
199
|
-
try {
|
|
200
|
-
validateDefinition(value);
|
|
201
|
-
return true;
|
|
202
|
-
} catch {
|
|
203
|
-
return false;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
function validateDefinition(definition) {
|
|
207
|
-
if (!isRecord(definition)) throw new TypeError("definePlugin requires a plugin definition object.");
|
|
208
|
-
if (typeof definition.id !== "string" || !PLUGIN_ID_PATTERN.test(definition.id)) throw new TypeError("Plugin id must use lowercase kebab-case.");
|
|
209
|
-
if (typeof definition.setup !== "function") throw new TypeError("Plugin setup must be a function.");
|
|
210
|
-
if (typeof definition.title !== "string" || definition.title.trim() === "") throw new TypeError("Plugin title must be a non-empty string.");
|
|
211
|
-
const dependencies = definition.dependencies ?? [];
|
|
212
|
-
if (!Array.isArray(dependencies) || dependencies.some((id) => typeof id !== "string" || !PLUGIN_ID_PATTERN.test(id) || id === definition.id) || new Set(dependencies).size !== dependencies.length) throw new TypeError("Plugin dependencies must be unique plugin ids and cannot include itself.");
|
|
213
|
-
}
|
|
214
|
-
function isRecord(value) {
|
|
215
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
216
|
-
}
|
|
217
|
-
//#endregion
|
|
218
142
|
//#region src/Tools.dto.ts
|
|
219
143
|
/** Typed tool-domain contracts shared by the SDK and host bridge. */
|
|
220
|
-
const identifier = z.string().min(1);
|
|
221
|
-
const toolKind = z.enum([
|
|
144
|
+
const identifier = z$1.string().min(1);
|
|
145
|
+
const toolKind = z$1.enum([
|
|
222
146
|
"runtime",
|
|
223
147
|
"cli",
|
|
224
148
|
"desktop"
|
|
225
149
|
]);
|
|
226
|
-
const toolStatus = z.enum([
|
|
150
|
+
const toolStatus = z$1.enum([
|
|
227
151
|
"unknown",
|
|
228
152
|
"running",
|
|
229
153
|
"ready",
|
|
@@ -235,66 +159,66 @@ const toolStatus = z.enum([
|
|
|
235
159
|
"cancelled",
|
|
236
160
|
"interrupted"
|
|
237
161
|
]);
|
|
238
|
-
const roleToolEnvironmentSchema = z.object({
|
|
162
|
+
const roleToolEnvironmentSchema = z$1.object({
|
|
239
163
|
roleId: identifier,
|
|
240
|
-
roleLabel: z.string(),
|
|
164
|
+
roleLabel: z$1.string(),
|
|
241
165
|
revision: identifier,
|
|
242
|
-
assignedToolIds: z.array(identifier),
|
|
243
|
-
tools: z.array(z.object({
|
|
166
|
+
assignedToolIds: z$1.array(identifier),
|
|
167
|
+
tools: z$1.array(z$1.object({
|
|
244
168
|
id: identifier,
|
|
245
|
-
label: z.string(),
|
|
169
|
+
label: z$1.string(),
|
|
246
170
|
kind: toolKind,
|
|
247
|
-
version: z.string().nullable(),
|
|
248
|
-
assigned: z.boolean(),
|
|
249
|
-
shared: z.boolean(),
|
|
250
|
-
assignable: z.boolean()
|
|
171
|
+
version: z$1.string().nullable(),
|
|
172
|
+
assigned: z$1.boolean(),
|
|
173
|
+
shared: z$1.boolean(),
|
|
174
|
+
assignable: z$1.boolean()
|
|
251
175
|
})),
|
|
252
|
-
runtimes: z.object({
|
|
253
|
-
projectRoot: z.string(),
|
|
254
|
-
miseVersion: z.string().nullable(),
|
|
255
|
-
status: z.enum([
|
|
176
|
+
runtimes: z$1.object({
|
|
177
|
+
projectRoot: z$1.string(),
|
|
178
|
+
miseVersion: z$1.string().nullable(),
|
|
179
|
+
status: z$1.enum([
|
|
256
180
|
"missing",
|
|
257
181
|
"outdated",
|
|
258
182
|
"not-prepared",
|
|
259
183
|
"ready",
|
|
260
184
|
"failed"
|
|
261
185
|
]),
|
|
262
|
-
detail: z.string(),
|
|
263
|
-
runtimes: z.array(z.object({
|
|
186
|
+
detail: z$1.string(),
|
|
187
|
+
runtimes: z$1.array(z$1.object({
|
|
264
188
|
id: identifier,
|
|
265
|
-
label: z.string(),
|
|
189
|
+
label: z$1.string(),
|
|
266
190
|
runtimeId: identifier,
|
|
267
|
-
version: z.string(),
|
|
268
|
-
installed: z.boolean(),
|
|
269
|
-
terminalApplied: z.boolean()
|
|
191
|
+
version: z$1.string(),
|
|
192
|
+
installed: z$1.boolean(),
|
|
193
|
+
terminalApplied: z$1.boolean()
|
|
270
194
|
}))
|
|
271
195
|
}),
|
|
272
|
-
nativeTools: z.array(z.object({
|
|
196
|
+
nativeTools: z$1.array(z$1.object({
|
|
273
197
|
id: identifier,
|
|
274
|
-
label: z.string(),
|
|
198
|
+
label: z$1.string(),
|
|
275
199
|
kind: toolKind,
|
|
276
|
-
currentVersion: z.string().nullable(),
|
|
200
|
+
currentVersion: z$1.string().nullable(),
|
|
277
201
|
status: toolStatus,
|
|
278
|
-
detail: z.string(),
|
|
279
|
-
manualActionMessage: z.string().nullable()
|
|
202
|
+
detail: z$1.string(),
|
|
203
|
+
manualActionMessage: z$1.string().nullable()
|
|
280
204
|
}))
|
|
281
205
|
});
|
|
282
|
-
const roleToolsProposalSchema = z.object({
|
|
283
|
-
id: z.string().uuid(),
|
|
206
|
+
const roleToolsProposalSchema = z$1.object({
|
|
207
|
+
id: z$1.string().uuid(),
|
|
284
208
|
roleId: identifier,
|
|
285
|
-
roleLabel: z.string(),
|
|
209
|
+
roleLabel: z$1.string(),
|
|
286
210
|
revision: identifier,
|
|
287
|
-
toolIds: z.array(identifier),
|
|
288
|
-
before: z.array(identifier),
|
|
289
|
-
after: z.array(identifier),
|
|
290
|
-
labels: z.array(z.string()),
|
|
291
|
-
reason: z.string()
|
|
211
|
+
toolIds: z$1.array(identifier),
|
|
212
|
+
before: z$1.array(identifier),
|
|
213
|
+
after: z$1.array(identifier),
|
|
214
|
+
labels: z$1.array(z$1.string()),
|
|
215
|
+
reason: z$1.string()
|
|
292
216
|
});
|
|
293
|
-
const roleToolsAppliedSchema = z.object({
|
|
217
|
+
const roleToolsAppliedSchema = z$1.object({
|
|
294
218
|
roleId: identifier,
|
|
295
|
-
toolIds: z.array(identifier),
|
|
296
|
-
applied: z.literal(true),
|
|
297
|
-
requiresPreparation: z.boolean()
|
|
219
|
+
toolIds: z$1.array(identifier),
|
|
220
|
+
applied: z$1.literal(true),
|
|
221
|
+
requiresPreparation: z$1.boolean()
|
|
298
222
|
});
|
|
299
223
|
//#endregion
|
|
300
224
|
//#region src/ExecutionLog.dto.ts
|
|
@@ -306,104 +230,78 @@ let ExecutionLogEntryKind = /* @__PURE__ */ function(ExecutionLogEntryKind) {
|
|
|
306
230
|
ExecutionLogEntryKind["Answer"] = "answer";
|
|
307
231
|
return ExecutionLogEntryKind;
|
|
308
232
|
}({});
|
|
309
|
-
const executionLogEntrySchema = z.object({
|
|
310
|
-
id: z.string().min(1).max(160),
|
|
311
|
-
kind: z.enum(ExecutionLogEntryKind),
|
|
312
|
-
time: z.iso.datetime(),
|
|
313
|
-
title: z.string().max(240),
|
|
314
|
-
content: z.string().max(48e3),
|
|
315
|
-
details: z.string().max(8e3).nullish(),
|
|
316
|
-
status: z.string().max(64).nullish()
|
|
233
|
+
const executionLogEntrySchema = z$1.object({
|
|
234
|
+
id: z$1.string().min(1).max(160),
|
|
235
|
+
kind: z$1.enum(ExecutionLogEntryKind),
|
|
236
|
+
time: z$1.iso.datetime(),
|
|
237
|
+
title: z$1.string().max(240),
|
|
238
|
+
content: z$1.string().max(48e3),
|
|
239
|
+
details: z$1.string().max(8e3).nullish(),
|
|
240
|
+
status: z$1.string().max(64).nullish()
|
|
317
241
|
}).strict();
|
|
318
|
-
const executionTimingSchema = z.object({
|
|
319
|
-
queuedAt: z.string().nullish(),
|
|
320
|
-
startedAt: z.string().nullish(),
|
|
321
|
-
finishedAt: z.string().nullish()
|
|
242
|
+
const executionTimingSchema = z$1.object({
|
|
243
|
+
queuedAt: z$1.string().nullish(),
|
|
244
|
+
startedAt: z$1.string().nullish(),
|
|
245
|
+
finishedAt: z$1.string().nullish()
|
|
322
246
|
});
|
|
323
|
-
const executionIdentitySchema = z.object({
|
|
324
|
-
pluginId: z.string(),
|
|
325
|
-
commandId: z.string()
|
|
247
|
+
const executionIdentitySchema = z$1.object({
|
|
248
|
+
pluginId: z$1.string(),
|
|
249
|
+
commandId: z$1.string()
|
|
326
250
|
});
|
|
327
|
-
const executionContextSchema = z.object({ finishedAt: z.string().nullish() });
|
|
328
|
-
const logStepSchema = z.object({
|
|
329
|
-
id: z.string(),
|
|
330
|
-
legacyId: z.string().optional(),
|
|
331
|
-
label: z.string(),
|
|
332
|
-
detail: z.string(),
|
|
333
|
-
status: z.string(),
|
|
334
|
-
executionState: z.string().nullish(),
|
|
335
|
-
phase: z.string().nullish(),
|
|
251
|
+
const executionContextSchema = z$1.object({ finishedAt: z$1.string().nullish() });
|
|
252
|
+
const logStepSchema = z$1.object({
|
|
253
|
+
id: z$1.string(),
|
|
254
|
+
legacyId: z$1.string().optional(),
|
|
255
|
+
label: z$1.string(),
|
|
256
|
+
detail: z$1.string(),
|
|
257
|
+
status: z$1.string(),
|
|
258
|
+
executionState: z$1.string().nullish(),
|
|
259
|
+
phase: z$1.string().nullish(),
|
|
336
260
|
timing: executionTimingSchema.optional(),
|
|
337
|
-
target: z.object({
|
|
338
|
-
kind: z.string(),
|
|
339
|
-
id: z.string(),
|
|
340
|
-
label: z.string()
|
|
261
|
+
target: z$1.object({
|
|
262
|
+
kind: z$1.string(),
|
|
263
|
+
id: z$1.string(),
|
|
264
|
+
label: z$1.string()
|
|
341
265
|
}).nullish(),
|
|
342
|
-
provider: z.string().nullish(),
|
|
343
|
-
command: z.string().nullish(),
|
|
344
|
-
stdout: z.string().nullish(),
|
|
345
|
-
stderr: z.string().nullish(),
|
|
346
|
-
manualActionMessage: z.string().nullish()
|
|
266
|
+
provider: z$1.string().nullish(),
|
|
267
|
+
command: z$1.string().nullish(),
|
|
268
|
+
stdout: z$1.string().nullish(),
|
|
269
|
+
stderr: z$1.string().nullish(),
|
|
270
|
+
manualActionMessage: z$1.string().nullish()
|
|
347
271
|
});
|
|
348
|
-
const logCallSchema = z.object({
|
|
349
|
-
id: z.string(),
|
|
350
|
-
title: z.string(),
|
|
351
|
-
status: z.string(),
|
|
352
|
-
createdAt: z.string(),
|
|
353
|
-
operationKind: z.string(),
|
|
354
|
-
hasWarnings: z.boolean(),
|
|
272
|
+
const logCallSchema = z$1.object({
|
|
273
|
+
id: z$1.string(),
|
|
274
|
+
title: z$1.string(),
|
|
275
|
+
status: z$1.string(),
|
|
276
|
+
createdAt: z$1.string(),
|
|
277
|
+
operationKind: z$1.string(),
|
|
278
|
+
hasWarnings: z$1.boolean(),
|
|
355
279
|
context: executionContextSchema,
|
|
356
|
-
hasChildErrors: z.boolean().optional(),
|
|
280
|
+
hasChildErrors: z$1.boolean().optional(),
|
|
357
281
|
execution: executionIdentitySchema.nullish()
|
|
358
282
|
});
|
|
359
283
|
/** Existing operation evidence is returned alongside entries; it is never copied into another store. */
|
|
360
|
-
const executionLogRecordSchema = z.object({
|
|
361
|
-
id: z.string(),
|
|
362
|
-
title: z.string(),
|
|
363
|
-
entries: z.array(executionLogEntrySchema),
|
|
364
|
-
steps: z.array(logStepSchema).optional(),
|
|
365
|
-
children: z.array(logCallSchema).optional(),
|
|
366
|
-
messages: z.array(z.object({
|
|
367
|
-
id: z.string(),
|
|
368
|
-
createdAt: z.string(),
|
|
369
|
-
level: z.enum([
|
|
284
|
+
const executionLogRecordSchema = z$1.object({
|
|
285
|
+
id: z$1.string(),
|
|
286
|
+
title: z$1.string(),
|
|
287
|
+
entries: z$1.array(executionLogEntrySchema),
|
|
288
|
+
steps: z$1.array(logStepSchema).optional(),
|
|
289
|
+
children: z$1.array(logCallSchema).optional(),
|
|
290
|
+
messages: z$1.array(z$1.object({
|
|
291
|
+
id: z$1.string(),
|
|
292
|
+
createdAt: z$1.string(),
|
|
293
|
+
level: z$1.enum([
|
|
370
294
|
"debug",
|
|
371
295
|
"info",
|
|
372
296
|
"warn",
|
|
373
297
|
"error"
|
|
374
298
|
]),
|
|
375
|
-
message: z.string()
|
|
299
|
+
message: z$1.string()
|
|
376
300
|
})).optional(),
|
|
377
|
-
warnings: z.array(z.string()).optional(),
|
|
378
|
-
createdAt: z.string().optional(),
|
|
301
|
+
warnings: z$1.array(z$1.string()).optional(),
|
|
302
|
+
createdAt: z$1.string().optional(),
|
|
379
303
|
execution: executionIdentitySchema.nullish(),
|
|
380
304
|
context: executionContextSchema.optional()
|
|
381
305
|
});
|
|
382
306
|
//#endregion
|
|
383
|
-
|
|
384
|
-
/** Serializable opt-in for workflow nodes and the result fields a condition may read. */
|
|
385
|
-
const name = z.string().trim().min(1).max(120);
|
|
386
|
-
const fieldKey = z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/).refine((key) => ![
|
|
387
|
-
"constructor",
|
|
388
|
-
"prototype",
|
|
389
|
-
"__proto__"
|
|
390
|
-
].includes(key));
|
|
391
|
-
const outputField = z.discriminatedUnion("type", [
|
|
392
|
-
z.object({
|
|
393
|
-
type: z.literal("boolean"),
|
|
394
|
-
label: name
|
|
395
|
-
}).strict(),
|
|
396
|
-
z.object({
|
|
397
|
-
type: z.literal("number"),
|
|
398
|
-
label: name,
|
|
399
|
-
unit: name.optional()
|
|
400
|
-
}).strict(),
|
|
401
|
-
z.object({
|
|
402
|
-
type: z.literal("enum"),
|
|
403
|
-
label: name,
|
|
404
|
-
values: z.array(name).min(1).max(64)
|
|
405
|
-
}).strict()
|
|
406
|
-
]);
|
|
407
|
-
const workflowContributionSchema = z.union([z.literal(true), z.object({ outputs: z.record(fieldKey, outputField).refine((fields) => Object.keys(fields).length <= 32) }).strict()]);
|
|
408
|
-
//#endregion
|
|
409
|
-
export { ExecutionLogEntryKind, PLUGIN_API_VERSION, PluginAgentScope, PluginCapabilityKind, PluginCommandCategory, PluginCommandEffect, PluginCommandExecutionMode, PluginCommandLogPolicy, PluginCommandTransaction, PluginContextExposure, PluginExecutionStatus, PluginHookId, PluginLifecyclePolicy, PluginLifecycleStatus, PluginProcessOutputMode, PluginRepositoryStatus, PluginSharedChangeKind, PluginViewLayout, PluginViewMethod, definePlugin, executionLogEntrySchema, executionLogRecordSchema, isDefinedPlugin, readPublicationChanges, roleToolEnvironmentSchema, roleToolsAppliedSchema, roleToolsProposalSchema, workflowContributionSchema };
|
|
307
|
+
export { DEFAULT_VIEW_STATE_TOPIC, ExecutionLogEntryKind, MAXIMUM_VIEW_STATE_BYTES, PLUGIN_API_VERSION, PluginAgentScope, PluginCapabilityKind, PluginCommandEffect, PluginCommandLogPolicy, PluginCommandTransaction, PluginContextExposure, PluginError, PluginExecutionStatus, PluginHookId, PluginLifecyclePolicy, PluginLifecycleStatus, PluginProcessOutputMode, PluginRepositoryStatus, PluginSharedChangeKind, PluginViewLayout, PluginViewMethod, ZodError, createPluginError, definePlugin, executionLogEntrySchema, executionLogRecordSchema, isDefinedPlugin, roleToolEnvironmentSchema, roleToolsAppliedSchema, roleToolsProposalSchema, z };
|
package/dist/markdown.d.ts
CHANGED
package/dist/markdown.js
CHANGED
|
@@ -95,9 +95,16 @@ function readDocument(root, relativePath) {
|
|
|
95
95
|
try {
|
|
96
96
|
const metadata = fstatSync(descriptor);
|
|
97
97
|
if (!metadata.isFile() || metadata.size > MAXIMUM_DOCUMENT_BYTES) throw new Error("只能预览不超过 1 MB 的普通 Markdown 文件:" + relativePath);
|
|
98
|
-
const
|
|
98
|
+
const initialCapacity = Math.min(Math.max(metadata.size, 0) + 1, 1048577);
|
|
99
|
+
let buffer = Buffer.alloc(initialCapacity);
|
|
99
100
|
let length = 0;
|
|
100
|
-
while (length
|
|
101
|
+
while (length <= MAXIMUM_DOCUMENT_BYTES) {
|
|
102
|
+
if (length === buffer.length) {
|
|
103
|
+
const nextCapacity = Math.min(buffer.length * 2, 1048577);
|
|
104
|
+
const expanded = Buffer.alloc(nextCapacity);
|
|
105
|
+
buffer.copy(expanded, 0, 0, length);
|
|
106
|
+
buffer = expanded;
|
|
107
|
+
}
|
|
101
108
|
const count = readSync(descriptor, buffer, length, buffer.length - length, length);
|
|
102
109
|
if (!count) break;
|
|
103
110
|
length += count;
|
package/dist/style.css
CHANGED
|
@@ -2089,111 +2089,17 @@
|
|
|
2089
2089
|
display: none;
|
|
2090
2090
|
}
|
|
2091
2091
|
|
|
2092
|
-
.workbase-markdown-links {
|
|
2093
|
-
flex-direction: column;
|
|
2094
|
-
flex: 1;
|
|
2095
|
-
min-width: 0;
|
|
2096
|
-
min-height: 0;
|
|
2097
|
-
display: flex;
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
.markdown-document-preview {
|
|
2101
|
-
border: 1px solid var(--color-border);
|
|
2102
|
-
background: var(--color-surface);
|
|
2103
|
-
min-width: 0;
|
|
2104
|
-
color: var(--color-foreground);
|
|
2105
|
-
border-radius: 8px;
|
|
2106
|
-
margin-bottom: 20px;
|
|
2107
|
-
padding: 20px;
|
|
2108
|
-
}
|
|
2109
|
-
|
|
2110
|
-
.markdown-document-heading {
|
|
2111
|
-
justify-content: space-between;
|
|
2112
|
-
align-items: start;
|
|
2113
|
-
gap: 16px;
|
|
2114
|
-
margin-bottom: 20px;
|
|
2115
|
-
display: flex;
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
.markdown-document-heading h2 {
|
|
2119
|
-
margin: 0;
|
|
2120
|
-
font-size: 18px;
|
|
2121
|
-
line-height: 1.5;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
.markdown-document-heading p {
|
|
2125
|
-
color: var(--color-muted);
|
|
2126
|
-
overflow-wrap: anywhere;
|
|
2127
|
-
margin: 8px 0 0;
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
.markdown-document-heading button {
|
|
2131
|
-
border: 1px solid var(--color-border-strong);
|
|
2132
|
-
background: var(--color-surface);
|
|
2133
|
-
color: var(--color-foreground);
|
|
2134
|
-
font: inherit;
|
|
2135
|
-
cursor: pointer;
|
|
2136
|
-
border-radius: 6px;
|
|
2137
|
-
flex-shrink: 0;
|
|
2138
|
-
padding: 6px 10px;
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
.markdown-document-heading button:hover {
|
|
2142
|
-
background: var(--color-surface-muted);
|
|
2143
|
-
}
|
|
2144
|
-
|
|
2145
|
-
.markdown-document-preview:focus-visible, .workbase-markdown-links button:focus-visible {
|
|
2146
|
-
outline: 2px solid var(--color-brand);
|
|
2147
|
-
outline-offset: 2px;
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
|
-
.workbase-markdown-links .markdown-document-body {
|
|
2151
|
-
max-width: 75ch;
|
|
2152
|
-
max-height: 65vh;
|
|
2153
|
-
color: var(--color-foreground);
|
|
2154
|
-
overflow-wrap: anywhere;
|
|
2155
|
-
font-family: inherit;
|
|
2156
|
-
font-size: 14px;
|
|
2157
|
-
line-height: 1.85;
|
|
2158
|
-
overflow: auto;
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
.markdown-document-body :is(h1, h2, h3, h4, h5, h6) {
|
|
2162
|
-
color: var(--color-foreground);
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
.markdown-document-body a {
|
|
2166
|
-
color: var(--color-accent);
|
|
2167
|
-
text-underline-offset: 3px;
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
.markdown-document-body pre {
|
|
2171
|
-
background: var(--color-surface-muted);
|
|
2172
|
-
overflow: auto;
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
.markdown-document-body table {
|
|
2176
|
-
max-width: 100%;
|
|
2177
|
-
display: block;
|
|
2178
|
-
overflow: auto;
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
|
-
.markdown-document-body ::selection {
|
|
2182
|
-
background: var(--color-brand-weak);
|
|
2183
|
-
color: var(--color-foreground);
|
|
2184
|
-
}
|
|
2185
|
-
|
|
2186
2092
|
.workbase-markdown-editor, .workbase-markdown-editor .vditor {
|
|
2187
2093
|
--panel-background-color: var(--color-surface);
|
|
2188
2094
|
--border-color: var(--color-border);
|
|
2189
|
-
--toolbar-background-color: var(--color-
|
|
2095
|
+
--toolbar-background-color: var(--color-surface-raised);
|
|
2190
2096
|
--toolbar-icon-color: var(--color-muted);
|
|
2191
2097
|
--toolbar-icon-hover-color: var(--color-brand);
|
|
2192
2098
|
--toolbar-height: 36px;
|
|
2193
2099
|
--textarea-background-color: var(--color-surface);
|
|
2194
2100
|
--textarea-text-color: var(--color-foreground);
|
|
2195
2101
|
--resize-icon-color: var(--color-muted);
|
|
2196
|
-
--resize-background-color: var(--color-
|
|
2102
|
+
--resize-background-color: var(--color-surface-raised);
|
|
2197
2103
|
--resize-hover-icon-color: var(--color-brand);
|
|
2198
2104
|
--resize-hover-background-color: var(--color-brand-weak);
|
|
2199
2105
|
min-width: 0;
|
|
@@ -2283,11 +2189,11 @@
|
|
|
2283
2189
|
}
|
|
2284
2190
|
|
|
2285
2191
|
.workbase-markdown-editor [contenteditable]:focus-visible {
|
|
2286
|
-
box-shadow: inset 0 0 0 2px var(--color-
|
|
2192
|
+
box-shadow: inset 0 0 0 2px var(--color-accent);
|
|
2287
2193
|
}
|
|
2288
2194
|
|
|
2289
2195
|
.workbase-markdown-editor button:focus-visible {
|
|
2290
|
-
outline: 2px solid var(--color-
|
|
2196
|
+
outline: 2px solid var(--color-accent);
|
|
2291
2197
|
outline-offset: 2px;
|
|
2292
2198
|
}
|
|
2293
2199
|
|