orizu 0.5.36 → 0.5.38
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/hosted-harvest.d.ts.map +1 -1
- package/dist/hosted-harvest.js +11 -1
- package/dist/hosted-skill-staging.d.ts +8 -3
- package/dist/hosted-skill-staging.d.ts.map +1 -1
- package/dist/hosted-skill-staging.js +10 -3
- package/package.json +1 -1
- package/src/hosted-harvest.ts +11 -1
- package/src/hosted-skill-staging.ts +11 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-harvest.d.ts","sourceRoot":"","sources":["../src/hosted-harvest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAaH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,iBAAiB,CAAA;AAExE,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAA;IACrB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAA;IACxB,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,0EAA0E;IAC1E,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACvC,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,qEAAqE;IACrE,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB;;;;;;;OAOG;IACH,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CAAA;IACzB,0EAA0E;IAC1E,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACvC,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,qEAAqE;IACrE,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAElD,eAAO,MAAM,mCAAmC,0GAItC,CAAA;AAEV,eAAO,MAAM,iCAAiC,+EAGpC,CAAA;AAEV,eAAO,MAAM,+BAA+B;;;;CAgBlC,CAAA;AAUV,wBAAgB,4BAA4B,CAC1C,UAAU,GAAE,SAAS,MAAM,EAAwC,GAClE,MAAM,GAAG,IAAI,CAEf;AA6GD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,CAmKrE"}
|
package/dist/hosted-harvest.js
CHANGED
|
@@ -235,10 +235,20 @@ export function harvestWorkspace(opts) {
|
|
|
235
235
|
}
|
|
236
236
|
const dirty = status.stdout.trim().length > 0;
|
|
237
237
|
if (dirty) {
|
|
238
|
-
|
|
238
|
+
// Add everything, then unstage the staged skill link. An exclude
|
|
239
|
+
// pathspec on add makes git exit 1 once bootstrap has ignored
|
|
240
|
+
// .claude/skills ("paths are ignored"), which is every hosted session
|
|
241
|
+
// (ORI-2441, git 2.49 in the sandbox). Only the link's own path is reset,
|
|
242
|
+
// so an agent's edits to a team's tracked skills next to it are saved;
|
|
243
|
+
// reset, unlike rm --cached, never deletes a tracked file.
|
|
244
|
+
const add = exec(['add', '-A', '--', '.']);
|
|
239
245
|
if (add.exitCode !== 0) {
|
|
240
246
|
return { kind: 'work_persist_failed', error: `git add failed: ${detail(add)}` };
|
|
241
247
|
}
|
|
248
|
+
const unstage = exec(['reset', '-q', '--', '.claude/skills/orizu']);
|
|
249
|
+
if (unstage.exitCode !== 0) {
|
|
250
|
+
return { kind: 'work_persist_failed', error: `git reset of .claude/skills/orizu failed: ${detail(unstage)}` };
|
|
251
|
+
}
|
|
242
252
|
const commit = exec([
|
|
243
253
|
'-c',
|
|
244
254
|
`user.name=${opts.author.name}`,
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
* skill-installer; the local-sim rehearsal sets it),
|
|
16
16
|
* (2) `orizu skills path` — the packaged vendor/skills/orizu of the
|
|
17
17
|
* globally-installed CLI (the production path),
|
|
18
|
-
* (3)
|
|
18
|
+
* (3) `/opt/orizu/cli/vendor/skills/orizu` — the canonical copy the
|
|
19
|
+
* published-package bake installs (ORI-2375: in a prebaked sandbox the
|
|
20
|
+
* sandbox user's npm prefix never holds the sudo-installed package),
|
|
21
|
+
* (4) `$(npm root -g)/orizu/vendor/skills/orizu` — for the non-prebaked
|
|
22
|
+
* bootstrap, which installs orizu globally and has no /opt/orizu/cli.
|
|
19
23
|
* Then SYMLINK it under `<workspaceDir>/.claude/skills/orizu`, falling back to
|
|
20
24
|
* a copy if the symlink cannot be created. Resolved paths stay in shell vars
|
|
21
25
|
* (never interpolated), so they cannot inject into the command.
|
|
@@ -55,8 +59,9 @@ export interface StageOrizuSkillResult {
|
|
|
55
59
|
stdout: string;
|
|
56
60
|
stderr: string;
|
|
57
61
|
}
|
|
58
|
-
/** The exact staging script — exported for tests that assert its shape
|
|
59
|
-
|
|
62
|
+
/** The exact staging script — exported for tests that assert its shape and run it
|
|
63
|
+
* (`canonicalSkillDir` lets a test lay the canonical copy out under a temp root). */
|
|
64
|
+
export declare function renderStageOrizuSkillScript(workspaceDir: string, canonicalSkillDir?: string): string;
|
|
60
65
|
/**
|
|
61
66
|
* Stage the orizu skill into `<workspaceDir>/.claude/skills/orizu`.
|
|
62
67
|
* Non-throwing (except via the injected exec): resolves to a structured result
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-skill-staging.d.ts","sourceRoot":"","sources":["../src/hosted-skill-staging.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hosted-skill-staging.d.ts","sourceRoot":"","sources":["../src/hosted-skill-staging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAE/E,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,cAAc,CAAA;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,IAAI,CAAA;IAC/C,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAYD;sFACsF;AACtF,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,EAAE,iBAAiB,SAAsB,GAAG,MAAM,CAqBjH;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuBlG"}
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
* skill-installer; the local-sim rehearsal sets it),
|
|
16
16
|
* (2) `orizu skills path` — the packaged vendor/skills/orizu of the
|
|
17
17
|
* globally-installed CLI (the production path),
|
|
18
|
-
* (3)
|
|
18
|
+
* (3) `/opt/orizu/cli/vendor/skills/orizu` — the canonical copy the
|
|
19
|
+
* published-package bake installs (ORI-2375: in a prebaked sandbox the
|
|
20
|
+
* sandbox user's npm prefix never holds the sudo-installed package),
|
|
21
|
+
* (4) `$(npm root -g)/orizu/vendor/skills/orizu` — for the non-prebaked
|
|
22
|
+
* bootstrap, which installs orizu globally and has no /opt/orizu/cli.
|
|
19
23
|
* Then SYMLINK it under `<workspaceDir>/.claude/skills/orizu`, falling back to
|
|
20
24
|
* a copy if the symlink cannot be created. Resolved paths stay in shell vars
|
|
21
25
|
* (never interpolated), so they cannot inject into the command.
|
|
@@ -32,8 +36,10 @@
|
|
|
32
36
|
// non-traversal directory (both do: `<root>/repo` on the DO path, `repo` on the
|
|
33
37
|
// operator path) — never an untrusted or user-supplied value.
|
|
34
38
|
const SAFE_WORKSPACE_DIR = /^[A-Za-z0-9._/:@-]+$/;
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
const CANONICAL_SKILL_DIR = '/opt/orizu/cli/vendor/skills/orizu';
|
|
40
|
+
/** The exact staging script — exported for tests that assert its shape and run it
|
|
41
|
+
* (`canonicalSkillDir` lets a test lay the canonical copy out under a temp root). */
|
|
42
|
+
export function renderStageOrizuSkillScript(workspaceDir, canonicalSkillDir = CANONICAL_SKILL_DIR) {
|
|
37
43
|
const skillsDir = `${workspaceDir}/.claude/skills`;
|
|
38
44
|
return [
|
|
39
45
|
`mkdir -p ${skillsDir}`,
|
|
@@ -48,6 +54,7 @@ export function renderStageOrizuSkillScript(workspaceDir) {
|
|
|
48
54
|
`if [ -d ${workspaceDir}/.git ] && git -C ${workspaceDir} ls-files -- '.claude/skills/orizu' '.claude/skills/orizu/**' | grep -q .; then if [ -f "$dest/SKILL.md" ]; then echo "PRESERVED_TRACKED $dest"; else echo "PRESERVED_INVALID $dest"; fi; exit 0; fi`,
|
|
49
55
|
`src="${'${ORIZU_SKILL_SOURCE_DIR:-}'}"`,
|
|
50
56
|
`if [ -z "$src" ] || [ ! -d "$src" ]; then src="$(orizu skills path 2>/dev/null || true)"; fi`,
|
|
57
|
+
`if [ -z "$src" ] || [ ! -d "$src" ]; then src='${canonicalSkillDir}'; fi`,
|
|
51
58
|
`if [ -z "$src" ] || [ ! -d "$src" ]; then r="$(npm root -g 2>/dev/null || true)"; if [ -n "$r" ] && [ -d "$r/orizu/vendor/skills/orizu" ]; then src="$r/orizu/vendor/skills/orizu"; fi; fi`,
|
|
52
59
|
`if [ -z "$src" ] || [ ! -d "$src" ]; then echo "NO_SOURCE"; exit 0; fi`,
|
|
53
60
|
`rm -rf "$dest"`,
|
package/package.json
CHANGED
package/src/hosted-harvest.ts
CHANGED
|
@@ -305,10 +305,20 @@ export function harvestWorkspace(opts: HarvestOptions): HarvestOutcome {
|
|
|
305
305
|
const dirty = status.stdout.trim().length > 0
|
|
306
306
|
|
|
307
307
|
if (dirty) {
|
|
308
|
-
|
|
308
|
+
// Add everything, then unstage the staged skill link. An exclude
|
|
309
|
+
// pathspec on add makes git exit 1 once bootstrap has ignored
|
|
310
|
+
// .claude/skills ("paths are ignored"), which is every hosted session
|
|
311
|
+
// (ORI-2441, git 2.49 in the sandbox). Only the link's own path is reset,
|
|
312
|
+
// so an agent's edits to a team's tracked skills next to it are saved;
|
|
313
|
+
// reset, unlike rm --cached, never deletes a tracked file.
|
|
314
|
+
const add = exec(['add', '-A', '--', '.'])
|
|
309
315
|
if (add.exitCode !== 0) {
|
|
310
316
|
return { kind: 'work_persist_failed', error: `git add failed: ${detail(add)}` }
|
|
311
317
|
}
|
|
318
|
+
const unstage = exec(['reset', '-q', '--', '.claude/skills/orizu'])
|
|
319
|
+
if (unstage.exitCode !== 0) {
|
|
320
|
+
return { kind: 'work_persist_failed', error: `git reset of .claude/skills/orizu failed: ${detail(unstage)}` }
|
|
321
|
+
}
|
|
312
322
|
const commit = exec([
|
|
313
323
|
'-c',
|
|
314
324
|
`user.name=${opts.author.name}`,
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
* skill-installer; the local-sim rehearsal sets it),
|
|
16
16
|
* (2) `orizu skills path` — the packaged vendor/skills/orizu of the
|
|
17
17
|
* globally-installed CLI (the production path),
|
|
18
|
-
* (3)
|
|
18
|
+
* (3) `/opt/orizu/cli/vendor/skills/orizu` — the canonical copy the
|
|
19
|
+
* published-package bake installs (ORI-2375: in a prebaked sandbox the
|
|
20
|
+
* sandbox user's npm prefix never holds the sudo-installed package),
|
|
21
|
+
* (4) `$(npm root -g)/orizu/vendor/skills/orizu` — for the non-prebaked
|
|
22
|
+
* bootstrap, which installs orizu globally and has no /opt/orizu/cli.
|
|
19
23
|
* Then SYMLINK it under `<workspaceDir>/.claude/skills/orizu`, falling back to
|
|
20
24
|
* a copy if the symlink cannot be created. Resolved paths stay in shell vars
|
|
21
25
|
* (never interpolated), so they cannot inject into the command.
|
|
@@ -68,8 +72,11 @@ export interface StageOrizuSkillResult {
|
|
|
68
72
|
// operator path) — never an untrusted or user-supplied value.
|
|
69
73
|
const SAFE_WORKSPACE_DIR = /^[A-Za-z0-9._/:@-]+$/
|
|
70
74
|
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
const CANONICAL_SKILL_DIR = '/opt/orizu/cli/vendor/skills/orizu'
|
|
76
|
+
|
|
77
|
+
/** The exact staging script — exported for tests that assert its shape and run it
|
|
78
|
+
* (`canonicalSkillDir` lets a test lay the canonical copy out under a temp root). */
|
|
79
|
+
export function renderStageOrizuSkillScript(workspaceDir: string, canonicalSkillDir = CANONICAL_SKILL_DIR): string {
|
|
73
80
|
const skillsDir = `${workspaceDir}/.claude/skills`
|
|
74
81
|
return [
|
|
75
82
|
`mkdir -p ${skillsDir}`,
|
|
@@ -84,6 +91,7 @@ export function renderStageOrizuSkillScript(workspaceDir: string): string {
|
|
|
84
91
|
`if [ -d ${workspaceDir}/.git ] && git -C ${workspaceDir} ls-files -- '.claude/skills/orizu' '.claude/skills/orizu/**' | grep -q .; then if [ -f "$dest/SKILL.md" ]; then echo "PRESERVED_TRACKED $dest"; else echo "PRESERVED_INVALID $dest"; fi; exit 0; fi`,
|
|
85
92
|
`src="${'${ORIZU_SKILL_SOURCE_DIR:-}'}"`,
|
|
86
93
|
`if [ -z "$src" ] || [ ! -d "$src" ]; then src="$(orizu skills path 2>/dev/null || true)"; fi`,
|
|
94
|
+
`if [ -z "$src" ] || [ ! -d "$src" ]; then src='${canonicalSkillDir}'; fi`,
|
|
87
95
|
`if [ -z "$src" ] || [ ! -d "$src" ]; then r="$(npm root -g 2>/dev/null || true)"; if [ -n "$r" ] && [ -d "$r/orizu/vendor/skills/orizu" ]; then src="$r/orizu/vendor/skills/orizu"; fi; fi`,
|
|
88
96
|
`if [ -z "$src" ] || [ ! -d "$src" ]; then echo "NO_SOURCE"; exit 0; fi`,
|
|
89
97
|
`rm -rf "$dest"`,
|