omp-fabric 1.25.0 → 1.25.2

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.
@@ -1,3 +1,4 @@
1
+ import { type ToolSession } from "@oh-my-pi/pi-coding-agent";
1
2
  import { CapturedToolCatalog } from "../capture/catalog.js";
2
3
  import type { FabricActionDescriptor, FabricInvocationContext, FabricProvider, FabricProviderListRequest } from "../protocol.js";
3
4
  import { CapturedToolsProvider } from "./captured-tools-provider.js";
@@ -5,6 +6,8 @@ export interface OmpSessionIdentity {
5
6
  getSessionId?: () => string | null;
6
7
  getArtifactsDir?: () => string | null;
7
8
  getSessionFile?: () => string | null;
9
+ modelRegistry?: NonNullable<ToolSession["modelRegistry"]>;
10
+ getActiveModelString?: () => string | undefined;
8
11
  }
9
12
  export declare const setOmpSessionIdentity: (identity: OmpSessionIdentity | undefined) => void;
10
13
  export declare const TRUNCATION_MARKER = "[[omp-fabric:truncated]]";
@@ -12,10 +15,10 @@ export declare const TRUNCATION_MARKER = "[[omp-fabric:truncated]]";
12
15
  export type FabricHostToolAuthority = () => ReadonlySet<string> | undefined;
