@oh-my-pi/pi-coding-agent 16.1.18 → 16.1.20

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 (57) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cli.js +15452 -15142
  3. package/dist/types/cli/gallery-cli.d.ts +6 -0
  4. package/dist/types/commands/gallery.d.ts +1 -1
  5. package/dist/types/config/service-tier.d.ts +34 -0
  6. package/dist/types/config/settings-schema.d.ts +36 -33
  7. package/dist/types/edit/hashline/filesystem.d.ts +1 -18
  8. package/dist/types/extensibility/plugins/legacy-pi-bundled-keys.d.ts +10 -0
  9. package/dist/types/extensibility/plugins/legacy-pi-bundled-registry.d.ts +4 -1
  10. package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +12 -0
  11. package/dist/types/internal-urls/skill-protocol.d.ts +2 -2
  12. package/dist/types/internal-urls/types.d.ts +3 -0
  13. package/dist/types/modes/components/custom-editor.d.ts +0 -2
  14. package/dist/types/modes/controllers/input-controller.d.ts +0 -1
  15. package/dist/types/session/agent-session.d.ts +2 -0
  16. package/dist/types/task/executor.d.ts +9 -1
  17. package/dist/types/task/parallel.d.ts +17 -1
  18. package/dist/types/tools/index.d.ts +3 -1
  19. package/dist/types/tools/path-utils.d.ts +3 -0
  20. package/package.json +13 -13
  21. package/scripts/build-binary.ts +20 -0
  22. package/scripts/generate-legacy-pi-bundled-registry.ts +404 -0
  23. package/src/cli/gallery-cli.ts +31 -2
  24. package/src/cli/gallery-fixtures/agentic.ts +13 -4
  25. package/src/commands/gallery.ts +11 -3
  26. package/src/config/service-tier.ts +87 -0
  27. package/src/config/settings-schema.ts +48 -23
  28. package/src/edit/hashline/filesystem.ts +14 -0
  29. package/src/eval/agent-bridge.ts +2 -0
  30. package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +987 -0
  31. package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +3330 -18
  32. package/src/extensibility/plugins/legacy-pi-compat.ts +29 -14
  33. package/src/internal-urls/local-protocol.ts +116 -9
  34. package/src/internal-urls/skill-protocol.ts +3 -3
  35. package/src/internal-urls/types.ts +3 -0
  36. package/src/main.ts +1 -0
  37. package/src/mcp/transports/stdio.ts +5 -0
  38. package/src/modes/components/custom-editor.test.ts +7 -5
  39. package/src/modes/components/custom-editor.ts +6 -16
  40. package/src/modes/controllers/input-controller.ts +143 -137
  41. package/src/sdk.ts +1 -0
  42. package/src/session/agent-session.ts +72 -15
  43. package/src/session/messages.ts +70 -47
  44. package/src/session/session-history-format.ts +21 -4
  45. package/src/task/executor.ts +79 -2
  46. package/src/task/index.ts +11 -6
  47. package/src/task/parallel.ts +59 -7
  48. package/src/tools/ast-edit.ts +1 -0
  49. package/src/tools/ast-grep.ts +1 -0
  50. package/src/tools/find.ts +1 -0
  51. package/src/tools/index.ts +3 -1
  52. package/src/tools/irc.ts +16 -2
  53. package/src/tools/path-utils.ts +4 -0
  54. package/src/tools/read.ts +43 -17
  55. package/src/tools/search.ts +4 -0
  56. package/src/utils/shell-snapshot-fn-env.sh +60 -0
  57. package/src/utils/shell-snapshot.ts +77 -20
@@ -35,6 +35,12 @@ import {
35
35
  } from "../tts/models";
36
36
  import { EDIT_MODES } from "../utils/edit-mode";
37
37
  import { SEARCH_PROVIDER_OPTIONS, SEARCH_PROVIDER_PREFERENCES, type SearchProviderId } from "../web/search/types";
