@agimon-ai/po-file-edit 0.0.0-alpha.13 → 0.0.0-alpha.14

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.
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
  //#endregion
27
- let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
27
+ let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
28
28
  let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
29
29
  let _agimon_ai_po_core_childSession = require("@agimon-ai/po-core/childSession");
30
30
  let _agimon_ai_po_core_hubChannel = require("@agimon-ai/po-core/hubChannel");
@@ -1764,8 +1764,9 @@ async function sweepSessionState(options) {
1764
1764
  //#endregion
1765
1765
  //#region src/services/webFilesChannel/index.ts
1766
1766
  /**
1767
- * The changed-files channel consumes snapshots emitted by the owning session
1768
- * facet. Durable timeline reads seed a channel that starts after session startup.
1767
+ * The changed-files channel consumes snapshots emitted by the owning session's
1768
+ * server plugin. Durable timeline reads seed a channel that starts after session
1769
+ * startup.
1769
1770
  */
1770
1771
  /** Whether the file is still there to be opened. */
1771
1772
  function stillExists(filePath) {
@@ -1878,7 +1879,7 @@ function createFileEditSession({ agent, host }) {
1878
1879
  const timeline = new TimelineStore();
1879
1880
  const snapshots = new NodeSnapshotStoreAdapter();
1880
1881
  const editTracker = new EditTracker(timeline, snapshots, new NodeTreeManifestAdapter(), { git: new NodeGitStatusAdapter() });
1881
- if (host.context.directEvents === void 0) throw new Error("File-edit headless facet requires the session direct event bus.");
1882
+ if (host.context.directEvents === void 0) throw new Error("File-edit server plugin requires the session direct event bus.");
1882
1883
  const directEvents = host.context.directEvents;
1883
1884
  const telemetry = (0, _agimon_ai_po_telemetry.createPoTelemetry)({
1884
1885
  serviceName: "po-file-edit",
@@ -1904,7 +1905,7 @@ function createFileEditSession({ agent, host }) {
1904
1905
  /**
1905
1906
  * The channel carries the rows; the status decides whether the group exists.
1906
1907
  *
1907
- * A cockpit drives this facet and never the Pi runtime, so without the status
1908
+ * A cockpit drives this server plugin and never the Pi runtime, so without the status
1908
1909
  * the dock had the file list on the wire and no frame to draw it in. The empty
1909
1910
  * string is deliberate: the group declares `hideWhenEmpty`, so a session that
1910
1911
  * has edited nothing publishes a key with no content and stays hidden.
@@ -2110,21 +2111,24 @@ var tool_result_server_default = (0, _agimon_ai_po_core_extensionFile.defineHook
2110
2111
  //#endregion
2111
2112
  //#region generated/server.ts
2112
2113
  const at = (value, context) => typeof value === "function" ? value(context) : value;
2114
+ /* v8 ignore next -- generated normalization branch */
2115
+ const defined = (values) => values.filter((value) => value !== void 0);
2113
2116
  const via = (identity, value) => value === void 0 ? void 0 : {
2114
2117
  ...identity,
2115
2118
  ...value
2116
2119
  };
2117
- const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
2120
+ const serverPlugin = (0, _agimon_ai_po_core_serverPlugin.defineServerPlugin)({
2118
2121
  name: "@agimon-ai/po-file-edit",
2119
- providerOverrides: (0, _agimon_ai_po_core_serverFacet.composeServerProviderOverrides)(root_server_default),
2122
+ providerOverrides: (0, _agimon_ai_po_core_serverPlugin.composeServerProviderOverrides)(root_server_default),
2123
+ injects: (0, _agimon_ai_po_core_extensionFile.composeRootInjects)({ session: [root_server_default] }),
2120
2124
  global: () => ({ get channels() {
2121
2125
  return [() => via({ frameType: "file_edits" }, fileEdits_server_default())];
2122
2126
  } }),
2123
- workspace: () => ({ get channels() {
2124
- return [() => via({ frameType: "file_edits" }, fileEdits_server_default())];
2127
+ workspace: (context) => ({ get channels() {
2128
+ return defined([context.hosted("global") ? void 0 : () => via({ frameType: "file_edits" }, fileEdits_server_default())]);
2125
2129
  } }),
2126
2130
  session: async (context) => {
2127
- const scopeSession = await root_server_default(context);
2131
+ const scopeSession = await context.scopeRoot("session", root_server_default, context);
2128
2132
  const contextSession = {
2129
2133
  ...context,
2130
2134
  root: scopeSession.value
@@ -2135,7 +2139,7 @@ const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
2135
2139
  return [at(route_server_default, contextSession)];
2136
2140
  },
2137
2141
  get channels() {
2138
- return [() => via({ frameType: "file_edits" }, fileEdits_server_default())];
2142
+ return defined([context.hosted("global") ? void 0 : () => via({ frameType: "file_edits" }, fileEdits_server_default())]);
2139
2143
  },
2140
2144
  get hooks() {
2141
2145
  return [
@@ -2152,7 +2156,7 @@ const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
2152
2156
  }
2153
2157
  });
2154
2158
  //#endregion
2155
- exports.default = facet;
2156
- exports.facet = facet;
2159
+ exports.default = serverPlugin;
2160
+ exports.serverPlugin = serverPlugin;
2157
2161
 
2158
2162
  //# sourceMappingURL=server.cjs.map