@agimon-ai/po-team 0.0.0-alpha.217 → 0.0.0-alpha.218
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/native.mjs +55 -8
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +43 -1
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/po-runtime-identity.json +1 -1
- package/package.json +33 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createApiClient, defineActivityGroup, defineApiRoutes, defineChannelFile, defineFill, defineNativePlugin, defineSessionStore, defineToolRenderer, nativeApiTransport, sessionApiAddress, t, useLocale, useT } from "@agimon-ai/po-core/native";
|
|
1
|
+
import { createApiClient, defineActivityGroup, defineApiRoutes, defineChannelFile, defineFill, defineNativePlugin, defineSessionStore, defineSlotFile, defineToolRenderer, nativeApiTransport, sessionApiAddress, t, useLocale, useT } from "@agimon-ai/po-core/native";
|
|
2
2
|
import { AgentAvatar, ArrowRightIcon, Badge, Button, ChevronDownIcon, ChevronUpIcon, Dot, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, InfoStrip, Input, KebabIcon, ListRow, LiveDuration, LoadingState, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, Panel, STATUS_EDGE, SearchIcon, SegmentedControl, Select, SendIcon, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, StatusBadge, Textarea, UsersIcon, fontOf, toolTone } from "@agimon-ai/po-native-components";
|
|
3
3
|
import { createElement, useCallback, useEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { View } from "react-native-unistyles/components/native/View";
|
|
@@ -103,6 +103,11 @@ async function stopRun(sessionId, runId) {
|
|
|
103
103
|
//#region src/types/webSubagents.ts
|
|
104
104
|
const SUBAGENT_RUNS_TYPE = "subagent_runs";
|
|
105
105
|
const SUBAGENT_CATALOG_TYPE = "subagent_catalog";
|
|
106
|
+
function parseSubagentRunControlAction(input) {
|
|
107
|
+
if (typeof input !== "object" || input === null) return null;
|
|
108
|
+
const candidate = input;
|
|
109
|
+
return candidate.version === 1 && typeof candidate.steer === "function" && typeof candidate.stop === "function" ? candidate : null;
|
|
110
|
+
}
|
|
106
111
|
//#endregion
|
|
107
112
|
//#region src/extensions/workspaces/sessions/(frontend)/_lib/catalogStore.native.ts
|
|
108
113
|
const catalog = defineSessionStore({
|
|
@@ -393,6 +398,25 @@ const subagentRunsChannel = subagents.channel({
|
|
|
393
398
|
};
|
|
394
399
|
}
|
|
395
400
|
});
|
|
401
|
+
/** The session's live run with this identity, if the feed lists one. */
|
|
402
|
+
function liveRunByIdentity(sessionId, identity) {
|
|
403
|
+
const run = subagents.select(subagents.store.state, sessionId).runs.find((r) => r.identity === identity);
|
|
404
|
+
return run && !isTerminalRun(run) ? run : void 0;
|
|
405
|
+
}
|
|
406
|
+
/** Lets another plugin, such as the task list, steer or stop a run it only knows by identity. */
|
|
407
|
+
const subagentRunControlAction = {
|
|
408
|
+
version: 1,
|
|
409
|
+
async steer({ sessionId, identity, message }) {
|
|
410
|
+
const run = liveRunByIdentity(sessionId, identity);
|
|
411
|
+
return run ? steerRun(sessionId, run.runId, message) : void 0;
|
|
412
|
+
},
|
|
413
|
+
async stop({ sessionId, identity }) {
|
|
414
|
+
const run = liveRunByIdentity(sessionId, identity);
|
|
415
|
+
if (!run) return false;
|
|
416
|
+
await requestRunStop(sessionId, run.runId);
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
};
|
|
396
420
|
const MESSAGE_PREVIEW_CHARS = 72;
|
|
397
421
|
const ELLIPSIS = "…";
|
|
398
422
|
function isRecord(value) {
|
|
@@ -2422,6 +2446,13 @@ const styles$3 = StyleSheet.create((theme) => {
|
|
|
2422
2446
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/Agents.activity.agents.native.tsx
|
|
2423
2447
|
var Agents_activity_agents_native_default = defineFill({ component: AgentsActivitySection });
|
|
2424
2448
|
//#endregion
|
|
2449
|
+
//#region src/extensions/workspaces/sessions/(frontend)/fill/Subagents.subagents.run-control.native.ts
|
|
2450
|
+
var Subagents_subagents_run_control_native_default = defineFill({
|
|
2451
|
+
slot: "subagents.run-control",
|
|
2452
|
+
id: "subagents",
|
|
2453
|
+
data: subagentRunControlAction
|
|
2454
|
+
});
|
|
2455
|
+
//#endregion
|
|
2425
2456
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/Team.help.guides.native.ts
|
|
2426
2457
|
var Team_help_guides_native_default = defineFill({
|
|
2427
2458
|
slot: "help.guides",
|
|
@@ -2464,6 +2495,12 @@ var Team_help_guides_native_default = defineFill({
|
|
|
2464
2495
|
}
|
|
2465
2496
|
});
|
|
2466
2497
|
//#endregion
|
|
2498
|
+
//#region src/extensions/workspaces/sessions/(frontend)/slot/run-control.native.ts
|
|
2499
|
+
var run_control_native_default = defineSlotFile({
|
|
2500
|
+
slot: "subagents.run-control",
|
|
2501
|
+
parse: parseSubagentRunControlAction
|
|
2502
|
+
});
|
|
2503
|
+
//#endregion
|
|
2467
2504
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/_components/IntercomToolMessage.native.tsx
|
|
2468
2505
|
/** How the outgoing bubble settled, as a quiet line beneath it. An answer is its own bubble instead. */
|
|
2469
2506
|
const OUTCOME_LINE = (t) => ({
|
|
@@ -3316,13 +3353,23 @@ const nativePlugin = defineNativePlugin({
|
|
|
3316
3353
|
return [via({ channel: "subagent_catalog" }, subagent_catalog_native_default), via({ channel: "subagent_runs" }, subagent_runs_native_default)];
|
|
3317
3354
|
},
|
|
3318
3355
|
get fills() {
|
|
3319
|
-
return [
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3356
|
+
return [
|
|
3357
|
+
via({
|
|
3358
|
+
slot: "activity.agents",
|
|
3359
|
+
id: "agents"
|
|
3360
|
+
}, Agents_activity_agents_native_default),
|
|
3361
|
+
via({
|
|
3362
|
+
slot: "subagents.run-control",
|
|
3363
|
+
id: "subagents"
|
|
3364
|
+
}, Subagents_subagents_run_control_native_default),
|
|
3365
|
+
via({
|
|
3366
|
+
slot: "help.guides",
|
|
3367
|
+
id: "team"
|
|
3368
|
+
}, Team_help_guides_native_default)
|
|
3369
|
+
];
|
|
3370
|
+
},
|
|
3371
|
+
get slots() {
|
|
3372
|
+
return [via({ slot: "subagents.run-control" }, run_control_native_default)];
|
|
3326
3373
|
},
|
|
3327
3374
|
get toolRenderers() {
|
|
3328
3375
|
return [
|