13
16
  export declare class OmpToolsProvider implements FabricProvider {
14
17
  #private;
15
- static create(cwd: string, catalog?: CapturedToolCatalog, capturedTools?: CapturedToolsProvider, hostActiveTools?: FabricHostToolAuthority): Promise<OmpToolsProvider>;
18
+ static create(cwd: string, catalog?: CapturedToolCatalog, capturedTools?: CapturedToolsProvider, hostActiveTools?: FabricHostToolAuthority, identity?: OmpSessionIdentity): Promise<OmpToolsProvider>;
16
19
  readonly name = "omp";
17
20
  readonly description = "OMP's built-in coding tools";
18
- constructor(cwd: string, catalog?: CapturedToolCatalog, capturedTools?: CapturedToolsProvider, hostActiveTools?: FabricHostToolAuthority);
21
+ constructor(cwd: string, catalog?: CapturedToolCatalog, capturedTools?: CapturedToolsProvider, hostActiveTools?: FabricHostToolAuthority, identity?: OmpSessionIdentity);
19
22
  list(request: FabricProviderListRequest, _context: FabricInvocationContext): Promise<FabricActionDescriptor[]>;
20
23
  describe(actionName: string, _context: FabricInvocationContext): Promise<FabricActionDescriptor | undefined>;
21
24
  prepareArguments(actionName: string, args: Record<string, unknown>): Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"omp-tools-provider.d.ts","sourceRoot":"","sources":["../../src/providers/omp-tools-provider.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAU5D,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EAEvB,cAAc,EACd,yBAAyB,EAE1B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAWrE,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CACtC;AAID,eAAO,MAAM,qBAAqB,GAAI,UAAU,kBAAkB,GAAG,SAAS,KAAG,IAEhF,CAAC;AAyTF,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AA+Z5D,+EAA+E;AAC/E,MAAM,MAAM,uBAAuB,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AAE5E,qBAAa,gBAAiB,YAAW,cAAc;;WACxC,MAAM,CACjB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,mBAAmB,EAC7B,aAAa,CAAC,EAAE,qBAAqB,EACrC,eAAe,CAAC,EAAE,uBAAuB,GACxC,OAAO,CAAC,gBAAgB,CAAC;IAG5B,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,WAAW,iCAAiC;gBAanD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,mBAAmB,EAC7B,aAAa,CAAC,EAAE,qBAAqB,EACrC,eAAe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7B,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,OAAO,CAAC;CAobpB"}
@@ -23,7 +23,7 @@ The package command builds `dist/` first, then runs `scripts/certify-context.mjs
23
23
 
24
24
  The harness builds a persisted session through OMP's `SessionManager`. Messages and compactions go in through its public methods. The active parent-linked branch comes back through `getBranch()`. Under deterministic settings (`contextWindow=64`, `reserveTokens=63`, `keepRecentTokens=1`), the harness performs exactly 100 Fabric compactions. Before every hook event it sums the host's `estimateTokens` over `SessionManager.buildSessionContext().messages`, applies `shouldCompact`, and requires `prepareCompaction` to return a preparation. It then invokes the callback registered by `registerCompactionHook` with OMP's `SessionBeforeCompactEvent` shape: `type`, `preparation`, `branchEntries`, an optional `customInstructions`, and `signal`. That event carries neither a compaction reason nor a retry flag, so certification asserts nothing about either.
25
25
 
26
- The host package is `@oh-my-pi/pi-coding-agent`. Certification reads the installed version from its own `package.json` and checks it against the range `omp-fabric` declares in `peerDependencies`, so no certified version is hard-coded; a host outside the declared range aborts the run and reports both the range and the resolved version and path. Each function is then resolved from a supported entry point, and a missing one aborts the run naming the entry point: `SessionManager` and `buildSessionContext` from the package root, `estimateTokens` from `@oh-my-pi/pi-coding-agent/extensibility/legacy-pi-coding-agent-shim`, and `prepareCompaction` plus `shouldCompact` from `@oh-my-pi/pi-agent-core/compaction`. At the pinned 18.1.10 host the package root exports `SessionManager` and `buildSessionContext`, does not export `prepareCompaction` or `shouldCompact`, and has no `buildContextEntries` export at all; the report records each of those observations under `hostApi.rootExports`. No public API supplies a preparation unless an `AgentSession` runs with a model, so certification makes no claim past that.
26
+ The host package is `@oh-my-pi/pi-coding-agent`. Certification reads the installed version from its own `package.json` and checks it against the range `omp-fabric` declares in `peerDependencies`, so no certified version is hard-coded; a host outside the declared range aborts the run and reports both the range and the resolved version and path. Each function is then resolved from a supported entry point, and a missing one aborts the run naming the entry point: `SessionManager` and `buildSessionContext` from the package root, `estimateTokens` from `@oh-my-pi/pi-coding-agent/extensibility/legacy-pi-coding-agent-shim`, and `prepareCompaction` plus `shouldCompact` from `@oh-my-pi/pi-agent-core/compaction`. At the pinned 18.3.1 host the package root exports `SessionManager` and `buildSessionContext`, does not export `prepareCompaction` or `shouldCompact`, and has no `buildContextEntries` export at all; the report records each of those observations under `hostApi.rootExports`. No public API supplies a preparation unless an `AgentSession` runs with a model, so certification makes no claim past that.
27
27
 
28
28
  Every persisted summary carries a cycle-unique `PRIOR_SUMMARY_POISON_991_…` suffix inside the actual `CompactionEntry`. On the next cycle, OMP's preparation has to expose that exact stored previous summary. A proxy around the event preparation records whether the registered Fabric callback reads `previousSummary`. The result derives from those accesses. Fabric must leave the value unread and keep its poison out of anything it emits. No step converts a summary into a user message by hand.
29
29
 
package/docs/providers.md CHANGED
@@ -108,7 +108,7 @@ If you change only `content`, the nested sandbox value becomes the patched text.
108
108
 
109
109
  OMP core tools and captured extension tools skip this generic proxy, because they already replay their native `tool_call`, `tool_result`, and `tool_execution_*` lifecycle. Nested shell calls still emit their native identity: `omp.bash()` uses `toolName: "bash"`/`isBashToolResult()`. Proxied events act as middleware only. They create no separate persisted tool-result messages.
110
110
 
111
- The shell adapter reaches the host's background-job manager. `omp.bash({ async: true })` registers a job owned by the calling agent and resolves at once with `details.async.jobId`; the host delivers the finished job to that owner as an `async-result` follow-up, so the work outlives the program that started it and the agent, not the program, receives its output. The agent's own `hub` tool inspects and cancels those jobs; `hub` is not a Fabric provider and a guest program cannot reach it.
111
+ The shell adapter reaches the host's background-job manager. `omp.bash({ async: true })` registers a job owned by the calling agent and resolves at once with `details.async.jobId`; the host delivers the finished job to that owner as an `async-result` follow-up, so the work outlives the program that started it and the agent, not the program, receives its output. The host's `/jobs` command and the `wait` tool inspect those jobs; neither is a Fabric provider and a guest program cannot reach them.
112
112
 
113
113
  Auto-background stays off at every host setting. A guest program is straight-line code that reads a command's output on its next line, and a mid-flight handover would resolve the call with a job notice in place of that output.
114
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-fabric",
3
- "version": "1.25.0",
3
+ "version": "1.25.2",
4
4
  "description": "A programmable tool and agent runtime for Oh My Pi (OMP)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",