@bf-meishijian/aip 0.0.63 → 0.0.65
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/aip-submit-outcome/SKILL.md +41 -0
- package/dist/coding-run-error.d.ts +1 -1
- package/dist/coding-run-error.d.ts.map +1 -1
- package/dist/coding-run-error.js +14 -1
- package/dist/coding-run-error.js.map +1 -1
- package/dist/coding-run-manager.d.ts +10 -2
- package/dist/coding-run-manager.d.ts.map +1 -1
- package/dist/coding-run-manager.js +111 -26
- package/dist/coding-run-manager.js.map +1 -1
- package/dist/coding-subagents.d.ts +6 -1
- package/dist/coding-subagents.d.ts.map +1 -1
- package/dist/coding-subagents.js +306 -73
- package/dist/coding-subagents.js.map +1 -1
- package/dist/command-executor.d.ts.map +1 -1
- package/dist/command-executor.js +6 -1
- package/dist/command-executor.js.map +1 -1
- package/dist/compaction-manager.d.ts.map +1 -1
- package/dist/compaction-manager.js +1 -0
- package/dist/compaction-manager.js.map +1 -1
- package/dist/delivery-files.d.ts +8 -1
- package/dist/delivery-files.d.ts.map +1 -1
- package/dist/delivery-files.js +22 -6
- package/dist/delivery-files.js.map +1 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/general-run-client.d.ts +2 -1
- package/dist/general-run-client.d.ts.map +1 -1
- package/dist/general-run-client.js +2 -2
- package/dist/general-run-client.js.map +1 -1
- package/dist/general-run-manager.d.ts.map +1 -1
- package/dist/general-run-manager.js +69 -14
- package/dist/general-run-manager.js.map +1 -1
- package/dist/general-run-supervisor.d.ts.map +1 -1
- package/dist/general-run-supervisor.js +17 -2
- package/dist/general-run-supervisor.js.map +1 -1
- package/dist/general-run-tools.d.ts +3 -0
- package/dist/general-run-tools.d.ts.map +1 -1
- package/dist/general-run-tools.js +175 -31
- package/dist/general-run-tools.js.map +1 -1
- package/dist/host-status.d.ts.map +1 -1
- package/dist/local-employee-runtime.d.ts +1 -0
- package/dist/local-employee-runtime.d.ts.map +1 -1
- package/dist/local-employee-runtime.js +106 -96
- package/dist/local-employee-runtime.js.map +1 -1
- package/dist/local-handoff-workspace.d.ts +27 -0
- package/dist/local-handoff-workspace.d.ts.map +1 -0
- package/dist/local-handoff-workspace.js +71 -0
- package/dist/local-handoff-workspace.js.map +1 -0
- package/dist/outcome-cli.d.ts +3 -0
- package/dist/outcome-cli.d.ts.map +1 -0
- package/dist/outcome-cli.js +91 -0
- package/dist/outcome-cli.js.map +1 -0
- package/dist/pi-model-retry.d.ts +16 -0
- package/dist/pi-model-retry.d.ts.map +1 -0
- package/dist/pi-model-retry.js +79 -0
- package/dist/pi-model-retry.js.map +1 -0
- package/dist/pi-model-service.d.ts.map +1 -1
- package/dist/platform-client.d.ts.map +1 -1
- package/dist/qa-session-manager.d.ts.map +1 -1
- package/dist/qa-session-manager.js +46 -38
- package/dist/qa-session-manager.js.map +1 -1
- package/dist/skill-bundle-cache.js +1 -1
- package/dist/skill-directory-names.js +2 -58
- package/dist/skill-storage.d.ts +8 -1
- package/dist/skill-storage.d.ts.map +1 -1
- package/dist/skill-storage.js +37 -5
- package/dist/skill-storage.js.map +1 -1
- package/dist/tool-dispatch.js +1 -1
- package/dist/workflow-guidance.js +9 -12
- package/dist/worktree-state.d.ts +2 -2
- package/dist/worktree-state.d.ts.map +1 -1
- package/dist/worktree-state.js +6 -3
- package/dist/worktree-state.js.map +1 -1
- package/package.json +9 -9
- package/dist/generated/local-native-tools.js +0 -80
- package/dist/pi-path-utils.js +0 -141
- package/dist/skill-bundle.js +0 -9
package/dist/worktree-state.js
CHANGED
|
@@ -44,15 +44,18 @@ export function branchMissingFailure(error) {
|
|
|
44
44
|
const code = error instanceof Error ? error.message.split(/[::]/u, 1)[0] : undefined;
|
|
45
45
|
return code && descriptions[code] ? { code, message: descriptions[code] } : undefined;
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
48
|
-
export async function synchronizeRemoteWorkspace(cwd, branch) {
|
|
47
|
+
/** 核对已有工作区的远端分支。准备阶段稍后发布材料时,可保留尚未发布的本地分支。 */
|
|
48
|
+
export async function synchronizeRemoteWorkspace(cwd, branch, allowUnpublished = false) {
|
|
49
49
|
await exec("git", ["fetch", "--prune", "origin"], { cwd }).catch((error) => {
|
|
50
50
|
throw gitFailure("CODING_REPOSITORY_ACCESS_FAILED", error);
|
|
51
51
|
});
|
|
52
52
|
const remote = `refs/remotes/origin/${branch}`;
|
|
53
53
|
const exists = await exec("git", ["show-ref", "--verify", "--quiet", remote], { cwd }).then(() => true, missingGitRef);
|
|
54
|
-
if (!exists)
|
|
54
|
+
if (!exists) {
|
|
55
|
+
if (allowUnpublished)
|
|
56
|
+
return;
|
|
55
57
|
throw new Error("CODING_BRANCH_NOT_PUBLISHED:远端尚无工单分支,请先推送后再继续。");
|
|
58
|
+
}
|
|
56
59
|
await exec("git", ["branch", "--set-upstream-to", `origin/${branch}`, branch], { cwd });
|
|
57
60
|
const counts = (await exec("git", ["rev-list", "--left-right", "--count", `HEAD...${remote}`], { cwd })).stdout
|
|
58
61
|
.trim()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-state.js","sourceRoot":"","sources":["../src/worktree-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAElF,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,GAAW;IACtD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACxF,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAClD,2FAA2F;QAC3F,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,MAAM,wBAAw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,GAAG,EAAE,CAAC,CACxF,CAAC,MAAM;SACL,IAAI,EAAE;SACN,KAAK,CAAC,MAAM,CAAC;SACb,GAAG,CAAC,MAAM,CAAC,CAAC;IACf,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,mEAAmE;IAC3F,IAAI,MAAM,CAAC,CAAC,CAAC;QACX,MAAM,IAAI,KAAK,CACb,yDAAyD,CAC1D,CAAC;IACJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACrE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QACtB,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bf-meishijian/aip",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.65",
|
|
4
4
|
"description": "AI Platform Local Coding Host",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@modelcontextprotocol/client": "2.0.0",
|
|
15
|
-
"@earendil-works/pi-agent-core": "1.
|
|
16
|
-
"@earendil-works/pi-ai": "1.
|
|
17
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
18
|
-
"@earendil-works/pi-tui": "1.
|
|
15
|
+
"@earendil-works/pi-agent-core": "1.7.0",
|
|
16
|
+
"@earendil-works/pi-ai": "1.7.0",
|
|
17
|
+
"@earendil-works/pi-coding-agent": "1.7.0",
|
|
18
|
+
"@earendil-works/pi-tui": "1.7.0",
|
|
19
19
|
"ajv": "8.17.1",
|
|
20
20
|
"ajv-formats": "2.1.1",
|
|
21
21
|
"cross-spawn": "7.0.6",
|
|
22
22
|
"eventsource-parser": "3.1.1",
|
|
23
23
|
"fast-xml-parser": "5.11.1",
|
|
24
24
|
"npm": "11.9.0",
|
|
25
|
-
"pi-subagents": "0.
|
|
25
|
+
"pi-subagents": "0.90.0",
|
|
26
26
|
"proper-lockfile": "4.1.2",
|
|
27
27
|
"typebox": "1.1.38"
|
|
28
28
|
},
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
},
|
|
41
41
|
"license": "UNLICENSED",
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@bf-meishijian/aip-runtime-linux-x64": "0.0.
|
|
44
|
-
"@bf-meishijian/aip-runtime-
|
|
45
|
-
"@bf-meishijian/aip-runtime-
|
|
43
|
+
"@bf-meishijian/aip-runtime-linux-x64": "0.0.65",
|
|
44
|
+
"@bf-meishijian/aip-runtime-win32-x64": "0.0.65",
|
|
45
|
+
"@bf-meishijian/aip-runtime-darwin-arm64": "0.0.65"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"tag": "latest"
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// ../../packages/api-contracts/src/generated/local-native-tools.ts
|
|
2
|
-
var LOCAL_NATIVE_TOOL_SDK_VERSION = "1.5.2";
|
|
3
|
-
var LOCAL_NATIVE_TOOL_DEFINITIONS = [
|
|
4
|
-
{
|
|
5
|
-
"name": "bash",
|
|
6
|
-
"label": "bash",
|
|
7
|
-
"description": "Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.",
|
|
8
|
-
"parametersJson": '{"type":"object","required":["command"],"properties":{"command":{"type":"string","description":"Shell command to execute"},"timeout":{"type":"number","description":"Timeout in seconds (optional, no default timeout)"}}}',
|
|
9
|
-
"promptSnippet": "Execute bash commands (ls, grep, find, etc.)",
|
|
10
|
-
"promptGuidelines": [
|
|
11
|
-
"You can inspect PI_* environment variables for current model and session details."
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"name": "powershell",
|
|
16
|
-
"label": "powershell",
|
|
17
|
-
"description": "Execute a PowerShell command in the current working directory. Returns stdout and stderr. Output is truncated to last 2000 lines or 50KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.",
|
|
18
|
-
"parametersJson": '{"type":"object","required":["command"],"properties":{"command":{"type":"string","description":"Shell command to execute"},"timeout":{"type":"number","description":"Timeout in seconds (optional, no default timeout)"}}}',
|
|
19
|
-
"promptSnippet": "Execute PowerShell commands",
|
|
20
|
-
"promptGuidelines": [
|
|
21
|
-
"You can inspect PI_* environment variables for current model and session details."
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"name": "read",
|
|
26
|
-
"label": "read",
|
|
27
|
-
"description": "Read the contents of a file. Supports text files and images (jpg, png, gif, webp, bmp). Images are sent as attachments. For text files, output is truncated to 2000 lines or 50KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.",
|
|
28
|
-
"parametersJson": '{"type":"object","required":["path"],"properties":{"path":{"type":"string","description":"Path to the file to read (relative or absolute)"},"offset":{"type":"number","description":"Line number to start reading from (1-indexed)"},"limit":{"type":"number","description":"Maximum number of lines to read"}}}',
|
|
29
|
-
"promptSnippet": "Read file contents",
|
|
30
|
-
"promptGuidelines": [
|
|
31
|
-
"Use read to examine files instead of cat or sed."
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "write",
|
|
36
|
-
"label": "write",
|
|
37
|
-
"description": "Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.",
|
|
38
|
-
"parametersJson": '{"type":"object","required":["path","content"],"properties":{"path":{"type":"string","description":"Path to the file to write (relative or absolute)"},"content":{"type":"string","description":"Content to write to the file"}}}',
|
|
39
|
-
"promptSnippet": "Create or overwrite files",
|
|
40
|
-
"promptGuidelines": [
|
|
41
|
-
"Use write only for new files or complete rewrites."
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "edit",
|
|
46
|
-
"label": "edit",
|
|
47
|
-
"description": "Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.",
|
|
48
|
-
"parametersJson": '{"type":"object","required":["path","edits"],"properties":{"path":{"type":"string","description":"Path to the file to edit (relative or absolute)"},"edits":{"type":"array","items":{"type":"object","required":["oldText","newText"],"properties":{"oldText":{"type":"string","description":"Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call."},"newText":{"type":"string","description":"Replacement text for this targeted edit."}}},"description":"One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead."}}}',
|
|
49
|
-
"promptSnippet": "Make precise file edits with exact text replacement, including multiple disjoint edits in one call",
|
|
50
|
-
"promptGuidelines": [
|
|
51
|
-
"Use edit for targeted changes. Batch changes to one file in a single call.",
|
|
52
|
-
"Each edits[].oldText must exactly and uniquely match the original file. Keep matches short and non-overlapping; merge nearby changes without including large unchanged regions."
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"name": "grep",
|
|
57
|
-
"label": "grep",
|
|
58
|
-
"description": "Search file contents for a pattern. Returns matching lines with file paths and line numbers. Respects .gitignore. Output is truncated to 100 matches or 50KB (whichever is hit first). Long lines are truncated to 500 chars.",
|
|
59
|
-
"parametersJson": `{"type":"object","required":["pattern"],"properties":{"pattern":{"type":"string","description":"Search pattern (regex or literal string)"},"path":{"type":"string","description":"Directory or file to search (default: current directory)"},"glob":{"type":"string","description":"Filter files by glob pattern, relative to path, e.g. '*.ts', 'src/**/*.ts' or '**/*.spec.ts'. A pattern without '/' matches file names at any depth"},"ignoreCase":{"type":"boolean","description":"Case-insensitive search (default: false)"},"literal":{"type":"boolean","description":"Treat pattern as literal string instead of regex (default: false)"},"context":{"type":"number","description":"Number of lines to show before and after each match (default: 0)"},"limit":{"type":"number","description":"Maximum number of matches to return (default: 100)"}}}`,
|
|
60
|
-
"promptSnippet": "Search file contents for patterns (respects .gitignore)"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"name": "find",
|
|
64
|
-
"label": "find",
|
|
65
|
-
"description": "Search for files by glob pattern. Returns matching file paths relative to the search directory. Respects .gitignore. Output is truncated to 1000 results or 50KB (whichever is hit first).",
|
|
66
|
-
"parametersJson": `{"type":"object","required":["pattern"],"properties":{"pattern":{"type":"string","description":"Glob pattern to match files, e.g. '*.ts', '**/*.json', or 'src/**/*.spec.ts'"},"path":{"type":"string","description":"Directory to search in (default: current directory)"},"limit":{"type":"number","description":"Maximum number of results (default: 1000)"}}}`,
|
|
67
|
-
"promptSnippet": "Find files by glob pattern (respects .gitignore)"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"name": "ls",
|
|
71
|
-
"label": "ls",
|
|
72
|
-
"description": "List directory contents. Returns entries sorted alphabetically, with '/' suffix for directories. Includes dotfiles. Output is truncated to 500 entries or 50KB (whichever is hit first).",
|
|
73
|
-
"parametersJson": '{"type":"object","properties":{"path":{"type":"string","description":"Directory to list (default: current directory)"},"limit":{"type":"number","description":"Maximum number of entries to return (default: 500)"}}}',
|
|
74
|
-
"promptSnippet": "List directory contents"
|
|
75
|
-
}
|
|
76
|
-
];
|
|
77
|
-
export {
|
|
78
|
-
LOCAL_NATIVE_TOOL_DEFINITIONS,
|
|
79
|
-
LOCAL_NATIVE_TOOL_SDK_VERSION
|
|
80
|
-
};
|
package/dist/pi-path-utils.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/@earendil-works+pi-coding-agent@1.5.2_patch_hash=3b91a3a24f4f471f46fd65687cdd23cf84e270_6a7a78b9e707aead62d385d13d276b00/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js
|
|
2
|
-
import { accessSync, constants } from "node:fs";
|
|
3
|
-
import { access } from "node:fs/promises";
|
|
4
|
-
|
|
5
|
-
// ../../node_modules/.pnpm/@earendil-works+pi-coding-agent@1.5.2_patch_hash=3b91a3a24f4f471f46fd65687cdd23cf84e270_6a7a78b9e707aead62d385d13d276b00/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js
|
|
6
|
-
import { homedir } from "node:os";
|
|
7
|
-
import { isAbsolute, join, resolve as nodeResolvePath, posix, relative, sep, win32 } from "node:path";
|
|
8
|
-
import { fileURLToPath } from "node:url";
|
|
9
|
-
|
|
10
|
-
// ../../node_modules/.pnpm/@earendil-works+pi-coding-agent@1.5.2_patch_hash=3b91a3a24f4f471f46fd65687cdd23cf84e270_6a7a78b9e707aead62d385d13d276b00/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js
|
|
11
|
-
import { channel } from "node:diagnostics_channel";
|
|
12
|
-
import crossSpawn from "cross-spawn";
|
|
13
|
-
var stdioRelease = channel("aip.pi.shell-stdio-release");
|
|
14
|
-
|
|
15
|
-
// ../../node_modules/.pnpm/@earendil-works+pi-coding-agent@1.5.2_patch_hash=3b91a3a24f4f471f46fd65687cdd23cf84e270_6a7a78b9e707aead62d385d13d276b00/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js
|
|
16
|
-
var UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;
|
|
17
|
-
function normalizeWindowsShellPath(filePath) {
|
|
18
|
-
if (!filePath.startsWith("/") || filePath.startsWith("//") || filePath.includes("\\"))
|
|
19
|
-
return filePath;
|
|
20
|
-
const match = filePath.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);
|
|
21
|
-
if (!match)
|
|
22
|
-
return filePath;
|
|
23
|
-
const suffix = match[2]?.replaceAll("/", "\\");
|
|
24
|
-
return `${match[1].toUpperCase()}:\\${suffix ?? ""}`;
|
|
25
|
-
}
|
|
26
|
-
function normalizePath(input, options = {}) {
|
|
27
|
-
let normalized = options.trim ? input.trim() : input;
|
|
28
|
-
if (options.normalizeUnicodeSpaces) {
|
|
29
|
-
normalized = normalized.replace(UNICODE_SPACES, " ");
|
|
30
|
-
}
|
|
31
|
-
if (options.stripAtPrefix && normalized.startsWith("@")) {
|
|
32
|
-
normalized = normalized.slice(1);
|
|
33
|
-
}
|
|
34
|
-
if (process.platform === "win32") {
|
|
35
|
-
normalized = normalizeWindowsShellPath(normalized);
|
|
36
|
-
}
|
|
37
|
-
if (options.expandTilde ?? true) {
|
|
38
|
-
const home = options.homeDir ?? homedir();
|
|
39
|
-
if (normalized === "~")
|
|
40
|
-
return home;
|
|
41
|
-
if (normalized.startsWith("~/") || process.platform === "win32" && normalized.startsWith("~\\")) {
|
|
42
|
-
return join(home, normalized.slice(2));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (/^file:\/\//.test(normalized)) {
|
|
46
|
-
return fileURLToPath(normalized);
|
|
47
|
-
}
|
|
48
|
-
return normalized;
|
|
49
|
-
}
|
|
50
|
-
function resolvePath(input, baseDir = process.cwd(), options = {}) {
|
|
51
|
-
const normalized = normalizePath(input, options);
|
|
52
|
-
const normalizedBaseDir = normalizePath(baseDir);
|
|
53
|
-
return isAbsolute(normalized) ? nodeResolvePath(normalized) : nodeResolvePath(normalizedBaseDir, normalized);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// ../../node_modules/.pnpm/@earendil-works+pi-coding-agent@1.5.2_patch_hash=3b91a3a24f4f471f46fd65687cdd23cf84e270_6a7a78b9e707aead62d385d13d276b00/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js
|
|
57
|
-
var NARROW_NO_BREAK_SPACE = "\u202F";
|
|
58
|
-
function tryMacOSScreenshotPath(filePath) {
|
|
59
|
-
return filePath.replace(/ (AM|PM)\./gi, `${NARROW_NO_BREAK_SPACE}$1.`);
|
|
60
|
-
}
|
|
61
|
-
function tryNFDVariant(filePath) {
|
|
62
|
-
return filePath.normalize("NFD");
|
|
63
|
-
}
|
|
64
|
-
function tryCurlyQuoteVariant(filePath) {
|
|
65
|
-
return filePath.replace(/'/g, "\u2019");
|
|
66
|
-
}
|
|
67
|
-
function fileExists(filePath) {
|
|
68
|
-
try {
|
|
69
|
-
accessSync(filePath, constants.F_OK);
|
|
70
|
-
return true;
|
|
71
|
-
} catch {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
async function pathExists(filePath) {
|
|
76
|
-
try {
|
|
77
|
-
await access(filePath, constants.F_OK);
|
|
78
|
-
return true;
|
|
79
|
-
} catch {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function expandPath(filePath) {
|
|
84
|
-
return normalizePath(filePath, { normalizeUnicodeSpaces: true, stripAtPrefix: true });
|
|
85
|
-
}
|
|
86
|
-
function resolveToCwd(filePath, cwd) {
|
|
87
|
-
return resolvePath(filePath, cwd, { normalizeUnicodeSpaces: true, stripAtPrefix: true });
|
|
88
|
-
}
|
|
89
|
-
function resolveReadPath(filePath, cwd) {
|
|
90
|
-
const resolved = resolveToCwd(filePath, cwd);
|
|
91
|
-
if (fileExists(resolved)) {
|
|
92
|
-
return resolved;
|
|
93
|
-
}
|
|
94
|
-
const amPmVariant = tryMacOSScreenshotPath(resolved);
|
|
95
|
-
if (amPmVariant !== resolved && fileExists(amPmVariant)) {
|
|
96
|
-
return amPmVariant;
|
|
97
|
-
}
|
|
98
|
-
const nfdVariant = tryNFDVariant(resolved);
|
|
99
|
-
if (nfdVariant !== resolved && fileExists(nfdVariant)) {
|
|
100
|
-
return nfdVariant;
|
|
101
|
-
}
|
|
102
|
-
const curlyVariant = tryCurlyQuoteVariant(resolved);
|
|
103
|
-
if (curlyVariant !== resolved && fileExists(curlyVariant)) {
|
|
104
|
-
return curlyVariant;
|
|
105
|
-
}
|
|
106
|
-
const nfdCurlyVariant = tryCurlyQuoteVariant(nfdVariant);
|
|
107
|
-
if (nfdCurlyVariant !== resolved && fileExists(nfdCurlyVariant)) {
|
|
108
|
-
return nfdCurlyVariant;
|
|
109
|
-
}
|
|
110
|
-
return resolved;
|
|
111
|
-
}
|
|
112
|
-
async function resolveReadPathAsync(filePath, cwd) {
|
|
113
|
-
const resolved = resolveToCwd(filePath, cwd);
|
|
114
|
-
if (await pathExists(resolved)) {
|
|
115
|
-
return resolved;
|
|
116
|
-
}
|
|
117
|
-
const amPmVariant = tryMacOSScreenshotPath(resolved);
|
|
118
|
-
if (amPmVariant !== resolved && await pathExists(amPmVariant)) {
|
|
119
|
-
return amPmVariant;
|
|
120
|
-
}
|
|
121
|
-
const nfdVariant = tryNFDVariant(resolved);
|
|
122
|
-
if (nfdVariant !== resolved && await pathExists(nfdVariant)) {
|
|
123
|
-
return nfdVariant;
|
|
124
|
-
}
|
|
125
|
-
const curlyVariant = tryCurlyQuoteVariant(resolved);
|
|
126
|
-
if (curlyVariant !== resolved && await pathExists(curlyVariant)) {
|
|
127
|
-
return curlyVariant;
|
|
128
|
-
}
|
|
129
|
-
const nfdCurlyVariant = tryCurlyQuoteVariant(nfdVariant);
|
|
130
|
-
if (nfdCurlyVariant !== resolved && await pathExists(nfdCurlyVariant)) {
|
|
131
|
-
return nfdCurlyVariant;
|
|
132
|
-
}
|
|
133
|
-
return resolved;
|
|
134
|
-
}
|
|
135
|
-
export {
|
|
136
|
-
expandPath,
|
|
137
|
-
pathExists,
|
|
138
|
-
resolveReadPath,
|
|
139
|
-
resolveReadPathAsync,
|
|
140
|
-
resolveToCwd
|
|
141
|
-
};
|
package/dist/skill-bundle.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// ../../packages/api-contracts/src/skill-bundle.ts
|
|
2
|
-
function canonicalSkillBundle(files) {
|
|
3
|
-
return JSON.stringify(
|
|
4
|
-
files.map(({ path, content }) => [path, content]).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)
|
|
5
|
-
);
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
canonicalSkillBundle
|
|
9
|
-
};
|