@co0ontty/wand 4.57.0 → 4.58.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/dist/build-info.json +3 -3
- package/dist/ensure-node-pty-helper.d.ts +0 -1
- package/dist/ensure-node-pty-helper.js +0 -5
- package/dist/git-quick-commit.js +18 -19
- package/dist/github-connector.d.ts +11 -5
- package/dist/github-connector.js +105 -33
- package/dist/missions.d.ts +1 -1
- package/dist/missions.js +17 -4
- package/dist/server-file-routes.js +43 -2
- package/dist/server-github-routes.js +50 -53
- package/dist/server-mission-routes.js +11 -10
- package/dist/server-task-routes.d.ts +14 -2
- package/dist/server-task-routes.js +248 -84
- package/dist/server-workspace-routes.js +90 -16
- package/dist/server.js +2 -20
- package/dist/storage.d.ts +23 -6
- package/dist/storage.js +130 -53
- package/dist/structured-exec-host.d.ts +13 -2
- package/dist/structured-exec-host.js +71 -36
- package/dist/structured-exec-pump.d.ts +1 -1
- package/dist/structured-exec-pump.js +14 -8
- package/dist/task-types.d.ts +15 -0
- package/dist/terminal-daemon-client.d.ts +2 -0
- package/dist/terminal-daemon-client.js +7 -1
- package/dist/terminal-daemon-server.js +17 -18
- package/dist/tui/ipc-server.js +3 -1
- package/dist/types.d.ts +1 -0
- package/dist/wand-task-sync.d.ts +9 -0
- package/dist/wand-task-sync.js +50 -0
- package/dist/web-ui/content/scripts.js +85 -85
- package/dist/web-ui/content/styles.css +1 -1
- package/dist/web-ui/embedded-assets.js +2 -2
- package/dist/ws-broadcast.js +5 -1
- package/package.json +2 -3
- package/dist/taskboard-bridge.d.ts +0 -11
- package/dist/taskboard-bridge.js +0 -371
- package/vendor/codex-taskboard/LICENSE +0 -201
- package/vendor/codex-taskboard/dist/web/assets/AiChat-BNn4VJ5a.js +0 -12
- package/vendor/codex-taskboard/dist/web/assets/GanttView-D8wnfGrG.css +0 -1
- package/vendor/codex-taskboard/dist/web/assets/GanttView-rGWhuEX9.js +0 -39
- package/vendor/codex-taskboard/dist/web/assets/abnfDiagram-N423BO3Z-DbFG6lbA.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/arc-BjSQqbzd.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/architecture-TIHT7OUA-C9-t8p4o.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/architectureDiagram-T3A2C74G-Db4kJZwO.js +0 -36
- package/vendor/codex-taskboard/dist/web/assets/array-BifhSqXX.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/blockDiagram-VBNYF7ZC-C-BywuWV.js +0 -132
- package/vendor/codex-taskboard/dist/web/assets/c4Diagram-5PPSVZJV-Dq-80rjP.js +0 -10
- package/vendor/codex-taskboard/dist/web/assets/channel-C7mnz8Xc.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-2GRJ4B5K-B2G57us9.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-2Q5K7J3B-C1jixKkw.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-3NCLNEKW-DVGIRib_.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-4I5QYGJK-kNoGFqr0.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-5RXB4S5H-4iv6-xM6.js +0 -231
- package/vendor/codex-taskboard/dist/web/assets/chunk-5VM5RSS4-ZNzvKenW.js +0 -15
- package/vendor/codex-taskboard/dist/web/assets/chunk-6Q2QTUOP-1J34vxHr.js +0 -88
- package/vendor/codex-taskboard/dist/web/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-7Z6QIM7H-CDQpQlxX.js +0 -10
- package/vendor/codex-taskboard/dist/web/assets/chunk-GF5L2VYU-Dg92oHHl.js +0 -206
- package/vendor/codex-taskboard/dist/web/assets/chunk-I66GZJ75-Bk8_gFs2.js +0 -125
- package/vendor/codex-taskboard/dist/web/assets/chunk-J7OUQ5F2-CJRcenlr.js +0 -2
- package/vendor/codex-taskboard/dist/web/assets/chunk-JQJVKLGR-BLBV_Sus.js +0 -156
- package/vendor/codex-taskboard/dist/web/assets/chunk-JWPE2WC7-DVXcaiue.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-KBJHAD2P-Da9Yjz0p.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-KEIR6QF5-Dj-OpFgW.js +0 -161
- package/vendor/codex-taskboard/dist/web/assets/chunk-NSK5VX7P-Cb56tnGK.js +0 -2
- package/vendor/codex-taskboard/dist/web/assets/chunk-QR6OTTB3-BwoszTxn.js +0 -62
- package/vendor/codex-taskboard/dist/web/assets/chunk-RYQCIY6F-D_L2RdcQ.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-UBXNYLIW-YX5mN8cl.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-W5SLKNZC-DlOLhhDO.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-WRU74C26-B7SBmP0K.js +0 -70
- package/vendor/codex-taskboard/dist/web/assets/chunk-XXDRQBXY-BuE3VzE_.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/chunk-ZIRB5QZD-C6fEPe3t.js +0 -32
- package/vendor/codex-taskboard/dist/web/assets/classDiagram-JCYQIIEL-KIdCVvbA.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/classDiagram-v2-OCEON4UE-KIdCVvbA.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/cose-bilkent-JH36ORCC-BzQvy5TC.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/cynefin-VYW2F7L2-D1_5O1XR.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/cynefinDiagram-MW4NZA55-DOW_U5QN.js +0 -62
- package/vendor/codex-taskboard/dist/web/assets/cytoscape.esm-DnGd5Fuo.js +0 -321
- package/vendor/codex-taskboard/dist/web/assets/dagre-VZM6K2ZE-0Dntc3NT.js +0 -4
- package/vendor/codex-taskboard/dist/web/assets/dagre-dpRSp0QF.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/defaultLocale-C8Fc0cco.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/diagram-7IWD3JNH-D7GleYAM.js +0 -30
- package/vendor/codex-taskboard/dist/web/assets/diagram-B4RE2ZJO-DCXTe6q5.js +0 -3
- package/vendor/codex-taskboard/dist/web/assets/diagram-LBJQPF4R-ZFJyXEXl.js +0 -24
- package/vendor/codex-taskboard/dist/web/assets/diagram-Q27KOJAE-DUGCuGd9.js +0 -24
- package/vendor/codex-taskboard/dist/web/assets/diagram-UB23O5K3-DRmp4Nng.js +0 -41
- package/vendor/codex-taskboard/dist/web/assets/dist-D9sYb5Oa.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/ebnfDiagram-BXEA7PRR-CkKoaf7T.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/erDiagram-JOGREHBK-nBX5z4R4.js +0 -85
- package/vendor/codex-taskboard/dist/web/assets/eventmodeling-45OFAUF4-pexmK65N.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/flowDiagram-UKHOOZJN-aroohRbL.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/ganttDiagram-PKOTCBZU-BOJWUTXa.js +0 -292
- package/vendor/codex-taskboard/dist/web/assets/gitGraph-TEB2WS4Q-DxnuhSZU.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/gitGraphDiagram-DS77QQ5N-Cte975TC.js +0 -106
- package/vendor/codex-taskboard/dist/web/assets/graphlib-DS17s2tU.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/index-Docmx4uQ.css +0 -1
- package/vendor/codex-taskboard/dist/web/assets/index-Du07lEGz.js +0 -121
- package/vendor/codex-taskboard/dist/web/assets/info-DKCQHKI2-DOTjgYxk.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/infoDiagram-6WML65LV-SpyV9UJd.js +0 -2
- package/vendor/codex-taskboard/dist/web/assets/init-D6jRqBbL.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/ishikawaDiagram-WSZJBQD7-T0PZwoUZ.js +0 -70
- package/vendor/codex-taskboard/dist/web/assets/journeyDiagram-NVQOT4AX-B88b8UgX.js +0 -139
- package/vendor/codex-taskboard/dist/web/assets/kanban-definition-27J2QSJJ-CIlfNnl_.js +0 -89
- package/vendor/codex-taskboard/dist/web/assets/katex-B7rAX3Vi.js +0 -257
- package/vendor/codex-taskboard/dist/web/assets/line-fWrwPZhB.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/linear-B7l8qgEw.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/map-BaFkSB1l.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/mermaid-parser.core-C5gls2nC.js +0 -7
- package/vendor/codex-taskboard/dist/web/assets/mermaid.core-POz2Xcvr.js +0 -11
- package/vendor/codex-taskboard/dist/web/assets/mindmap-definition-FAOFIHXS-BM0-egZ5.js +0 -96
- package/vendor/codex-taskboard/dist/web/assets/ordinal-hYBb2elL.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/packet-7NZHBO7P-DQZzyVos.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/path-BWPyau1x.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/pegDiagram-VL7TDLO6-B8aEwl-7.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/pie-RZYD4A2V-DRUflilR.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/pieDiagram-7S7Q4E2Y-0cDDxlua.js +0 -39
- package/vendor/codex-taskboard/dist/web/assets/purify.es-Bwt4ulIK.js +0 -3
- package/vendor/codex-taskboard/dist/web/assets/quadrantDiagram-CIZ2JOQS-CBgb0YZ0.js +0 -7
- package/vendor/codex-taskboard/dist/web/assets/radar-I7S5WNFK-tRocoKxq.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/railroad-3IZDKUUU-DaS4ZlX_.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/railroad-abnf-AHOZXSZD-BN1T5dBT.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/railroad-ebnf-EBAXGLYW-Cuf8qyKs.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/railroad-peg-LSFZ7HO6-B511_EYq.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/railroadDiagram-AXF67PYL-QtPo-JZb.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/requirementDiagram-LRYGKXZP-CuBIF85r.js +0 -84
- package/vendor/codex-taskboard/dist/web/assets/rolldown-runtime-QTnfLwEv.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/rough.esm-CSKSodPl.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/sankeyDiagram-W5VNT64P-CRA-b_za.js +0 -40
- package/vendor/codex-taskboard/dist/web/assets/sequenceDiagram-SI44F4Z6-CoddVWwY.js +0 -162
- package/vendor/codex-taskboard/dist/web/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/src-_wZywoZs.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/stateDiagram-OKZ733FA-D8DMM2ln.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/stateDiagram-v2-UEYNNEHI-CVp0eYAS.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/swimlanes-SLNWSIFB-C1fC7EFu.js +0 -2
- package/vendor/codex-taskboard/dist/web/assets/swimlanesDiagram-ULZ7WXOC-CPd58Xso.js +0 -8
- package/vendor/codex-taskboard/dist/web/assets/timeline-definition-Z64GVDOM-BUBv8aKP.js +0 -120
- package/vendor/codex-taskboard/dist/web/assets/treeView-QDETBFTQ-C-Bve2kY.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/treemap-6X3UGDF4-BcphHDdV.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/vennDiagram-T6HMQDX7-0wQnwAyA.js +0 -34
- package/vendor/codex-taskboard/dist/web/assets/wardley-OPB4EBWU-CJZ4BevB.js +0 -1
- package/vendor/codex-taskboard/dist/web/assets/wardleyDiagram-T6FBY63Y-U9nwPrkN.js +0 -78
- package/vendor/codex-taskboard/dist/web/assets/xychartDiagram-ELKLHX3M-CyCqnzgE.js +0 -7
- package/vendor/codex-taskboard/dist/web/codex-agent-logo.png +0 -0
- package/vendor/codex-taskboard/dist/web/codex-app-icon.png +0 -0
- package/vendor/codex-taskboard/dist/web/favicon.svg +0 -7
- package/vendor/codex-taskboard/dist/web/index.html +0 -20
- package/vendor/codex-taskboard/server/ai-chat-catalog.mjs +0 -1031
- package/vendor/codex-taskboard/server/ai-chat-process.mjs +0 -462
- package/vendor/codex-taskboard/server/ai-chat.mjs +0 -1237
- package/vendor/codex-taskboard/server/ai-turn-owner.mjs +0 -39
- package/vendor/codex-taskboard/server/app.mjs +0 -3211
- package/vendor/codex-taskboard/server/cloud-config.mjs +0 -188
- package/vendor/codex-taskboard/server/cloud-proxy.mjs +0 -310
- package/vendor/codex-taskboard/server/codex-app-server.mjs +0 -376
- package/vendor/codex-taskboard/server/codex-slash-commands-0.139.0.json +0 -62
- package/vendor/codex-taskboard/server/database.mjs +0 -2845
- package/vendor/codex-taskboard/server/index.mjs +0 -41
- package/vendor/codex-taskboard/server/jira-config.mjs +0 -181
- package/vendor/codex-taskboard/server/jira-integration.mjs +0 -487
- package/vendor/codex-taskboard/server/project-summary.mjs +0 -159
- package/vendor/codex-taskboard/shared/api-fields.mjs +0 -163
- package/vendor/codex-taskboard/shared/codex-environment.mjs +0 -5
- package/vendor/codex-taskboard/shared/codex-executable.mjs +0 -77
- package/vendor/codex-taskboard/shared/codex-permissions.mjs +0 -9
- package/vendor/codex-taskboard/shared/composer-reference.d.mts +0 -19
- package/vendor/codex-taskboard/shared/composer-reference.mjs +0 -90
- package/vendor/codex-taskboard/shared/domain.mjs +0 -34
- package/vendor/codex-taskboard/shared/executable-command.mjs +0 -13
- package/vendor/codex-taskboard/shared/process-tree.mjs +0 -27
- package/vendor/codex-taskboard/shared/task-input.mjs +0 -308
- package/vendor/codex-taskboard/shared/task-records.mjs +0 -199
- package/vendor/codex-taskboard/shared/task-relations.mjs +0 -55
- package/vendor/codex-taskboard/shared/taskboard-automation.mjs +0 -277
- package/vendor/codex-taskboard/skills/manage-taskboard/SKILL.md +0 -45
- package/vendor/codex-taskboard/skills/manage-taskboard/agents/openai.yaml +0 -4
- package/vendor/codex-taskboard/skills/manage-taskboard/references/cli.md +0 -211
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { TASK_STATUSES, isTaskStatus, isTaskPriority } from "./domain.mjs";
|
|
2
|
-
|
|
3
|
-
export class ApiError extends Error {
|
|
4
|
-
constructor(status, code, message, details) {
|
|
5
|
-
super(message);
|
|
6
|
-
this.name = "ApiError";
|
|
7
|
-
this.status = status;
|
|
8
|
-
this.code = code;
|
|
9
|
-
this.details = details;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function assertPlainObject(value) {
|
|
14
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
15
|
-
throw new ApiError(400, "INVALID_BODY", "Request body must be a JSON object");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function assertAllowedKeys(value, allowed) {
|
|
20
|
-
const unknown = Object.keys(value).filter((key) => !allowed.has(key));
|
|
21
|
-
if (unknown.length > 0) {
|
|
22
|
-
throw new ApiError(400, "UNKNOWN_FIELD", `Unknown field${unknown.length === 1 ? "" : "s"}: ${unknown.join(", ")}`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function stringField(value, name, { required = false, nullable = false, maxLength } = {}) {
|
|
27
|
-
if (value === undefined) {
|
|
28
|
-
if (required) {
|
|
29
|
-
throw new ApiError(400, "INVALID_FIELD", `'${name}' is required`);
|
|
30
|
-
}
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
if (nullable && value === null) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
if (typeof value !== "string") {
|
|
37
|
-
throw new ApiError(400, "INVALID_FIELD", `'${name}' must be a string${nullable ? " or null" : ""}`);
|
|
38
|
-
}
|
|
39
|
-
const normalized = value.trim();
|
|
40
|
-
if (required && normalized.length === 0) {
|
|
41
|
-
throw new ApiError(400, "INVALID_FIELD", `'${name}' cannot be empty`);
|
|
42
|
-
}
|
|
43
|
-
if (normalized.length > maxLength) {
|
|
44
|
-
throw new ApiError(400, "INVALID_FIELD", `'${name}' cannot exceed ${maxLength} characters`);
|
|
45
|
-
}
|
|
46
|
-
return normalized;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function parseDueDate(value, name = "dueDate") {
|
|
50
|
-
const date = stringField(value, name, { nullable: true, maxLength: 10 });
|
|
51
|
-
if (date !== null && date !== undefined && !/^\d{4}-\d{2}-\d{2}$/.test(date)) {
|
|
52
|
-
throw new ApiError(400, "INVALID_FIELD", `'${name}' must use YYYY-MM-DD`);
|
|
53
|
-
}
|
|
54
|
-
return date;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function parseRecurrence(value) {
|
|
58
|
-
if (value === null) return null;
|
|
59
|
-
assertPlainObject(value);
|
|
60
|
-
assertAllowedKeys(value, new Set(["interval", "unit"]));
|
|
61
|
-
if (!Number.isSafeInteger(value.interval) || value.interval < 1 || value.interval > 365) {
|
|
62
|
-
throw new ApiError(400, "INVALID_FIELD", "'recurrence.interval' must be an integer from 1 to 365");
|
|
63
|
-
}
|
|
64
|
-
if (!["day", "week", "month", "year"].includes(value.unit)) {
|
|
65
|
-
throw new ApiError(400, "INVALID_FIELD", "'recurrence.unit' must be day, week, month, or year");
|
|
66
|
-
}
|
|
67
|
-
return { interval: value.interval, unit: value.unit };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function parseSortOrder(value) {
|
|
71
|
-
if (typeof value !== "number" || !Number.isFinite(value) || Math.abs(value) > 1_000_000_000_000) {
|
|
72
|
-
throw new ApiError(400, "INVALID_FIELD", "'sortOrder' must be a finite number between -1000000000000 and 1000000000000");
|
|
73
|
-
}
|
|
74
|
-
return value;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function parseLabels(value) {
|
|
78
|
-
if (!Array.isArray(value) || value.length > 20) {
|
|
79
|
-
throw new ApiError(400, "INVALID_FIELD", "'labels' must be an array with at most 20 entries");
|
|
80
|
-
}
|
|
81
|
-
const labels = value.map((label) => {
|
|
82
|
-
if (typeof label !== "string") {
|
|
83
|
-
throw new ApiError(400, "INVALID_FIELD", "Every label must be a string");
|
|
84
|
-
}
|
|
85
|
-
const normalized = label.trim();
|
|
86
|
-
if (normalized.length === 0 || normalized.length > 64) {
|
|
87
|
-
throw new ApiError(400, "INVALID_FIELD", "Labels must contain 1 to 64 characters");
|
|
88
|
-
}
|
|
89
|
-
return normalized;
|
|
90
|
-
});
|
|
91
|
-
if (new Set(labels).size !== labels.length) {
|
|
92
|
-
throw new ApiError(400, "INVALID_FIELD", "Labels must be unique");
|
|
93
|
-
}
|
|
94
|
-
return labels;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function parseStatus(value, fallback) {
|
|
98
|
-
const result = value ?? fallback;
|
|
99
|
-
if (!isTaskStatus(result)) {
|
|
100
|
-
throw new ApiError(400, "INVALID_FIELD", `'status' must be one of: ${TASK_STATUSES.join(", ")}`);
|
|
101
|
-
}
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export function parsePriority(value, fallback) {
|
|
106
|
-
const result = value ?? fallback;
|
|
107
|
-
if (!isTaskPriority(result)) {
|
|
108
|
-
throw new ApiError(400, "INVALID_FIELD", "'priority' must be none, urgent, high, medium, or low");
|
|
109
|
-
}
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function slugify(value) {
|
|
114
|
-
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function parseProjectLabel(body) {
|
|
118
|
-
assertPlainObject(body);
|
|
119
|
-
assertAllowedKeys(body, new Set(["label"]));
|
|
120
|
-
return stringField(body.label, "label", { required: true, maxLength: 64 });
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export function parseThreadId(value) {
|
|
124
|
-
if (value === undefined) return undefined;
|
|
125
|
-
return stringField(value, "threadId", { required: true, maxLength: 256 });
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export function parseAssigneeTarget(value) {
|
|
129
|
-
if (value === undefined) return undefined;
|
|
130
|
-
if (value !== "current-user" && value !== "codex-agent") {
|
|
131
|
-
throw new ApiError(400, "INVALID_FIELD", "'assigneeTarget' must be current-user or codex-agent");
|
|
132
|
-
}
|
|
133
|
-
return value;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export function parseRelationOrigin(value) {
|
|
137
|
-
if (value === undefined) return undefined;
|
|
138
|
-
if (value !== "manual" && value !== "mention") {
|
|
139
|
-
throw new ApiError(400, "INVALID_FIELD", "'origin' must be manual or mention");
|
|
140
|
-
}
|
|
141
|
-
return value;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const PROJECT_ID_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
145
|
-
|
|
146
|
-
export function parseVersion(value, { allowZero = false } = {}) {
|
|
147
|
-
if (!Number.isSafeInteger(value) || value < (allowZero ? 0 : 1)) {
|
|
148
|
-
throw new ApiError(
|
|
149
|
-
400,
|
|
150
|
-
"INVALID_FIELD",
|
|
151
|
-
`'version' must be a ${allowZero ? "non-negative" : "positive"} integer`,
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
return value;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export function validateProjectId(value, { required = true } = {}) {
|
|
158
|
-
const id = stringField(value, "id", { required, maxLength: 64 });
|
|
159
|
-
if (id !== undefined && !PROJECT_ID_PATTERN.test(id)) {
|
|
160
|
-
throw new ApiError(400, "INVALID_FIELD", "'id' must be a lowercase slug containing letters, numbers, or hyphens");
|
|
161
|
-
}
|
|
162
|
-
return id;
|
|
163
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { accessSync, constants } from "node:fs";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
|
|
5
|
-
function executableFile(candidate) {
|
|
6
|
-
try {
|
|
7
|
-
accessSync(candidate, constants.X_OK);
|
|
8
|
-
return candidate;
|
|
9
|
-
} catch {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function executableOnPath(env, platform) {
|
|
15
|
-
for (const directory of (env.PATH || "").split(path.delimiter)) {
|
|
16
|
-
if (!directory) continue;
|
|
17
|
-
if (platform === "win32") {
|
|
18
|
-
const nativeExecutable = executableFile(path.join(directory, "codex.exe"));
|
|
19
|
-
if (nativeExecutable) return nativeExecutable;
|
|
20
|
-
|
|
21
|
-
const npmEntry = executableFile(path.join(
|
|
22
|
-
directory,
|
|
23
|
-
"node_modules",
|
|
24
|
-
"@openai",
|
|
25
|
-
"codex",
|
|
26
|
-
"bin",
|
|
27
|
-
"codex.js",
|
|
28
|
-
));
|
|
29
|
-
if (npmEntry) return npmEntry;
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const executable = executableFile(path.join(directory, "codex"));
|
|
34
|
-
if (executable) return executable;
|
|
35
|
-
}
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function codexExecutableInApp(appPath, platform = process.platform) {
|
|
40
|
-
if (platform === "win32") {
|
|
41
|
-
return path.win32.join(path.win32.dirname(appPath), "resources", "codex.exe");
|
|
42
|
-
}
|
|
43
|
-
if (platform === "linux") return "/usr/lib/chatgpt/resources/codex";
|
|
44
|
-
return path.join(appPath, "Contents", "Resources", "codex");
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function resolveCodexExecutable({
|
|
48
|
-
explicit = process.env.CODEX_EXECUTABLE,
|
|
49
|
-
appPath,
|
|
50
|
-
env = process.env,
|
|
51
|
-
platform = process.platform,
|
|
52
|
-
homeDirectory = os.homedir(),
|
|
53
|
-
} = {}) {
|
|
54
|
-
if (typeof explicit === "string" && explicit.trim()) return explicit.trim();
|
|
55
|
-
|
|
56
|
-
if (appPath) {
|
|
57
|
-
const bundled = executableFile(codexExecutableInApp(appPath, platform));
|
|
58
|
-
if (bundled) return bundled;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const installedCli = executableOnPath(env, platform);
|
|
62
|
-
if (installedCli) return installedCli;
|
|
63
|
-
|
|
64
|
-
if (platform === "darwin") {
|
|
65
|
-
for (const applicationDirectory of ["/Applications", path.join(homeDirectory, "Applications")]) {
|
|
66
|
-
for (const applicationName of ["ChatGPT.app", "Codex.app"]) {
|
|
67
|
-
const bundled = executableFile(codexExecutableInApp(
|
|
68
|
-
path.join(applicationDirectory, applicationName),
|
|
69
|
-
platform,
|
|
70
|
-
));
|
|
71
|
-
if (bundled) return bundled;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return "codex";
|
|
77
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Stored sandbox values are product permission choices, not literal Codex sandbox modes.
|
|
2
|
-
export function resolveCodexPermissions(sandbox) {
|
|
3
|
-
const fullAccess = sandbox === "danger-full-access";
|
|
4
|
-
return {
|
|
5
|
-
sandbox: fullAccess ? "danger-full-access" : "workspace-write",
|
|
6
|
-
approvalPolicy: fullAccess ? "never" : "on-request",
|
|
7
|
-
reviewer: fullAccess ? null : sandbox === "read-only" ? "user" : "auto_review",
|
|
8
|
-
};
|
|
9
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type ReferenceKind = "skill" | "agent";
|
|
2
|
-
|
|
3
|
-
export const COMPOSER_REFERENCE_FORMAT: "taskboard.composer-reference.v1";
|
|
4
|
-
export function encodeComposerReferenceKey(stableId: string): string;
|
|
5
|
-
export function decodeComposerReferenceKey(referenceKey: string): string;
|
|
6
|
-
export function readComposerReferenceId(referenceKey: string, kind?: string): string | null;
|
|
7
|
-
export function composerReferenceUri(kind: ReferenceKind, stableId: string): string;
|
|
8
|
-
export function composerReferencePersistence(kind: ReferenceKind, stableId: string, label: string): {
|
|
9
|
-
format: typeof COMPOSER_REFERENCE_FORMAT;
|
|
10
|
-
kind: ReferenceKind;
|
|
11
|
-
referenceKey: string;
|
|
12
|
-
markdown: string;
|
|
13
|
-
};
|
|
14
|
-
export function parseComposerReferenceUri(uri: string): {
|
|
15
|
-
format: typeof COMPOSER_REFERENCE_FORMAT;
|
|
16
|
-
kind: ReferenceKind;
|
|
17
|
-
referenceKey: string;
|
|
18
|
-
stableId: string;
|
|
19
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
const REFERENCE_FORMAT = "taskboard.composer-reference.v1";
|
|
2
|
-
const REFERENCE_PREFIX = "taskboard://composer-reference/v1";
|
|
3
|
-
const REFERENCE_KINDS = new Set(["skill", "agent"]);
|
|
4
|
-
|
|
5
|
-
function requiredString(value, name) {
|
|
6
|
-
if (typeof value !== "string" || value.length === 0) {
|
|
7
|
-
throw new TypeError(`${name} must be a non-empty string`);
|
|
8
|
-
}
|
|
9
|
-
return value;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function encodeComposerReferenceKey(stableId) {
|
|
13
|
-
let binary = "";
|
|
14
|
-
for (const byte of new TextEncoder().encode(requiredString(stableId, "stableId"))) {
|
|
15
|
-
binary += String.fromCharCode(byte);
|
|
16
|
-
}
|
|
17
|
-
return btoa(binary)
|
|
18
|
-
.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function decodeComposerReferenceKey(referenceKey) {
|
|
22
|
-
const key = requiredString(referenceKey, "referenceKey");
|
|
23
|
-
if (!/^[A-Za-z0-9_-]+$/.test(key)) {
|
|
24
|
-
throw new TypeError("referenceKey must be unpadded base64url");
|
|
25
|
-
}
|
|
26
|
-
let decoded;
|
|
27
|
-
try {
|
|
28
|
-
const padded = `${key.replace(/-/g, "+").replace(/_/g, "/")}${"=".repeat((4 - key.length % 4) % 4)}`;
|
|
29
|
-
const bytes = Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));
|
|
30
|
-
decoded = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
|
|
31
|
-
} catch {
|
|
32
|
-
throw new TypeError("referenceKey is not canonical base64url UTF-8");
|
|
33
|
-
}
|
|
34
|
-
if (!decoded || encodeComposerReferenceKey(decoded) !== key) {
|
|
35
|
-
throw new TypeError("referenceKey is not canonical base64url UTF-8");
|
|
36
|
-
}
|
|
37
|
-
return decoded;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function readComposerReferenceId(referenceKey, kind) {
|
|
41
|
-
try {
|
|
42
|
-
const stableId = decodeComposerReferenceKey(referenceKey);
|
|
43
|
-
return kind === "skill" && stableId !== stableId.normalize("NFC") ? null : stableId;
|
|
44
|
-
} catch {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function assertReferenceKind(kind) {
|
|
50
|
-
if (!REFERENCE_KINDS.has(kind)) {
|
|
51
|
-
throw new TypeError("kind must be 'skill' or 'agent'");
|
|
52
|
-
}
|
|
53
|
-
return kind;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function escapedMarkdownLabel(label) {
|
|
57
|
-
return requiredString(label, "label").replace(/[\\[\]]/g, "\\$&");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function composerReferenceUri(kind, stableId) {
|
|
61
|
-
return `${REFERENCE_PREFIX}/${assertReferenceKind(kind)}/${encodeComposerReferenceKey(stableId)}`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function composerReferencePersistence(kind, stableId, label) {
|
|
65
|
-
const normalizedStableId = kind === "skill"
|
|
66
|
-
? requiredString(stableId, "stableId").normalize("NFC")
|
|
67
|
-
: requiredString(stableId, "stableId");
|
|
68
|
-
const referenceKey = encodeComposerReferenceKey(normalizedStableId);
|
|
69
|
-
const uri = `${REFERENCE_PREFIX}/${assertReferenceKind(kind)}/${referenceKey}`;
|
|
70
|
-
return {
|
|
71
|
-
format: REFERENCE_FORMAT,
|
|
72
|
-
kind,
|
|
73
|
-
referenceKey,
|
|
74
|
-
markdown: `[${escapedMarkdownLabel(label)}](${uri})`,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function parseComposerReferenceUri(uri) {
|
|
79
|
-
const value = requiredString(uri, "uri");
|
|
80
|
-
const match = /^taskboard:\/\/composer-reference\/v1\/([^/]+)\/([^/]+)$/.exec(value);
|
|
81
|
-
if (!match) throw new TypeError("uri is not a composer reference v1 URI");
|
|
82
|
-
const kind = assertReferenceKind(match[1]);
|
|
83
|
-
const stableId = decodeComposerReferenceKey(match[2]);
|
|
84
|
-
if (kind === "skill" && stableId !== stableId.normalize("NFC")) {
|
|
85
|
-
throw new TypeError("skill reference identity must use NFC normalization");
|
|
86
|
-
}
|
|
87
|
-
return { format: REFERENCE_FORMAT, kind, referenceKey: match[2], stableId };
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export const COMPOSER_REFERENCE_FORMAT = REFERENCE_FORMAT;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export const TASK_STATUSES = [
|
|
2
|
-
"backlog",
|
|
3
|
-
"todo",
|
|
4
|
-
"in_progress",
|
|
5
|
-
"in_review",
|
|
6
|
-
"blocked",
|
|
7
|
-
"done",
|
|
8
|
-
"canceled",
|
|
9
|
-
];
|
|
10
|
-
export const TASK_PRIORITIES = ["none", "urgent", "high", "medium", "low"];
|
|
11
|
-
|
|
12
|
-
export const DEFAULT_PROJECT_ID = "local";
|
|
13
|
-
export const JIRA_PROJECT_ID = "jira-my-tasks";
|
|
14
|
-
export const DEFAULT_LABEL_NAMES = [
|
|
15
|
-
"缺陷",
|
|
16
|
-
"特性",
|
|
17
|
-
"for-claude",
|
|
18
|
-
"hold",
|
|
19
|
-
"改进",
|
|
20
|
-
"phase-1",
|
|
21
|
-
"phase-2",
|
|
22
|
-
"phase-3",
|
|
23
|
-
"phase-4",
|
|
24
|
-
"phase-5",
|
|
25
|
-
"phase-6",
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
export function isTaskStatus(value) {
|
|
29
|
-
return TASK_STATUSES.includes(value);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function isTaskPriority(value) {
|
|
33
|
-
return TASK_PRIORITIES.includes(value);
|
|
34
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
|
|
3
|
-
const NODE_SCRIPT_EXTENSIONS = new Set([".cjs", ".js", ".mjs"]);
|
|
4
|
-
|
|
5
|
-
export function executableCommand(executable, args = []) {
|
|
6
|
-
if (NODE_SCRIPT_EXTENSIONS.has(path.extname(executable).toLowerCase())) {
|
|
7
|
-
return {
|
|
8
|
-
executable: process.execPath,
|
|
9
|
-
args: [executable, ...args],
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
return { executable, args };
|
|
13
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from "node:child_process";
|
|
2
|
-
|
|
3
|
-
export function signalProcessTree(child, signal) {
|
|
4
|
-
if (process.platform === "win32" && Number.isInteger(child?.pid)) {
|
|
5
|
-
const result = spawnSync(
|
|
6
|
-
"taskkill.exe",
|
|
7
|
-
["/PID", String(child.pid), "/T", "/F"],
|
|
8
|
-
{ stdio: "ignore", windowsHide: true },
|
|
9
|
-
);
|
|
10
|
-
if (result.error || result.status !== 0) {
|
|
11
|
-
try {
|
|
12
|
-
child.kill(signal);
|
|
13
|
-
} catch {}
|
|
14
|
-
}
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (Number.isInteger(child?.pid)) {
|
|
19
|
-
try {
|
|
20
|
-
process.kill(-child.pid, signal);
|
|
21
|
-
return;
|
|
22
|
-
} catch {}
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
child?.kill(signal);
|
|
26
|
-
} catch {}
|
|
27
|
-
}
|