38
+ import {
39
+ SERVICE_TIER_INHERIT_OPTIONS,
40
+ SERVICE_TIER_INHERIT_SETTING_VALUES,
41
+ SERVICE_TIER_OPTIONS,
42
+ SERVICE_TIER_SETTING_VALUES,
43
+ } from "./service-tier";
38
44
 
39
45
  /** Unified settings schema - single source of truth for all settings.
40
46
  *
@@ -1122,7 +1128,7 @@ export const SETTINGS_SCHEMA = {
1122
1128
 
1123
1129
  serviceTier: {
1124
1130
  type: "enum",
1125
- values: ["none", "auto", "default", "flex", "scale", "priority", "openai-only", "claude-only"] as const,
1131
+ values: SERVICE_TIER_SETTING_VALUES,
1126
1132
  default: "none",
1127
1133
  ui: {
1128
1134
  tab: "model",
@@ -1130,28 +1136,36 @@ export const SETTINGS_SCHEMA = {
1130
1136
  label: "Service Tier",
1131
1137
  description:
1132
1138
  'Processing priority hint (none = omit). OpenAI accepts the tier values directly; Anthropic realizes `priority` as `speed: "fast"` on supported Opus models. Scoped values target one family.',
1133
- options: [
1134
- { value: "none", label: "None", description: "Omit service_tier parameter" },
1135
- { value: "auto", label: "Auto", description: "Use provider default tier selection (OpenAI)" },
1136
- { value: "default", label: "Default", description: "Standard priority processing (OpenAI)" },
1137
- { value: "flex", label: "Flex", description: "Flexible capacity tier when available (OpenAI)" },
1138
- { value: "scale", label: "Scale", description: "Scale Tier credits when available (OpenAI)" },
1139
- {
1140
- value: "priority",
1141
- label: "Priority",
1142
- description: "Priority on every supported provider (OpenAI `service_tier`, Anthropic fast mode)",
1143
- },
1144
- {
1145
- value: "openai-only",
1146
- label: "Priority (OpenAI only)",
1147
- description: "Priority on OpenAI/OpenAI-Codex requests; ignored elsewhere",
1148
- },
1149
- {
1150
- value: "claude-only",
1151
- label: "Priority (Claude only)",
1152
- description: "Anthropic fast mode on direct Claude requests; ignored elsewhere (incl. Bedrock/Vertex)",
1153
- },
1154
- ],
1139
+ options: SERVICE_TIER_OPTIONS,
1140
+ },
1141
+ },
1142
+
1143
+ serviceTierSubagent: {
1144
+ type: "enum",
1145
+ values: SERVICE_TIER_INHERIT_SETTING_VALUES,
1146
+ default: "inherit",
1147
+ ui: {
1148
+ tab: "model",
1149
+ group: "Sampling",
1150
+ label: "Service Tier - Subagent",
1151
+ description:
1152
+ "Service Tier for spawned task/eval subagents. Inherit = match the main agent's live tier (tracks /fast); pick a value to scope subagents independently.",
1153
+ options: SERVICE_TIER_INHERIT_OPTIONS,
1154
+ },
1155
+ },
1156
+
1157
+ serviceTierAdvisor: {
1158
+ type: "enum",
1159
+ values: SERVICE_TIER_INHERIT_SETTING_VALUES,
1160
+ default: "none",
1161
+ ui: {
1162
+ tab: "model",
1163
+ group: "Sampling",
1164
+ label: "Service Tier - Advisor",
1165
+ description:
1166
+ "Service Tier for the advisor model. None = standard processing; Inherit = match the main agent's live tier; pick a value (e.g. Priority) to run the advisor on a faster serving path.",
1167
+ options: SERVICE_TIER_INHERIT_OPTIONS,
1168
+ condition: "advisorEnabled",
1155
1169
  },
1156
1170
  },
1157
1171
 
@@ -4041,6 +4055,17 @@ export const SETTINGS_SCHEMA = {
4041
4055
  },
4042
4056
 
4043
4057
  // Provider selection
4058
+ "providers.ollama-cloud.maxConcurrency": {
4059
+ type: "number",
4060
+ default: 3,
4061
+ ui: {
4062
+ tab: "providers",
4063
+ group: "Services",
4064
+ label: "Ollama Cloud Max Concurrency",
4065
+ description:
4066
+ "Maximum concurrent Ollama Cloud subagent runs per process; 0 disables the provider-specific limit",
4067
+ },
4068
+ },
4044
4069
  "providers.webSearch": {
4045
4070
  type: "enum",
4046
4071
  values: SEARCH_PROVIDER_PREFERENCES,
@@ -16,6 +16,7 @@
16
16
  * (batch request, diagnostics) lives on the instance and isn't safe to
17
17
  * share across concurrent edit tools.
18
18
  */
