pi-fabric 0.72.0 → 0.73.0

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.
@@ -2,8 +2,9 @@ export declare const fabricExecutionKernelGuidance: (fullCodeMode: boolean) => s
2
2
  export declare const defaultFabricExecutionGuidance: (fullCodeMode: boolean) => string;
3
3
  export interface ExtensionRosterToolSource {
4
4
  name: string;
5
- definition: {
6
- description?: string;
5
+ sourceInfo?: {
6
+ source?: string;
7
+ path?: string;
7
8
  };
8
9
  }
9
10
  export declare const extensionToolRosterGuidance: (tools: ReadonlyArray<ExtensionRosterToolSource>, coreToolNames: ReadonlySet<string>) => string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"system-guidance.d.ts","sourceRoot":"","sources":["../../src/core/system-guidance.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,GAAI,cAAc,OAAO,KAAG,MAG4H,CAAC;AAEnM,eAAO,MAAM,8BAA8B,GAAI,cAAc,OAAO,KAAG,MAGoQ,CAAC;AAG5U,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACtC;AAKD,eAAO,MAAM,2BAA2B,GACtC,OAAO,aAAa,CAAC,yBAAyB,CAAC,EAC/C,eAAe,WAAW,CAAC,MAAM,CAAC,KACjC,MAAM,GAAG,SAaX,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,KAAK,GAAG,OAAO,GAAG,SAAS,KAAG,MAAM,GAAG,SAQjF,CAAC"}
1
+ {"version":3,"file":"system-guidance.d.ts","sourceRoot":"","sources":["../../src/core/system-guidance.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,GAAI,cAAc,OAAO,KAAG,MAG4H,CAAC;AAEnM,eAAO,MAAM,8BAA8B,GAAI,cAAc,OAAO,KAAG,MAGoQ,CAAC;AAG5U,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAQD,eAAO,MAAM,2BAA2B,GACtC,OAAO,aAAa,CAAC,yBAAyB,CAAC,EAC/C,eAAe,WAAW,CAAC,MAAM,CAAC,KACjC,MAAM,GAAG,SAyBX,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,KAAK,GAAG,OAAO,GAAG,SAAS,KAAG,MAAM,GAAG,SAQjF,CAAC"}
package/dist/index.js CHANGED
@@ -1615,15 +1615,24 @@ var defaultFabricExecutionGuidance = (fullCodeMode) => fullCodeMode ? "Examples
1615
1615
  var extensionToolRosterGuidance = (tools, coreToolNames) => {
1616
1616
  const extensionTools = tools.filter((tool) => !coreToolNames.has(tool.name));
1617
1617
  if (extensionTools.length === 0) return void 0;
1618
- const lines = extensionTools.map((tool) => {
1619
- const summary = (tool.definition.description ?? "").split("\n")[0]?.trim() ?? "";
1620
- const label = "- `extensions." + tool.name + "()`";
1621
- return summary ? label + ": " + summary.slice(0, 120) : label;
1622
- });
1618
+ const namespaceLabel = (tool) => {
1619
+ const source = tool.sourceInfo?.source?.trim();
1620
+ if (source) return source;
1621
+ const parts = (tool.sourceInfo?.path ?? "").split(/[\\/]/).filter(Boolean);
1622
+ const base = parts.at(-1)?.trim() ?? "";
1623
+ if (/^index\./i.test(base)) return parts.at(-2)?.trim() || base;
1624
+ return base || "extensions";
1625
+ };
1626
+ const groups = /* @__PURE__ */ new Map();
1627
+ for (const tool of [...extensionTools].sort((left, right) => left.name.localeCompare(right.name))) {
1628
+ const label = namespaceLabel(tool);
1629
+ const names = groups.get(label);
1630
+ if (names) names.push(tool.name);
1631
+ else groups.set(label, [tool.name]);
1632
+ }
1623
1633
  return [
1624
- "Registered extension tools are callable inside fabric_exec as `extensions.<name>(args)` and via `extensions.list` for discovery.",
1625
- "Prefer a purpose-built extension tool over re-implementing its effect with pi.bash:",
1626
- ...lines
1634
+ "Registered extension tools are callable inside fabric_exec as `extensions.<name>(args)`; run `tools.list` for full descriptions and schemas before re-implementing an effect with pi.bash.",
1635
+ ...[...groups.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([label, names]) => "- " + label + ": " + names.join(", "))
1627
1636
  ].join("\n");
1628
1637
  };
1629
1638
  var fabricSchemaGuidance = (mode) => {