@agimon-ai/po-git 0.0.0-alpha.13 → 0.0.0-alpha.15

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,5 +1,5 @@
1
1
  //#region generated/server.d.ts
2
- export declare const facet: import("@agimon-ai/po-core/serverFacet").PoServerFacet;
2
+ export declare const serverPlugin: import("@agimon-ai/po-core/serverPlugin").PoServerPlugin;
3
3
  //#endregion
4
- export { facet as default };
4
+ export { serverPlugin as default };
5
5
  //# sourceMappingURL=server.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.mts","names":[],"sources":["../../generated/server.ts"],"mappings":";qBAsBa,gDAAK"}
1
+ {"version":3,"file":"server.d.mts","names":[],"sources":["../../generated/server.ts"],"mappings":";qBAyBa,wDAAY"}
@@ -1,9 +1,9 @@
1
- import { _ as NETWORK_TIMEOUT_MS, a as GIT_WORKTREE_LIFECYCLE_EVENT, b as createWorktreeGit, c as isWorktreeLifecycleEvent, d as registryFile, f as readJson, g as invalidRequest, h as PoGitExpectedError, i as GIT_SESSION_CHANGED_EVENT, l as credentialsFile, m as HubUnavailableError, n as createWorktreeRegistry, o as createWorktreeMessageInbox, p as writeJsonAtomic, r as validRefName, s as isSessionChangedEvent, t as createWorktreeOperations, u as poGitRoot, v as READ_TIMEOUT_MS, x as runGit, y as REBASE_TIMEOUT_MS } from "../worktreeOperations-BSeyxUai.mjs";
1
+ import { _ as NETWORK_TIMEOUT_MS, a as GIT_WORKTREE_LIFECYCLE_EVENT, b as createWorktreeGit, c as isWorktreeLifecycleEvent, d as registryFile, f as readJson, g as invalidRequest, h as PoGitExpectedError, i as GIT_SESSION_CHANGED_EVENT, l as credentialsFile, m as HubUnavailableError, n as createWorktreeRegistry, o as createWorktreeMessageInbox, p as writeJsonAtomic, r as validRefName, s as isSessionChangedEvent, t as createWorktreeOperations, u as poGitRoot, v as READ_TIMEOUT_MS, x as runGit, y as REBASE_TIMEOUT_MS } from "../worktreeOperations-Cd8Q12L4.mjs";
2
2
  import fs from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
- import { composeServerProviderOverrides, defineServerPlugin, readPackageResource } from "@agimon-ai/po-core/serverFacet";
6
- import { composeRootHooks, defineChannel, defineHook, defineResource, defineRoot, defineRoute, defineServerTool } from "@agimon-ai/po-core/extensionFile";
5
+ import { composeServerProviderOverrides, defineServerPlugin, readPackageResource } from "@agimon-ai/po-core/serverPlugin";
6
+ import { composeRootHooks, composeRootInjects, defineChannel, defineHook, defineResource, defineRoot, defineRoute, defineServerTool } from "@agimon-ai/po-core/extensionFile";
7
7
  import { readPoSessionDelivery } from "@agimon-ai/po-session";
8
8
  import { Type } from "typebox";
9
9
  //#region src/schemas/runWorktreeTool.ts
@@ -303,8 +303,8 @@ function progressResult(action, label) {
303
303
  };
304
304
  }