19
+ import * as path from "node:path";
19
20
  import { Filesystem, NotFoundError, type WriteResult } from "@oh-my-pi/hashline";
20
21
  import { isEnoent } from "@oh-my-pi/pi-utils";
21
22
  import type { FileDiagnosticsResult, WritethroughCallback, WritethroughDeferredHandle } from "../../lsp";
@@ -23,6 +24,7 @@ import type { ToolSession } from "../../tools";
23
24
  import { routeWriteThroughBridge } from "../../tools/acp-bridge";
24
25
  import { assertEditableFileContent } from "../../tools/auto-generated-guard";
25
26
  import { invalidateFsScanAfterWrite } from "../../tools/fs-cache-invalidation";
27
+ import { isInternalUrlPath } from "../../tools/path-utils";
26
28
  import { enforcePlanModeWrite, resolvePlanPath } from "../../tools/plan-mode-guard";
27
29
  import { canonicalSnapshotKey } from "../file-snapshot-store";
28
30
  import { readEditFileText, serializeEditFileText } from "../read-file";
@@ -86,6 +88,18 @@ export class HashlineFilesystem extends Filesystem {
86
88
  return canonicalSnapshotKey(this.resolveAbsolute(relativePath));
87
89
  }
88
90
 
91
+ allowTagPathRecovery(authoredPath: string, resolvedPath: string): boolean {
92
+ // Internal-URL authored targets (`local://`, `vault://`, …) are approved
93
+ // at the lower "read" privilege; never let one redirect onto a "write".
94
+ if (isInternalUrlPath(authoredPath)) return false;
95
+ // Recovery only fixes a mistyped working-tree path: confine the resolved
96
+ // target to the working tree (realpath-normalized). A plain-path "write"
97
+ // approval must not redirect into the artifact sandbox, the secret vault,
98
+ // or any out-of-tree file the user never named.
99
+ const root = canonicalSnapshotKey(this.session.cwd);
100
+ return resolvedPath === root || resolvedPath.startsWith(`${root}${path.sep}`);
101
+ }
102
+
89
103
  async readText(relativePath: string): Promise<string> {
90
104
  const absolutePath = this.resolveAbsolute(relativePath);
91
105
  let content: string;
@@ -397,6 +397,8 @@ export async function runEvalAgent(args: unknown, options: EvalAgentBridgeOption
397
397
  parentMnemopiSessionState: options.session.getMnemopiSessionState?.(),
398
398
  parentTelemetry: options.session.getTelemetry?.(),
399
399
  parentAgentId: options.session.getAgentId?.() ?? MAIN_AGENT_ID,
400
+ // Live source of truth for `serviceTierSubagent: inherit` (null = explicit none).
401
+ parentServiceTier: options.session.getServiceTier ? (options.session.getServiceTier() ?? null) : undefined,
400
402
  // Deliberately omit parentEvalSessionId: the parent's Python kernel is
401
403
  // blocked on this bridge call, so sharing the eval session would deadlock
402
404
  // (subagent queues behind the parent's in-flight execution, parent waits