@cmetech/otto 1.3.2 → 1.3.3

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.
Files changed (49) hide show
  1. package/dist/resources/.managed-resources-content-hash +1 -1
  2. package/dist/resources/extensions/ollama/model-capabilities.js +15 -4
  3. package/dist/resources/extensions/ollama/ollama-discovery.js +29 -15
  4. package/dist/resources/extensions/otto/commands/release-notes/_data.js +18 -2
  5. package/dist/resources/extensions/workflow/auto-verification.js +9 -2
  6. package/dist/resources/extensions/workflow/bootstrap/crash-log.js +3 -4
  7. package/dist/resources/extensions/workflow/worktree-state-projection.js +29 -0
  8. package/package.json +6 -6
  9. package/packages/contracts/package.json +1 -1
  10. package/packages/daemon/package.json +3 -3
  11. package/packages/mcp-server/package.json +3 -3
  12. package/packages/native/package.json +1 -1
  13. package/packages/pi-agent-core/package.json +1 -1
  14. package/packages/pi-ai/package.json +1 -1
  15. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
  16. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -1
  17. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.test.d.ts +2 -0
  18. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.test.d.ts.map +1 -0
  19. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.test.js +43 -0
  20. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.test.js.map +1 -0
  21. package/packages/pi-coding-agent/package.json +2 -2
  22. package/packages/pi-coding-agent/src/modes/interactive/components/config-selector.test.ts +58 -0
  23. package/packages/pi-coding-agent/src/modes/interactive/components/config-selector.ts +1 -1
  24. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  25. package/packages/pi-tui/dist/__tests__/terminal-image.test.d.ts +2 -0
  26. package/packages/pi-tui/dist/__tests__/terminal-image.test.d.ts.map +1 -0
  27. package/packages/pi-tui/dist/__tests__/terminal-image.test.js +57 -0
  28. package/packages/pi-tui/dist/__tests__/terminal-image.test.js.map +1 -0
  29. package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -1
  30. package/packages/pi-tui/dist/terminal-image.js +4 -0
  31. package/packages/pi-tui/dist/terminal-image.js.map +1 -1
  32. package/packages/pi-tui/package.json +1 -1
  33. package/packages/pi-tui/src/__tests__/terminal-image.test.ts +57 -0
  34. package/packages/pi-tui/src/terminal-image.ts +5 -0
  35. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  36. package/packages/rpc-client/package.json +2 -2
  37. package/pkg/package.json +1 -1
  38. package/scripts/install.js +8 -1
  39. package/src/resources/extensions/ollama/model-capabilities.ts +15 -4
  40. package/src/resources/extensions/ollama/ollama-discovery.ts +28 -12
  41. package/src/resources/extensions/ollama/tests/model-capabilities.test.ts +47 -2
  42. package/src/resources/extensions/ollama/tests/ollama-discovery-priority.test.ts +93 -0
  43. package/src/resources/extensions/otto/commands/release-notes/_data.ts +18 -2
  44. package/src/resources/extensions/workflow/auto-verification.ts +11 -2
  45. package/src/resources/extensions/workflow/bootstrap/crash-log.ts +3 -4
  46. package/src/resources/extensions/workflow/tests/crash-handler-secondary.test.ts +22 -0
  47. package/src/resources/extensions/workflow/tests/post-exec-retry-bypass.test.ts +23 -10
  48. package/src/resources/extensions/workflow/tests/worktree-state-projection.test.ts +41 -1
  49. package/src/resources/extensions/workflow/worktree-state-projection.ts +33 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otto/pi-coding-agent",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Coding agent CLI (vendored from pi-mono)",
5
5
  "type": "module",
6
6
  "otto": {
@@ -28,7 +28,7 @@
28
28
  "copy-assets": "node scripts/copy-assets.cjs"
29
29
  },
30
30
  "dependencies": {
31
- "@otto-build/contracts": "^1.3.2",
31
+ "@otto-build/contracts": "^1.3.3",
32
32
  "@mariozechner/jiti": "^2.6.2",
33
33
  "@silvia-odwyer/photon-node": "^0.3.4",
34
34
  "chalk": "^5.5.0",
@@ -0,0 +1,58 @@
1
+ import assert from "node:assert/strict";
2
+ import { join, relative } from "node:path";
3
+ import { describe, it } from "node:test";
4
+
5
+ import type { ResolvedPaths } from "../../../core/package-manager.js";
6
+ import { ConfigSelectorComponent } from "./config-selector.js";
7
+
8
+ function makeResolvedPaths(baseDir: string, resourcePath: string): ResolvedPaths {
9
+ return {
10
+ extensions: [],
11
+ skills: [
12
+ {
13
+ path: resourcePath,
14
+ enabled: true,
15
+ metadata: {
16
+ source: "auto",
17
+ scope: "project",
18
+ origin: "top-level",
19
+ baseDir,
20
+ },
21
+ },
22
+ ],
23
+ prompts: [],
24
+ themes: [],
25
+ };
26
+ }
27
+
28
+ describe("ResourceList.getResourcePattern", () => {
29
+ it("honors item.metadata.baseDir when present", () => {
30
+ const cwd = "/work/project";
31
+ const agentDir = "/home/user/.pi/agent";
32
+ // The resource lives under an explicit baseDir distinct from the
33
+ // top-level base dir (cwd/.pi). The pattern must be relative to baseDir.
34
+ const baseDir = "/work/project/nested/base";
35
+ const resourcePath = join(baseDir, "skills", "my-skill", "SKILL.md");
36
+
37
+ const component = new ConfigSelectorComponent(
38
+ makeResolvedPaths(baseDir, resourcePath),
39
+ {} as any,
40
+ cwd,
41
+ agentDir,
42
+ () => {},
43
+ () => {},
44
+ () => {},
45
+ );
46
+
47
+ const resourceList = component.getResourceList() as any;
48
+ const item = resourceList.groups[0].subgroups[0].items[0];
49
+
50
+ const pattern: string = resourceList.getResourcePattern(item);
51
+
52
+ // Expected: relative to the explicit baseDir, NOT to cwd/.pi top-level dir.
53
+ assert.equal(pattern, relative(baseDir, resourcePath));
54
+ // Sanity: the buggy behaviour (relative to top-level base dir) would
55
+ // produce a path that climbs out of cwd/.pi with leading "../".
56
+ assert.ok(!pattern.startsWith(".."), `pattern should not climb out of baseDir, got: ${pattern}`);
57
+ });
58
+ });
@@ -539,7 +539,7 @@ class ResourceList implements Component, Focusable {
539
539
 
540
540
  private getResourcePattern(item: ResourceItem): string {
541
541
  const scope = item.metadata.scope as "user" | "project";
542
- const baseDir = this.getTopLevelBaseDir(scope);
542
+ const baseDir = item.metadata.baseDir ?? this.getTopLevelBaseDir(scope);
543
543
  return relative(baseDir, item.path);
544
544
  }
545
545