@spotpatch/runtime 1.2.0 → 1.2.1
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/index.cjs +19 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -86,7 +86,6 @@ import {
|
|
|
86
86
|
AGENT_CHECK_STATUSES,
|
|
87
87
|
AGENT_FILE_CHANGE_KINDS,
|
|
88
88
|
AGENT_JOB_STATUSES,
|
|
89
|
-
AGENT_WORKSPACE_STATES,
|
|
90
89
|
ERROR_CODES
|
|
91
90
|
} from "@spotpatch/shared";
|
|
92
91
|
var ERROR_CODE_VALUES = new Set(Object.values(ERROR_CODES));
|
|
@@ -94,7 +93,6 @@ var CAPABILITY_STATE_VALUES = new Set(AGENT_CAPABILITY_STATES);
|
|
|
94
93
|
var CHECK_STATUS_VALUES = new Set(AGENT_CHECK_STATUSES);
|
|
95
94
|
var FILE_CHANGE_KIND_VALUES = new Set(AGENT_FILE_CHANGE_KINDS);
|
|
96
95
|
var JOB_STATUS_VALUES = new Set(AGENT_JOB_STATUSES);
|
|
97
|
-
var WORKSPACE_STATE_VALUES = new Set(AGENT_WORKSPACE_STATES);
|
|
98
96
|
var PROFILE_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
99
97
|
var JOB_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
100
98
|
var ISO_TIMESTAMP_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?Z$/;
|
|
@@ -155,7 +153,7 @@ function isAgentWorkspaceHealthSnapshot(value) {
|
|
|
155
153
|
"changes",
|
|
156
154
|
"canIncludeLocalChanges",
|
|
157
155
|
"errorCode"
|
|
158
|
-
]) ||
|
|
156
|
+
]) || value.state !== "ready" && value.state !== "consent-required" && value.state !== "blocked" || !isIsoTimestamp(value.checkedAt) || typeof value.canIncludeLocalChanges !== "boolean" || value.errorCode !== void 0 && !isAgentErrorCode(value.errorCode) || !isRecord(value.changes) || !hasOnlyKeys(value.changes, [
|
|
159
157
|
"staged",
|
|
160
158
|
"unstaged",
|
|
161
159
|
"untracked",
|
|
@@ -1614,7 +1612,7 @@ var AGENT_PANEL_STYLES = `
|
|
|
1614
1612
|
font-weight: 560;
|
|
1615
1613
|
line-height: 1.35;
|
|
1616
1614
|
outline: none;
|
|
1617
|
-
transition:
|
|
1615
|
+
transition: 160ms ease;
|
|
1618
1616
|
}
|
|
1619
1617
|
.spotpatch-agent select:hover { border-color: rgb(148 163 184 / 38%); background-color: rgb(255 255 255 / 5%); }
|
|
1620
1618
|
.spotpatch-agent select:focus-visible { border-color: rgb(139 124 247 / 76%); box-shadow: 0 0 0 3px rgb(109 93 246 / 18%); }
|
|
@@ -1625,7 +1623,7 @@ var AGENT_PANEL_STYLES = `
|
|
|
1625
1623
|
.spotpatch-agent select { padding: 10px 13px; }
|
|
1626
1624
|
.spotpatch-agent select::picker-icon {
|
|
1627
1625
|
color: #9da6b5;
|
|
1628
|
-
transition: rotate 180ms cubic-bezier(.2, .8, .2, 1)
|
|
1626
|
+
transition: rotate 180ms cubic-bezier(.2, .8, .2, 1);
|
|
1629
1627
|
}
|
|
1630
1628
|
.spotpatch-agent select:open::picker-icon { rotate: 180deg; color: #c4b5fd; }
|
|
1631
1629
|
.spotpatch-agent select::picker(select) {
|
|
@@ -1638,12 +1636,10 @@ var AGENT_PANEL_STYLES = `
|
|
|
1638
1636
|
border: 1px solid rgb(139 124 247 / 28%);
|
|
1639
1637
|
border-radius: 12px;
|
|
1640
1638
|
padding: 6px;
|
|
1641
|
-
color: #e8ebf2;
|
|
1642
1639
|
background: #10151e;
|
|
1643
|
-
box-shadow: 0 18px 50px rgb(0 0 0 / 38%)
|
|
1640
|
+
box-shadow: 0 18px 50px rgb(0 0 0 / 38%);
|
|
1644
1641
|
opacity: 0;
|
|
1645
1642
|
transform: translateY(-5px) scale(.985);
|
|
1646
|
-
transform-origin: top center;
|
|
1647
1643
|
transition: opacity 150ms ease, transform 180ms cubic-bezier(.2, .8, .2, 1), overlay 180ms allow-discrete, display 180ms allow-discrete;
|
|
1648
1644
|
}
|
|
1649
1645
|
::picker(select):popover-open { opacity: 1; transform: translateY(0) scale(1); }
|
|
@@ -1657,7 +1653,6 @@ var AGENT_PANEL_STYLES = `
|
|
|
1657
1653
|
color: #dfe4ee;
|
|
1658
1654
|
background: transparent;
|
|
1659
1655
|
cursor: pointer;
|
|
1660
|
-
transition: color 120ms ease, background-color 120ms ease;
|
|
1661
1656
|
}
|
|
1662
1657
|
.spotpatch-agent select option:hover,
|
|
1663
1658
|
.spotpatch-agent select option:focus { color: #fff; background: rgb(109 93 246 / 16%); }
|
|
@@ -2343,16 +2338,16 @@ var ERROR_MESSAGES_EN = Object.freeze({
|
|
|
2343
2338
|
[ERROR_CODES2.AGENT_BUSY]: "Another write Agent job is still active.",
|
|
2344
2339
|
[ERROR_CODES2.AGENT_LIMIT_EXCEEDED]: "The Agent stopped at a configured time, turn, output, or size limit.",
|
|
2345
2340
|
[ERROR_CODES2.AGENT_CANCELLED]: "The Agent job was cancelled.",
|
|
2346
|
-
[ERROR_CODES2.WORKTREE_DIRTY]: "
|
|
2347
|
-
[ERROR_CODES2.WORKTREE_NOT_REPOSITORY]: "
|
|
2348
|
-
[ERROR_CODES2.WORKTREE_OPERATION_IN_PROGRESS]: "Finish the active merge, rebase, cherry-pick, or revert
|
|
2349
|
-
[ERROR_CODES2.WORKTREE_CONFLICTED]: "Resolve all
|
|
2350
|
-
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_TOO_LARGE]: "
|
|
2351
|
-
[ERROR_CODES2.WORKTREE_UNTRACKED_UNSUPPORTED]: "An untracked
|
|
2352
|
-
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_UNSUPPORTED]: "Local changes
|
|
2341
|
+
[ERROR_CODES2.WORKTREE_DIRTY]: "Confirm inclusion of local changes before running AI.",
|
|
2342
|
+
[ERROR_CODES2.WORKTREE_NOT_REPOSITORY]: "Vite root must be an initialized Git repository root.",
|
|
2343
|
+
[ERROR_CODES2.WORKTREE_OPERATION_IN_PROGRESS]: "Finish the active merge, rebase, cherry-pick, or revert.",
|
|
2344
|
+
[ERROR_CODES2.WORKTREE_CONFLICTED]: "Resolve all Git conflicts before running AI.",
|
|
2345
|
+
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_TOO_LARGE]: "Reduce untracked files below the safe count and size limits.",
|
|
2346
|
+
[ERROR_CODES2.WORKTREE_UNTRACKED_UNSUPPORTED]: "An untracked path is missing, linked, or not a regular file.",
|
|
2347
|
+
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_UNSUPPORTED]: "Local changes cannot be isolated safely.",
|
|
2353
2348
|
[ERROR_CODES2.TOOL_DENIED]: "A model tool request violated the local safety policy.",
|
|
2354
|
-
[ERROR_CODES2.TOOL_INPUT_INVALID]: "The model sent invalid tool arguments or reused a tool
|
|
2355
|
-
[ERROR_CODES2.TOOL_PATH_DENIED]: "The model
|
|
2349
|
+
[ERROR_CODES2.TOOL_INPUT_INVALID]: "The model sent invalid tool arguments or reused a tool ID.",
|
|
2350
|
+
[ERROR_CODES2.TOOL_PATH_DENIED]: "The model requested a protected, linked, non-text, or external path.",
|
|
2356
2351
|
[ERROR_CODES2.PATCH_REJECTED]: "The proposed patch did not pass local policy.",
|
|
2357
2352
|
[ERROR_CODES2.VALIDATION_FAILED]: "Required project checks failed. The change cannot be applied.",
|
|
2358
2353
|
[ERROR_CODES2.APPLY_CONFLICT]: "Project files changed after the Agent baseline; no overwrite was performed.",
|
|
@@ -2379,13 +2374,13 @@ var ERROR_MESSAGES_ZH = Object.freeze({
|
|
|
2379
2374
|
[ERROR_CODES2.WORKTREE_DIRTY]: "\u8FD0\u884C AI \u524D\uFF0C\u8BF7\u660E\u786E\u540C\u610F\u5C06\u5F53\u524D\u672C\u5730\u4FEE\u6539\u7EB3\u5165\u9694\u79BB\u57FA\u7EBF\u3002",
|
|
2380
2375
|
[ERROR_CODES2.WORKTREE_NOT_REPOSITORY]: "Vite \u6839\u76EE\u5F55\u4E0D\u662F\u5DF2\u521D\u59CB\u5316 Git \u4ED3\u5E93\u7684\u9876\u5C42\u76EE\u5F55\u3002",
|
|
2381
2376
|
[ERROR_CODES2.WORKTREE_OPERATION_IN_PROGRESS]: "\u8BF7\u5148\u5B8C\u6210\u5F53\u524D merge\u3001rebase\u3001cherry-pick \u6216 revert\uFF0C\u518D\u8FD0\u884C AI\u3002",
|
|
2382
|
-
[ERROR_CODES2.WORKTREE_CONFLICTED]: "\u8BF7\u5148\u89E3\u51B3\u5168\u90E8
|
|
2383
|
-
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_TOO_LARGE]: "\
|
|
2384
|
-
[ERROR_CODES2.WORKTREE_UNTRACKED_UNSUPPORTED]: "\
|
|
2385
|
-
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_UNSUPPORTED]: "\u672C\u5730\u4FEE\u6539\
|
|
2377
|
+
[ERROR_CODES2.WORKTREE_CONFLICTED]: "\u8BF7\u5148\u89E3\u51B3\u5168\u90E8 Git \u51B2\u7A81\uFF0C\u518D\u8FD0\u884C AI\u3002",
|
|
2378
|
+
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_TOO_LARGE]: "\u672A\u8DDF\u8E2A\u6587\u4EF6\u8D85\u8FC7\u5B89\u5168\u6570\u91CF\u6216\u4F53\u79EF\u4E0A\u9650\uFF0C\u8BF7\u5148\u7CBE\u7B80\u3002",
|
|
2379
|
+
[ERROR_CODES2.WORKTREE_UNTRACKED_UNSUPPORTED]: "\u672A\u8DDF\u8E2A\u9879\u5DF2\u4E22\u5931\u3001\u662F\u7B26\u53F7\u94FE\u63A5\u6216\u4E0D\u662F\u666E\u901A\u6587\u4EF6\u3002",
|
|
2380
|
+
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_UNSUPPORTED]: "\u5F53\u524D\u672C\u5730\u4FEE\u6539\u65E0\u6CD5\u5B89\u5168\u9694\u79BB\u3002",
|
|
2386
2381
|
[ERROR_CODES2.TOOL_DENIED]: "\u6A21\u578B\u5DE5\u5177\u8BF7\u6C42\u8FDD\u53CD\u672C\u5730\u5B89\u5168\u7B56\u7565\u3002",
|
|
2387
|
-
[ERROR_CODES2.TOOL_INPUT_INVALID]: "\u6A21\u578B\u53D1\u9001\u4E86\u65E0\u6548\u5DE5\u5177\u53C2\u6570\uFF0C\u6216\
|
|
2388
|
-
[ERROR_CODES2.TOOL_PATH_DENIED]: "\u6A21\u578B\
|
|
2382
|
+
[ERROR_CODES2.TOOL_INPUT_INVALID]: "\u6A21\u578B\u53D1\u9001\u4E86\u65E0\u6548\u5DE5\u5177\u53C2\u6570\uFF0C\u6216\u590D\u7528\u4E86\u5DE5\u5177\u8C03\u7528 ID\u3002",
|
|
2383
|
+
[ERROR_CODES2.TOOL_PATH_DENIED]: "\u6A21\u578B\u8BF7\u6C42\u4E86\u53D7\u4FDD\u62A4\u3001\u975E\u6587\u672C\u3001\u7B26\u53F7\u94FE\u63A5\u6216\u9879\u76EE\u5916\u8DEF\u5F84\u3002",
|
|
2389
2384
|
[ERROR_CODES2.PATCH_REJECTED]: "\u5EFA\u8BAE\u8865\u4E01\u672A\u901A\u8FC7\u672C\u5730\u7B56\u7565\u68C0\u67E5\u3002",
|
|
2390
2385
|
[ERROR_CODES2.VALIDATION_FAILED]: "\u9879\u76EE\u5FC5\u9700\u68C0\u67E5\u5931\u8D25\uFF0C\u4E0D\u80FD\u5E94\u7528\u672C\u6B21\u53D8\u66F4\u3002",
|
|
2391
2386
|
[ERROR_CODES2.APPLY_CONFLICT]: "Agent \u5EFA\u7ACB\u57FA\u7EBF\u540E\u9879\u76EE\u6587\u4EF6\u5DF2\u53D8\u5316\uFF0C\u672A\u6267\u884C\u8986\u76D6\u3002",
|