@agimon-ai/po-team 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.
- package/dist/extensions/server.cjs +26 -20
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +2 -2
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +25 -19
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +2 -2
- package/dist/extensions/web.mjs.map +1 -1
- package/package.json +12 -12
|
@@ -21,7 +21,7 @@ let node_path = require("node:path");
|
|
|
21
21
|
node_path = require_atomicJson.__toESM(node_path, 1);
|
|
22
22
|
let node_os = require("node:os");
|
|
23
23
|
node_os = require_atomicJson.__toESM(node_os, 1);
|
|
24
|
-
let
|
|
24
|
+
let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
|
|
25
25
|
let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
|
|
26
26
|
let _agimon_ai_po_core_backgroundWork = require("@agimon-ai/po-core/backgroundWork");
|
|
27
27
|
let _agimon_ai_po_core_childSession = require("@agimon-ai/po-core/childSession");
|
|
@@ -1103,6 +1103,12 @@ function toModelInfo(model) {
|
|
|
1103
1103
|
thinkingLevelMap: model.thinkingLevelMap
|
|
1104
1104
|
};
|
|
1105
1105
|
}
|
|
1106
|
+
/** The parent's authenticated models as the host lists them now; only the parent model when it cannot list. */
|
|
1107
|
+
async function availableModelInfos(execution) {
|
|
1108
|
+
const models = await execution.getAvailableModels?.();
|
|
1109
|
+
if (models) return models.map(toModelInfo);
|
|
1110
|
+
return execution.model ? [toModelInfo(execution.model)] : [];
|
|
1111
|
+
}
|
|
1106
1112
|
function splitKnownThinkingSuffix(model) {
|
|
1107
1113
|
const colonIdx = model.lastIndexOf(THINKING_SUFFIX_SEPARATOR);
|
|
1108
1114
|
if (colonIdx === -1) return {
|
|
@@ -2592,7 +2598,7 @@ function createDelegationBridge(deps) {
|
|
|
2592
2598
|
sessionScope: session.sessionScope,
|
|
2593
2599
|
parentSessionId: session.sessionId,
|
|
2594
2600
|
...forkRequestFields(forkSource),
|
|
2595
|
-
availableModels: session.availableModels,
|
|
2601
|
+
availableModels: await session.availableModels(),
|
|
2596
2602
|
...session.parentModel ? { parentModel: session.parentModel } : {}
|
|
2597
2603
|
}, deps.loadConfig())).outcomes[0];
|
|
2598
2604
|
if (!outcome?.runId) {
|
|
@@ -4854,7 +4860,6 @@ function createHeadlessSubagentTool(runtime, initialExecution) {
|
|
|
4854
4860
|
async execute(_toolCallId, parameters, signal, onUpdate, execution = initialExecution) {
|
|
4855
4861
|
try {
|
|
4856
4862
|
const params = validateParams(parameters);
|
|
4857
|
-
const availableModels = execution.getAvailableModels?.().map(toModelInfo) ?? (execution.model ? [toModelInfo(execution.model)] : []);
|
|
4858
4863
|
if (params.action === require_subagentTool.SUBAGENT_ACTIONS.agents) {
|
|
4859
4864
|
const scope = scopeOf(params.scope);
|
|
4860
4865
|
const agents = runtime.discovery.discover(params.cwd ?? execution.cwd, scope).agents;
|
|
@@ -4890,7 +4895,7 @@ function createHeadlessSubagentTool(runtime, initialExecution) {
|
|
|
4890
4895
|
parentSessionId: execution.sessionId,
|
|
4891
4896
|
...params.concurrency === void 0 ? {} : { concurrency: params.concurrency },
|
|
4892
4897
|
...params.artifacts === void 0 ? {} : { artifacts: params.artifacts },
|
|
4893
|
-
availableModels,
|
|
4898
|
+
availableModels: await availableModelInfos(execution),
|
|
4894
4899
|
...execution.model ? { parentModel: execution.model } : {},
|
|
4895
4900
|
...parentForkSource ? { parentForkSource } : {}
|
|
4896
4901
|
}, loadConfig().config);
|
|
@@ -5277,7 +5282,7 @@ function buildCompletionDetails(result) {
|
|
|
5277
5282
|
* The custom-message type the parent renders completions under. The literal is
|
|
5278
5283
|
* shared by the producer here and the TUI renderer registered for it
|
|
5279
5284
|
* (`(frontend)/message/_lib/subagent-notify.cli.ts`, which draws through
|
|
5280
|
-
* `completionNotice.ts`), and by the
|
|
5285
|
+
* `completionNotice.ts`), and by the server plugin, which persists the same
|
|
5281
5286
|
* type as a session entry so a cockpit transcript records what was delivered.
|
|
5282
5287
|
*/
|
|
5283
5288
|
const SUBAGENT_NOTIFY_MESSAGE_TYPE = "subagent-notify";
|
|
@@ -6261,9 +6266,9 @@ function recordDelegationObservation(telemetry, observation) {
|
|
|
6261
6266
|
}
|
|
6262
6267
|
const root = (0, _agimon_ai_po_core_extensionFile.defineRoot)(({ context, host: serverHost, agent: host }) => {
|
|
6263
6268
|
if (!host) throw new Error("Team session requires the headless host.");
|
|
6264
|
-
if (serverHost.context.environment === void 0) throw new Error("Team
|
|
6269
|
+
if (serverHost.context.environment === void 0) throw new Error("Team server plugin requires an admitted session environment.");
|
|
6265
6270
|
const directEvents = serverHost.context.directEvents;
|
|
6266
|
-
if (directEvents === void 0) throw new Error("Team
|
|
6271
|
+
if (directEvents === void 0) throw new Error("Team server plugin requires host-owned direct events.");
|
|
6267
6272
|
const execution = {
|
|
6268
6273
|
...host.context,
|
|
6269
6274
|
get model() {
|
|
@@ -6381,9 +6386,7 @@ const root = (0, _agimon_ai_po_core_extensionFile.defineRoot)(({ context, host:
|
|
|
6381
6386
|
sessionScope: scope,
|
|
6382
6387
|
cwd: execution.cwd,
|
|
6383
6388
|
environment: serverHost.context.environment,
|
|
6384
|
-
|
|
6385
|
-
return execution.getAvailableModels?.().map(toModelInfo) ?? (execution.model ? [toModelInfo(execution.model)] : []);
|
|
6386
|
-
},
|
|
6389
|
+
availableModels: () => availableModelInfos(execution),
|
|
6387
6390
|
get parentModel() {
|
|
6388
6391
|
return execution.model;
|
|
6389
6392
|
},
|
|
@@ -6812,7 +6815,7 @@ function createTeamSessionApi(runtime, execution) {
|
|
|
6812
6815
|
environment: execution.environment,
|
|
6813
6816
|
parentSessionId: execution.sessionId,
|
|
6814
6817
|
...parentForkSource ? { parentForkSource } : {},
|
|
6815
|
-
availableModels:
|
|
6818
|
+
availableModels: await availableModelInfos(execution),
|
|
6816
6819
|
...execution.model ? { parentModel: execution.model } : {},
|
|
6817
6820
|
sender: HUMAN_SENDER
|
|
6818
6821
|
}, loadConfig().config)).outcomes[0];
|
|
@@ -6856,7 +6859,7 @@ var sessionStart_server_default = (0, _agimon_ai_po_core_extensionFile.defineHoo
|
|
|
6856
6859
|
* `TeamMemberContext`, whose `token` is a session capability documented as never
|
|
6857
6860
|
* leaving the direct context. A context resource is pasted into the system prompt,
|
|
6858
6861
|
* sent to the provider and persisted, so the raw struct must not be serialized here.
|
|
6859
|
-
* `formatTeamContextSnapshot` is the same projection the Pi
|
|
6862
|
+
* `formatTeamContextSnapshot` is the same projection the Pi extension renders.
|
|
6860
6863
|
*/
|
|
6861
6864
|
var team_server_default$1 = (context) => ({
|
|
6862
6865
|
name: "po/team",
|
|
@@ -6878,21 +6881,24 @@ var subagent_server_default = (0, _agimon_ai_po_core_extensionFile.defineServerT
|
|
|
6878
6881
|
//#endregion
|
|
6879
6882
|
//#region generated/server.ts
|
|
6880
6883
|
const at = (value, context) => typeof value === "function" ? value(context) : value;
|
|
6884
|
+
/* v8 ignore next -- generated normalization branch */
|
|
6885
|
+
const defined = (values) => values.filter((value) => value !== void 0);
|
|
6881
6886
|
const via = (identity, value) => value === void 0 ? void 0 : {
|
|
6882
6887
|
...identity,
|
|
6883
6888
|
...value
|
|
6884
6889
|
};
|
|
6885
|
-
const
|
|
6890
|
+
const serverPlugin = (0, _agimon_ai_po_core_serverPlugin.defineServerPlugin)({
|
|
6886
6891
|
name: "@agimon-ai/po-team",
|
|
6887
|
-
providerOverrides: (0,
|
|
6892
|
+
providerOverrides: (0, _agimon_ai_po_core_serverPlugin.composeServerProviderOverrides)(root_server_default),
|
|
6893
|
+
injects: (0, _agimon_ai_po_core_extensionFile.composeRootInjects)({ session: [root_server_default] }),
|
|
6888
6894
|
global: () => ({ get channels() {
|
|
6889
6895
|
return [() => via({ frameType: "subagent_catalog" }, subagent_catalog_server_default()), () => via({ frameType: "subagent_runs" }, subagent_runs_server_default())];
|
|
6890
6896
|
} }),
|
|
6891
|
-
workspace: () => ({ get channels() {
|
|
6892
|
-
return [() => via({ frameType: "subagent_catalog" }, subagent_catalog_server_default()), () => via({ frameType: "subagent_runs" }, subagent_runs_server_default())];
|
|
6897
|
+
workspace: (context) => ({ get channels() {
|
|
6898
|
+
return defined([context.hosted("global") ? void 0 : () => via({ frameType: "subagent_catalog" }, subagent_catalog_server_default()), context.hosted("global") ? void 0 : () => via({ frameType: "subagent_runs" }, subagent_runs_server_default())]);
|
|
6893
6899
|
} }),
|
|
6894
6900
|
session: async (context) => {
|
|
6895
|
-
const scopeSession = await root_server_default
|
|
6901
|
+
const scopeSession = await context.scopeRoot("session", root_server_default, context);
|
|
6896
6902
|
const contextSession = {
|
|
6897
6903
|
...context,
|
|
6898
6904
|
root: scopeSession.value
|
|
@@ -6903,7 +6909,7 @@ const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
|
|
|
6903
6909
|
return [at(route_server_default, contextSession)];
|
|
6904
6910
|
},
|
|
6905
6911
|
get channels() {
|
|
6906
|
-
return [() => via({ frameType: "subagent_catalog" }, subagent_catalog_server_default()), () => via({ frameType: "subagent_runs" }, subagent_runs_server_default())];
|
|
6912
|
+
return defined([context.hosted("global") ? void 0 : () => via({ frameType: "subagent_catalog" }, subagent_catalog_server_default()), context.hosted("global") ? void 0 : () => via({ frameType: "subagent_runs" }, subagent_runs_server_default())]);
|
|
6907
6913
|
},
|
|
6908
6914
|
get hooks() {
|
|
6909
6915
|
return [via({ event: "session_start" }, at(sessionStart_server_default, contextSession))];
|
|
@@ -6922,7 +6928,7 @@ const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
|
|
|
6922
6928
|
}
|
|
6923
6929
|
});
|
|
6924
6930
|
//#endregion
|
|
6925
|
-
exports.default =
|
|
6926
|
-
exports.
|
|
6931
|
+
exports.default = serverPlugin;
|
|
6932
|
+
exports.serverPlugin = serverPlugin;
|
|
6927
6933
|
|
|
6928
6934
|
//# sourceMappingURL=server.cjs.map
|