305
305
  function createGitSession({ context, host: serverHost }) {
306
- if (serverHost.context.directEvents === void 0) throw new Error("Git headless facet requires the session direct event bus.");
307
- if (serverHost.context.sessionId === void 0) throw new Error("Git headless facet requires a session identity.");
306
+ if (serverHost.context.directEvents === void 0) throw new Error("Git server plugin requires the session direct event bus.");
307
+ if (serverHost.context.sessionId === void 0) throw new Error("Git server plugin requires a session identity.");
308
308
  const sessionId = serverHost.context.sessionId;
309
309
  const directEvents = serverHost.context.directEvents;
310
310
  const messageInbox = createWorktreeMessageInbox(directEvents, sessionId);
@@ -1583,9 +1583,9 @@ const GIT_CHANGES_TYPE = "git_changes";
1583
1583
  * DESIGN PATTERNS:
1584
1584
  * - Apart from the worktrees channel. Worktrees are repository management;
1585
1585
  * this is the session's own code change.
1586
- * - Push, not poll. The session facet publishes a "changed" event after every
1587
- * tool call and settled turn; recounts are coalesced to one in flight plus
1588
- * one rerun, so a burst of tool calls costs at most two.
1586
+ * - Push, not poll. The session's server plugin publishes a "changed" event
1587
+ * after every tool call and settled turn; recounts are coalesced to one in
1588
+ * flight plus one rerun, so a burst of tool calls costs at most two.
1589
1589
  * - One sync command per session. A rebase and a push must never overlap.
1590
1590
  * - Auth is read fresh for each command from the session's workspace, and goes
1591
1591
  * only into that command's git child.
@@ -2051,13 +2051,16 @@ var runWorktree_server_default = defineServerTool((context) => context.root.tool
2051
2051
  //#endregion
2052
2052
  //#region generated/server.ts
2053
2053
  const at = (value, context) => typeof value === "function" ? value(context) : value;
2054
+ /* v8 ignore next -- generated normalization branch */
2055
+ const defined = (values) => values.filter((value) => value !== void 0);
2054
2056
  const via = (identity, value) => value === void 0 ? void 0 : {
2055
2057
  ...identity,
2056
2058
  ...value
2057
2059
  };
2058
- const facet = defineServerPlugin({
2060
+ const serverPlugin = defineServerPlugin({
2059
2061
  name: "@agimon-ai/po-git",
2060
2062
  providerOverrides: composeServerProviderOverrides(root_server_default),
2063
+ injects: composeRootInjects({ session: [root_server_default] }),
2061
2064
  global: (context) => ({
2062
2065
  get api() {
2063
2066
  return [at(route_server_default, context)];
@@ -2071,11 +2074,11 @@ const facet = defineServerPlugin({
2071
2074
  return [at(route_server_default, context)];
2072
2075
  },
2073
2076
  get channels() {
2074
- return [() => via({ frameType: "git_changes" }, git_changes_server_default()), () => via({ frameType: "git_worktrees" }, git_worktrees_server_default())];
2077
+ return defined([context.hosted("global") ? void 0 : () => via({ frameType: "git_changes" }, git_changes_server_default()), context.hosted("global") ? void 0 : () => via({ frameType: "git_worktrees" }, git_worktrees_server_default())]);
2075
2078
  }
2076
2079
  }),
2077
2080
  session: async (context) => {
2078
- const scopeSession = await root_server_default(context);
2081
+ const scopeSession = await context.scopeRoot("session", root_server_default, context);
2079
2082
  const contextSession = {
2080
2083
  ...context,
2081
2084
  root: scopeSession.value
@@ -2086,7 +2089,7 @@ const facet = defineServerPlugin({
2086
2089
  return [at(route_server_default, context)];
2087
2090
  },
2088
2091
  get channels() {
2089
- return [() => via({ frameType: "git_changes" }, git_changes_server_default()), () => via({ frameType: "git_worktrees" }, git_worktrees_server_default())];
2092
+ return defined([context.hosted("global") ? void 0 : () => via({ frameType: "git_changes" }, git_changes_server_default()), context.hosted("global") ? void 0 : () => via({ frameType: "git_worktrees" }, git_worktrees_server_default())]);
2090
2093
  },
2091
2094
  get hooks() {
2092
2095
  return [via({ event: "agent_settled" }, at(agent_settled_server_default, contextSession)), via({ event: "tool_execution_end" }, at(tool_execution_end_server_default, contextSession))];
@@ -2109,6 +2112,6 @@ const facet = defineServerPlugin({
2109
2112
  }
2110
2113
  });
2111
2114
  //#endregion
2112
- export { facet as default, facet };
2115
+ export { serverPlugin as default, serverPlugin };
2113
2116
 
2114
2117
  //# sourceMappingURL=server.mjs.map