@agimon-ai/po-cloudflare 0.0.2-alpha.11 → 0.0.2-alpha.13
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/agent-DYFqCLl2.js +6850 -0
- package/dist/assets/plugins/assets/base-C3j1WCCq.css +2 -0
- package/dist/assets/plugins/chunks/po-web-runtime-Czm_C4SJ.js +1 -0
- package/dist/assets/plugins/compositions.json +1 -1
- package/dist/assets/plugins/slots/approval.8b3f37d9-CqQk6XG_.js +2 -0
- package/dist/assets/plugins/slots/artifacts.47d00f81-D-vQ-7Iz.js +1 -0
- package/dist/assets/plugins/slots/autocompact.9a92993d-B3KTYwW1.js +1 -0
- package/dist/assets/plugins/slots/builtin-tools.939bbfff-CZRYQVIP.js +7 -0
- package/dist/assets/plugins/slots/codemode.782e5bb1-Bzl_K_vt.js +10 -0
- package/dist/assets/plugins/slots/domain.21790b66-CvnpuKCY.js +1 -0
- package/dist/assets/plugins/slots/edit.c7c85129-kaxIknZ-.js +7 -0
- package/dist/assets/plugins/slots/files.bbcef824-wuB8gcQA.js +2 -0
- package/dist/assets/plugins/slots/grep.3dfd3214-3FnU8p-d.js +1 -0
- package/dist/assets/plugins/slots/log.33bc7d38-C0PXQ0O1.js +4 -0
- package/dist/assets/plugins/slots/mcp.59c68bcb-D0CkHnIw.js +109 -0
- package/dist/assets/plugins/slots/{profile.ab16dcec-B5yt7eny.js → profile.ea55f5e1-BSY3iYfJ.js} +1 -1
- package/dist/assets/plugins/slots/prompts.9957cc84-xdCkNkoA.js +3 -0
- package/dist/assets/plugins/slots/read.30a617e7-qqaxVlEX.js +1 -0
- package/dist/assets/plugins/slots/runner.9f3559b0-DfO2Z9HG.js +8 -0
- package/dist/assets/plugins/slots/skill.f506a5ea-CL_n-l4h.js +4 -0
- package/dist/assets/plugins/slots/vault.01657352-DbG3F_on.js +1 -0
- package/dist/{atomicJson-C_lN9leA.js → atomicJson-BF1fVXy1.js} +1 -1
- package/dist/browser-BWf8OMfl.js +3 -0
- package/dist/childSession-Cf2-kH4O.js +22 -0
- package/dist/{server-D190dXDN.js → dist-B-vqs6tA.js} +1 -546
- package/dist/{domains-CPX1dEVa.js → domains-Bl6T2dKV.js} +2 -2
- package/dist/{server-C5wixba6.js → esm-BKJy3O9-.js} +3 -296
- package/dist/{exports-2Vv52b9v.js → exports-CxkWsXI9.js} +7 -6
- package/dist/{exports-BF12Ftrd.js → exports-DlcCEAe3.js} +2 -9
- package/dist/{extensionFile-DpVvh-ud.js → extensionFile-D7wk8tFr.js} +11 -1
- package/dist/harnessStore-Bap8lsAg.js +1 -0
- package/dist/{harnessStore-Ct329wxJ.js → harnessStore-flLz1I0F.js} +2 -2
- package/dist/help-DjybmnPW.js +91 -0
- package/dist/{hubChannel-kFgtfJnv.js → hubChannel-Bi3PQrfD.js} +3 -27
- package/dist/hubRevisions-58pU2dW5.js +363 -0
- package/dist/index.edge-C9_xuXyy.js +57 -0
- package/dist/{index.edge-DhV_hfZA.js → index.edge-CJ2TFpgF.js} +2 -2
- package/dist/index.edge-COJJ_Dv2.js +937 -0
- package/dist/index.edge-ChYa2LU4.js +14 -0
- package/dist/index.edge-ClLTmPFz.js +191 -0
- package/dist/{index.edge-BNElrrHY.js → index.edge-uSjRpm6Z.js} +5 -0
- package/dist/iso-BPQViXM8.js +10 -0
- package/dist/{layeredConfig-BhFC6TBD.js → layeredConfig-B4s0eZ5o.js} +11 -4
- package/dist/{majorModes-CZqrWarh.js → majorModes-IygGmbb8.js} +2 -2
- package/dist/majorModes-xpLK9HpD.js +1 -0
- package/dist/notification-bGq1frYG.js +99 -0
- package/dist/piConfig-CcoMX-1L.js +127 -0
- package/dist/{platformFiles-BTDsAsmT.js → platformFiles-Ccj9HCvA.js} +24 -2
- package/dist/pluginContributions-Be9EnCAW.js +16 -0
- package/dist/sealedChannel-BeWNTWys.js +27 -0
- package/dist/server-4CmqIbH2.js +1476 -0
- package/dist/{server-DesPQYzJ.js → server-5vLvBTTs.js} +1 -1
- package/dist/server-BHhb0oir.js +505 -0
- package/dist/server-Bm6pAAw8.js +935 -0
- package/dist/server-C82Qzoh3.js +2658 -0
- package/dist/server-C8HyW7wN.js +489 -0
- package/dist/{server-DSusAvqK.js → server-C9gff7gU.js} +1 -1
- package/dist/{server-CTIkoJXM.js → server-CIhwIcbA.js} +4 -4
- package/dist/{server-DbmCxFL-.js → server-CMaTba5B.js} +1 -1
- package/dist/{server-DolHpEoY.js → server-COE7BKSa.js} +1 -1
- package/dist/server-CQXqMpeC.js +1744 -0
- package/dist/{server-BG6gwBcv.js → server-CTSvwoDy.js} +5 -4
- package/dist/server-C_34VM3M.js +217 -0
- package/dist/{server-CuGXhVFA.js → server-C_3jK2WM.js} +5 -5
- package/dist/server-CcNMwEFQ.js +190 -0
- package/dist/{server-D-zQp04y.js → server-CjsKNdSN.js} +1 -1
- package/dist/{server-DQy8hVXg.js → server-ClsNJwdv.js} +8 -8
- package/dist/{server-DfBHHyQo.js → server-Co57A8MH.js} +2 -9
- package/dist/{server-CRtXiNBP.js → server-CpJNq249.js} +5 -5
- package/dist/{server-zYYAg7ki.js → server-CxGGQFJs.js} +5 -16
- package/dist/{server-DpVsUiA-.js → server-DSu_uLDX.js} +4 -4
- package/dist/server-DeSuziRK.js +680 -0
- package/dist/{server-BIjpcE0Y.js → server-ZsazKk-n.js} +3 -3
- package/dist/{server-CZoHLCxk.js → server-il_s2Ycz.js} +5 -93
- package/dist/server-ziNfBZ2M.js +295 -0
- package/dist/{sessionConfig-BLmM5XLM.js → sessionConfig-DzAs6Pt-.js} +64 -499
- package/dist/{notification-qvyJJ_Df.js → telemetry-Csv1ZxAn.js} +1 -99
- package/dist/truncate-M3KbFyVj.js +89 -0
- package/dist/web-Cfvbn9H1.js +3 -0
- package/dist/worker.js +4545 -12244
- package/dist/workflow-w5JPZXgc.js +23 -0
- package/package.json +32 -24
- package/dist/assets/plugins/assets/base-_m1hGahv.css +0 -2
- package/dist/assets/plugins/chunks/po-web-runtime-CGjOl_1I.js +0 -1
- package/dist/assets/plugins/slots/approval.09e72f36-BW92gZQg.js +0 -2
- package/dist/assets/plugins/slots/artifacts.50b639bb-B6zDJhex.js +0 -1
- package/dist/assets/plugins/slots/builtin-tools.75108f21-DS-dJ07p.js +0 -7
- package/dist/assets/plugins/slots/codemode.c58fb583--t-nrGeQ.js +0 -10
- package/dist/assets/plugins/slots/domain.753f9f92-DWSqP3Jw.js +0 -1
- package/dist/assets/plugins/slots/mcp.82cc1ff5-jPY2OCuu.js +0 -109
- package/dist/assets/plugins/slots/skill.62a0a1b3-GtWLT33O.js +0 -4
- package/dist/assets/plugins/slots/vault.3cbfcdc3-B7BKfR_H.js +0 -1
- package/dist/harnessStore-BDI-s999.js +0 -1
- package/dist/majorModes-CzAWXyaf.js +0 -1
|
@@ -1,56 +1,3 @@
|
|
|
1
|
-
import { Et as String$1, Ot as Number, Q as PO_FS_SERVICE, Qt as _Object_, Yn as BACKGROUND_CONTEXT, Zn as withAbortSignal, at as requirePoFs, c as fileMutationRunner, en as Optional, p as getOrThrow } from "./serverPlugin-pCqlBqQG.js";
|
|
2
|
-
import { d as defineServerTool, f as defineServerPlugin, u as defineServerCommand } from "./extensionFile-DpVvh-ud.js";
|
|
3
|
-
import "./platform-CyvF7X-b.js";
|
|
4
|
-
import { dirname, relative, resolve, sep } from "node:path";
|
|
5
|
-
//#region ../../foundations/po-ui/src/constants/ui.ts
|
|
6
|
-
const TOOLS_COMMAND = "tools";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region ../../foundations/po-ui/src/services/sessionToolInventory/index.ts
|
|
9
|
-
function toolNames(entries) {
|
|
10
|
-
const names = /* @__PURE__ */ new Set();
|
|
11
|
-
for (const entry of entries) {
|
|
12
|
-
const message = entry.message;
|
|
13
|
-
if (!message || typeof message !== "object" || Array.isArray(message)) continue;
|
|
14
|
-
const content = message.content;
|
|
15
|
-
if (!Array.isArray(content)) continue;
|
|
16
|
-
for (const block of content) {
|
|
17
|
-
if (!block || typeof block !== "object" || Array.isArray(block)) continue;
|
|
18
|
-
const name = block.name;
|
|
19
|
-
if (typeof name === "string" && name) names.add(name);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return [...names].sort();
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region ../../foundations/po-ui/src/extensions/workspaces/sessions/(backend)/_lib/sessionInventory.ts
|
|
26
|
-
/**
|
|
27
|
-
* The TUI shell itself stays Pi-only. Inventory is the shared part and is exposed
|
|
28
|
-
* from session data rather than silently installing a fake editor/widget host.
|
|
29
|
-
*
|
|
30
|
-
* Inventory is a command, never a context resource. It reports the tools observed
|
|
31
|
-
* in the transcript, which is not the tool surface the current selection exposes:
|
|
32
|
-
* as a prompt section it listed tools the session had since gated out, directly
|
|
33
|
-
* contradicting the `Available tools:` block, and it grew for the whole session.
|
|
34
|
-
*/
|
|
35
|
-
function createUiServerContributions() {
|
|
36
|
-
return { commands: [{
|
|
37
|
-
name: TOOLS_COMMAND,
|
|
38
|
-
description: "Show tools observed in this headless session. TUI rendering remains unavailable.",
|
|
39
|
-
async execute(_args, execution) {
|
|
40
|
-
const names = /* @__PURE__ */ new Set();
|
|
41
|
-
for await (const entry of execution.session.entriesNewestFirst({ type: "message" })) for (const name of toolNames([entry])) names.add(name);
|
|
42
|
-
await execution.client.notify({
|
|
43
|
-
title: "Po tools",
|
|
44
|
-
body: [...names].sort().join("\n") || "(no tool calls recorded in this session)",
|
|
45
|
-
level: "info"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}] };
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region ../../foundations/po-ui/src/extensions/workspaces/sessions/(backend)/command/tools.server.ts
|
|
52
|
-
var tools_server_default = defineServerCommand(createUiServerContributions().commands[0]);
|
|
53
|
-
//#endregion
|
|
54
1
|
//#region ../../../node_modules/.pnpm/balanced-match@4.0.3/node_modules/balanced-match/dist/esm/index.js
|
|
55
2
|
const balanced = (a, b, str) => {
|
|
56
3
|
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
@@ -1039,11 +986,11 @@ const qmarksTestNoExtDot = ([$0]) => {
|
|
|
1039
986
|
};
|
|
1040
987
|
/* c8 ignore start */
|
|
1041
988
|
const defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
1042
|
-
const path
|
|
989
|
+
const path = {
|
|
1043
990
|
win32: { sep: "\\" },
|
|
1044
991
|
posix: { sep: "/" }
|
|
1045
992
|
};
|
|
1046
|
-
minimatch.sep = defaultPlatform === "win32" ? path
|
|
993
|
+
minimatch.sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
1047
994
|
const GLOBSTAR = Symbol("globstar **");
|
|
1048
995
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
1049
996
|
const star = "[^/]*?";
|
|
@@ -1603,244 +1550,4 @@ minimatch.Minimatch = Minimatch;
|
|
|
1603
1550
|
minimatch.escape = escape;
|
|
1604
1551
|
minimatch.unescape = unescape;
|
|
1605
1552
|
//#endregion
|
|
1606
|
-
|
|
1607
|
-
const EdgeWriteParamsSchema = _Object_({
|
|
1608
|
-
path: String$1({ description: "Path to the file to write in the session workspace (relative or absolute)" }),
|
|
1609
|
-
content: String$1({ description: "Content to write to the file (at most 1 MiB)" })
|
|
1610
|
-
});
|
|
1611
|
-
const EdgeFindParamsSchema = _Object_({
|
|
1612
|
-
pattern: String$1({ description: "Glob pattern to match files, e.g. '*.ts', '**/*.json', or 'src/**/*.spec.ts'" }),
|
|
1613
|
-
path: Optional(String$1({ description: "Directory to search in the session workspace (default: current directory)" })),
|
|
1614
|
-
limit: Optional(Number({ description: "Maximum number of results (default: 1000)" }))
|
|
1615
|
-
});
|
|
1616
|
-
const EdgeLsParamsSchema = _Object_({
|
|
1617
|
-
path: Optional(String$1({ description: "Directory to list in the session workspace (default: current directory)" })),
|
|
1618
|
-
limit: Optional(Number({ description: "Maximum number of entries to return (default: 500)" }))
|
|
1619
|
-
});
|
|
1620
|
-
//#endregion
|
|
1621
|
-
//#region ../../foundations/po-ui/src/extensions/workspaces/sessions/(backend)/_lib/serverFileTools.edge.ts
|
|
1622
|
-
const LS_DEFAULT_LIMIT = 500;
|
|
1623
|
-
const FIND_DEFAULT_LIMIT = 1e3;
|
|
1624
|
-
const MAX_OUTPUT_BYTES = 51200;
|
|
1625
|
-
const MAX_WALKED_DIRECTORIES = 1e4;
|
|
1626
|
-
const NODE_MODULES = "node_modules";
|
|
1627
|
-
const ABORTED = "Operation aborted";
|
|
1628
|
-
const encoder = new TextEncoder();
|
|
1629
|
-
/** The session's po/fs, bound while the mount's service is live and cleared when it goes away. */
|
|
1630
|
-
function sessionFileSystem(mount, toolName) {
|
|
1631
|
-
let filesystem;
|
|
1632
|
-
mount?.context.inject([PO_FS_SERVICE], (scoped) => {
|
|
1633
|
-
const bound = requirePoFs(scoped);
|
|
1634
|
-
filesystem = bound;
|
|
1635
|
-
return () => {
|
|
1636
|
-
if (filesystem === bound) filesystem = void 0;
|
|
1637
|
-
};
|
|
1638
|
-
});
|
|
1639
|
-
return () => {
|
|
1640
|
-
if (!filesystem) throw new Error(`The ${toolName} tool has no session filesystem.`);
|
|
1641
|
-
return filesystem;
|
|
1642
|
-
};
|
|
1643
|
-
}
|
|
1644
|
-
function throwIfAborted(signal) {
|
|
1645
|
-
if (signal?.aborted) throw new Error(ABORTED);
|
|
1646
|
-
}
|
|
1647
|
-
function ioContext(signal) {
|
|
1648
|
-
return signal ? withAbortSignal(signal, BACKGROUND_CONTEXT) : BACKGROUND_CONTEXT;
|
|
1649
|
-
}
|
|
1650
|
-
function portable(path) {
|
|
1651
|
-
return path.split(sep).join("/");
|
|
1652
|
-
}
|
|
1653
|
-
function byteLength(text) {
|
|
1654
|
-
return encoder.encode(text).byteLength;
|
|
1655
|
-
}
|
|
1656
|
-
/** Whole lines up to the byte cap, the way Pi truncates its listing output. */
|
|
1657
|
-
function truncateLines(lines) {
|
|
1658
|
-
const kept = [];
|
|
1659
|
-
let bytes = 0;
|
|
1660
|
-
for (const line of lines) {
|
|
1661
|
-
const next = byteLength(line) + (kept.length > 0 ? 1 : 0);
|
|
1662
|
-
if (bytes + next > MAX_OUTPUT_BYTES) return {
|
|
1663
|
-
text: kept.join("\n"),
|
|
1664
|
-
truncated: true
|
|
1665
|
-
};
|
|
1666
|
-
kept.push(line);
|
|
1667
|
-
bytes += next;
|
|
1668
|
-
}
|
|
1669
|
-
return {
|
|
1670
|
-
text: kept.join("\n"),
|
|
1671
|
-
truncated: false
|
|
1672
|
-
};
|
|
1673
|
-
}
|
|
1674
|
-
function listingResult(lines, limitNotice) {
|
|
1675
|
-
const { text, truncated } = truncateLines(lines);
|
|
1676
|
-
const notices = [limitNotice, truncated ? `${MAX_OUTPUT_BYTES / 1024}KB limit reached` : void 0].filter((notice) => notice !== void 0);
|
|
1677
|
-
return {
|
|
1678
|
-
content: [{
|
|
1679
|
-
type: "text",
|
|
1680
|
-
text: notices.length > 0 ? `${text}\n\n[${notices.join(". ")}]` : text
|
|
1681
|
-
}],
|
|
1682
|
-
details: notices.length > 0 ? {
|
|
1683
|
-
truncated,
|
|
1684
|
-
limitReached: limitNotice !== void 0
|
|
1685
|
-
} : void 0
|
|
1686
|
-
};
|
|
1687
|
-
}
|
|
1688
|
-
async function directoryEntries(filesystem, path, context) {
|
|
1689
|
-
const listed = await filesystem.listDir(path, context);
|
|
1690
|
-
if (listed.ok) return listed.value;
|
|
1691
|
-
if (listed.error.code === "not_found") throw new Error(`Path not found: ${path}`);
|
|
1692
|
-
if (listed.error.code === "not_directory") throw new Error(`Not a directory: ${path}`);
|
|
1693
|
-
throw listed.error;
|
|
1694
|
-
}
|
|
1695
|
-
function createServerWriteTool(mount) {
|
|
1696
|
-
const filesystem = sessionFileSystem(mount, "write");
|
|
1697
|
-
return {
|
|
1698
|
-
name: "write",
|
|
1699
|
-
label: "write",
|
|
1700
|
-
description: "Write content to a file in the session workspace. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories. Files are limited to 1 MiB.",
|
|
1701
|
-
promptSnippet: "Create or overwrite files",
|
|
1702
|
-
parameters: EdgeWriteParamsSchema,
|
|
1703
|
-
async execute(_toolCallId, { path, content }, signal, _onUpdate, execution) {
|
|
1704
|
-
const target = resolve(execution.cwd, path);
|
|
1705
|
-
const fs = filesystem();
|
|
1706
|
-
const context = ioContext(signal);
|
|
1707
|
-
return fileMutationRunner.forKey(target)(async () => {
|
|
1708
|
-
throwIfAborted(signal);
|
|
1709
|
-
getOrThrow(await fs.createDir(dirname(target), { recursive: true }, context));
|
|
1710
|
-
throwIfAborted(signal);
|
|
1711
|
-
getOrThrow(await fs.writeFile(target, content, context));
|
|
1712
|
-
return { content: [{
|
|
1713
|
-
type: "text",
|
|
1714
|
-
text: `Successfully wrote ${byteLength(content)} bytes to ${path}`
|
|
1715
|
-
}] };
|
|
1716
|
-
});
|
|
1717
|
-
}
|
|
1718
|
-
};
|
|
1719
|
-
}
|
|
1720
|
-
function createServerLsTool(mount) {
|
|
1721
|
-
const filesystem = sessionFileSystem(mount, "ls");
|
|
1722
|
-
return {
|
|
1723
|
-
name: "ls",
|
|
1724
|
-
label: "ls",
|
|
1725
|
-
description: `List a directory in the session workspace. Returns entries sorted alphabetically, with '/' suffix for directories. Includes dotfiles. Output is truncated to ${LS_DEFAULT_LIMIT} entries or ${MAX_OUTPUT_BYTES / 1024}KB (whichever is hit first). Files are limited to 1 MiB.`,
|
|
1726
|
-
promptSnippet: "List directory contents",
|
|
1727
|
-
parameters: EdgeLsParamsSchema,
|
|
1728
|
-
executionMode: "parallel",
|
|
1729
|
-
async execute(_toolCallId, { path, limit }, signal, _onUpdate, execution) {
|
|
1730
|
-
throwIfAborted(signal);
|
|
1731
|
-
const target = resolve(execution.cwd, path || ".");
|
|
1732
|
-
const effectiveLimit = limit ?? LS_DEFAULT_LIMIT;
|
|
1733
|
-
const entries = await directoryEntries(filesystem(), target, ioContext(signal));
|
|
1734
|
-
throwIfAborted(signal);
|
|
1735
|
-
const names = entries.map((entry) => entry.kind === "directory" ? `${entry.name}/` : entry.name).sort((left, right) => left.toLowerCase().localeCompare(right.toLowerCase()));
|
|
1736
|
-
if (names.length === 0) return { content: [{
|
|
1737
|
-
type: "text",
|
|
1738
|
-
text: "(empty directory)"
|
|
1739
|
-
}] };
|
|
1740
|
-
const limited = names.length > effectiveLimit;
|
|
1741
|
-
return listingResult(limited ? names.slice(0, effectiveLimit) : names, limited ? `${effectiveLimit} entries limit reached. Use limit=${effectiveLimit * 2} for more` : void 0);
|
|
1742
|
-
}
|
|
1743
|
-
};
|
|
1744
|
-
}
|
|
1745
|
-
/** fd semantics: a bare pattern matches the basename, a pattern with a slash matches the path anywhere below. */
|
|
1746
|
-
function findMatcher(pattern) {
|
|
1747
|
-
if (!pattern.includes("/")) return (path) => minimatch(path, pattern, {
|
|
1748
|
-
dot: true,
|
|
1749
|
-
matchBase: true
|
|
1750
|
-
});
|
|
1751
|
-
const effective = pattern.startsWith("/") || pattern.startsWith("**/") || pattern === "**" ? pattern : `**/${pattern}`;
|
|
1752
|
-
return (path) => minimatch(path, effective, { dot: true });
|
|
1753
|
-
}
|
|
1754
|
-
function createServerFindTool(mount) {
|
|
1755
|
-
const filesystem = sessionFileSystem(mount, "find");
|
|
1756
|
-
return {
|
|
1757
|
-
name: "find",
|
|
1758
|
-
label: "find",
|
|
1759
|
-
description: `Search the session workspace for files by glob pattern. Returns matching file paths relative to the search directory. Skips node_modules and dot-directories unless the pattern names them. Output is truncated to ${FIND_DEFAULT_LIMIT} results or ${MAX_OUTPUT_BYTES / 1024}KB (whichever is hit first). Files are limited to 1 MiB.`,
|
|
1760
|
-
promptSnippet: "Find files by glob pattern",
|
|
1761
|
-
parameters: EdgeFindParamsSchema,
|
|
1762
|
-
executionMode: "parallel",
|
|
1763
|
-
async execute(_toolCallId, { pattern, path, limit }, signal, _onUpdate, execution) {
|
|
1764
|
-
throwIfAborted(signal);
|
|
1765
|
-
const root = resolve(execution.cwd, path || ".");
|
|
1766
|
-
const effectiveLimit = limit ?? FIND_DEFAULT_LIMIT;
|
|
1767
|
-
const matches = findMatcher(pattern);
|
|
1768
|
-
const walkNodeModules = pattern.includes(NODE_MODULES);
|
|
1769
|
-
const walkDotDirectories = /(?:^|\/)\./u.test(pattern);
|
|
1770
|
-
const fs = filesystem();
|
|
1771
|
-
const context = ioContext(signal);
|
|
1772
|
-
const results = [];
|
|
1773
|
-
const pending = [root];
|
|
1774
|
-
let walked = 0;
|
|
1775
|
-
let resultLimitReached = false;
|
|
1776
|
-
let walkLimitReached = false;
|
|
1777
|
-
while (pending.length > 0 && !resultLimitReached) {
|
|
1778
|
-
throwIfAborted(signal);
|
|
1779
|
-
if (walked >= MAX_WALKED_DIRECTORIES) {
|
|
1780
|
-
walkLimitReached = true;
|
|
1781
|
-
break;
|
|
1782
|
-
}
|
|
1783
|
-
const directory = pending.pop();
|
|
1784
|
-
walked++;
|
|
1785
|
-
const entries = await directoryEntries(fs, directory, context);
|
|
1786
|
-
const subdirectories = [];
|
|
1787
|
-
for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
|
|
1788
|
-
const display = portable(relative(root, entry.path));
|
|
1789
|
-
const isDirectory = entry.kind === "directory";
|
|
1790
|
-
if (matches(display)) {
|
|
1791
|
-
if (results.length >= effectiveLimit) {
|
|
1792
|
-
resultLimitReached = true;
|
|
1793
|
-
break;
|
|
1794
|
-
}
|
|
1795
|
-
results.push(isDirectory ? `${display}/` : display);
|
|
1796
|
-
}
|
|
1797
|
-
if (!isDirectory) continue;
|
|
1798
|
-
if (entry.name === NODE_MODULES && !walkNodeModules) continue;
|
|
1799
|
-
if (entry.name.startsWith(".") && !walkDotDirectories) continue;
|
|
1800
|
-
subdirectories.push(entry.path);
|
|
1801
|
-
}
|
|
1802
|
-
pending.push(...subdirectories.reverse());
|
|
1803
|
-
}
|
|
1804
|
-
throwIfAborted(signal);
|
|
1805
|
-
if (results.length === 0) return { content: [{
|
|
1806
|
-
type: "text",
|
|
1807
|
-
text: "No files found matching pattern"
|
|
1808
|
-
}] };
|
|
1809
|
-
const notices = [resultLimitReached ? `${effectiveLimit} results limit reached` : void 0, walkLimitReached ? `Stopped after ${MAX_WALKED_DIRECTORIES} directories; narrow the path` : void 0].filter((notice) => notice !== void 0);
|
|
1810
|
-
return listingResult(results, notices.length > 0 ? notices.join(". ") : void 0);
|
|
1811
|
-
}
|
|
1812
|
-
};
|
|
1813
|
-
}
|
|
1814
|
-
//#endregion
|
|
1815
|
-
//#region ../../foundations/po-ui/src/extensions/workspaces/sessions/(backend)/tool/find.server.ts
|
|
1816
|
-
var find_server_default = defineServerTool(createServerFindTool);
|
|
1817
|
-
//#endregion
|
|
1818
|
-
//#region ../../foundations/po-ui/src/extensions/workspaces/sessions/(backend)/tool/ls.server.ts
|
|
1819
|
-
var ls_server_default = defineServerTool(createServerLsTool);
|
|
1820
|
-
//#endregion
|
|
1821
|
-
//#region ../../foundations/po-ui/src/extensions/workspaces/sessions/(backend)/tool/write.server.ts
|
|
1822
|
-
var write_server_default = defineServerTool(createServerWriteTool);
|
|
1823
|
-
//#endregion
|
|
1824
|
-
//#region ../../foundations/po-ui/generated/server.ts
|
|
1825
|
-
const at = (value, context) => typeof value === "function" ? value(context) : value;
|
|
1826
|
-
const via = (identity, value) => value === void 0 ? void 0 : {
|
|
1827
|
-
...identity,
|
|
1828
|
-
...value
|
|
1829
|
-
};
|
|
1830
|
-
const serverPlugin = defineServerPlugin({
|
|
1831
|
-
name: "@agimon-ai/po-ui",
|
|
1832
|
-
session: (context) => ({
|
|
1833
|
-
get commands() {
|
|
1834
|
-
return [via({ name: "tools" }, at(tools_server_default, context))];
|
|
1835
|
-
},
|
|
1836
|
-
get tools() {
|
|
1837
|
-
return [
|
|
1838
|
-
via({ name: "find" }, at(find_server_default, context)),
|
|
1839
|
-
via({ name: "ls" }, at(ls_server_default, context)),
|
|
1840
|
-
via({ name: "write" }, at(write_server_default, context))
|
|
1841
|
-
];
|
|
1842
|
-
}
|
|
1843
|
-
})
|
|
1844
|
-
});
|
|
1845
|
-
//#endregion
|
|
1846
|
-
export { serverPlugin as default, serverPlugin };
|
|
1553
|
+
export { minimatch as t };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { s as createSerialRunner } from "./serverPlugin-pCqlBqQG.js";
|
|
2
2
|
import "./platform-CyvF7X-b.js";
|
|
3
|
-
import "./atomicJson-
|
|
4
|
-
import "./layeredConfig-
|
|
5
|
-
import "./sessionConfig-
|
|
6
|
-
import "./domains-
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
3
|
+
import "./atomicJson-BF1fVXy1.js";
|
|
4
|
+
import "./layeredConfig-B4s0eZ5o.js";
|
|
5
|
+
import "./sessionConfig-DzAs6Pt-.js";
|
|
6
|
+
import "./domains-Bl6T2dKV.js";
|
|
7
|
+
import "./piConfig-CcoMX-1L.js";
|
|
8
|
+
import "./majorModes-IygGmbb8.js";
|
|
9
|
+
import "./harnessStore-flLz1I0F.js";
|
|
9
10
|
import "node:path";
|
|
10
11
|
//#region ../../foundations/po-config/src/services/init/templates.ts
|
|
11
12
|
/** Personal-only: a repository pin would override the layout the person picks during onboarding. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { nr as defineServiceContract } from "./serverPlugin-pCqlBqQG.js";
|
|
2
2
|
import { n as Check } from "./value-DGT5IoiK.js";
|
|
3
|
-
import { A as string$1,
|
|
3
|
+
import { A as string$1, C as looseObject, D as preprocess, E as optional, F as safeParse, I as toJSONSchema, L as _coercedBoolean, M as unknown, N as url, O as record$1, R as _coercedNumber, S as literal, T as object, U as NEVER, _ as intersection, c as _enum, d as any, f as array, g as email, h as discriminatedUnion, i as ZodNumber, j as union, l as _null, p as boolean$1, s as ZodString, t as ZodBoolean, w as number$1, x as lazy, z as _coercedString } from "./schemas-Vj8-rCR4.js";
|
|
4
|
+
import { n as datetime, t as date$1 } from "./iso-BPQViXM8.js";
|
|
4
5
|
import { a as assertRevision, i as assertEntryName, l as VAULT_ACCOUNT_OPERATIONS, n as VaultError, o as serializeValue } from "./vaultSettings-BRr8n821.js";
|
|
5
6
|
import { createHash } from "node:crypto";
|
|
6
7
|
import "node:path";
|
|
@@ -179,14 +180,6 @@ const ZodIssueCode = {
|
|
|
179
180
|
var ZodFirstPartyTypeKind;
|
|
180
181
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
181
182
|
//#endregion
|
|
182
|
-
//#region ../../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
183
|
-
function datetime(params) {
|
|
184
|
-
return _isoDateTime(ZodISODateTime, params);
|
|
185
|
-
}
|
|
186
|
-
function date$1(params) {
|
|
187
|
-
return _isoDate(ZodISODate, params);
|
|
188
|
-
}
|
|
189
|
-
//#endregion
|
|
190
183
|
//#region ../../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/coerce.js
|
|
191
184
|
function string(params) {
|
|
192
185
|
return _coercedString(ZodString, params);
|
|
@@ -334,6 +334,16 @@ function defineRoutedContribution(file, _options) {
|
|
|
334
334
|
function defineResource(file) {
|
|
335
335
|
return file;
|
|
336
336
|
}
|
|
337
|
+
/** `tool/<name>.ts`. Adds the discriminant the contribution array expects. */
|
|
338
|
+
function defineTool(file) {
|
|
339
|
+
return typeof file === "function" ? (context) => ({
|
|
340
|
+
kind: "tool",
|
|
341
|
+
...file(context)
|
|
342
|
+
}) : {
|
|
343
|
+
kind: "tool",
|
|
344
|
+
...file
|
|
345
|
+
};
|
|
346
|
+
}
|
|
337
347
|
/** `tool/<name>.server.ts`. A native headless tool, handed to the host untouched. */
|
|
338
348
|
function defineServerTool(file) {
|
|
339
349
|
return file;
|
|
@@ -406,4 +416,4 @@ function defineMethod(file) {
|
|
|
406
416
|
return file;
|
|
407
417
|
}
|
|
408
418
|
//#endregion
|
|
409
|
-
export { defineMethod as a, defineRoute as c, defineServerTool as d,
|
|
419
|
+
export { defineMethod as a, defineRoute as c, defineServerTool as d, defineTool as f, defineHook as i, defineRoutedContribution as l, runCleanups as m, composeRootInjects as n, defineResource as o, defineServerPlugin as p, defineChannel as r, defineRoot as s, composeRootHooks as t, defineServerCommand as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./harnessStore-flLz1I0F.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { l as nodeHost, s as createSerialRunner } from "./serverPlugin-pCqlBqQG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as readTextIfExists } from "./platformFiles-Ccj9HCvA.js";
|
|
3
3
|
import "./platform-CyvF7X-b.js";
|
|
4
|
-
import "./atomicJson-
|
|
4
|
+
import "./atomicJson-BF1fVXy1.js";
|
|
5
5
|
import { t as readHarnessState } from "./harnessState-gmzJcPGt.js";
|
|
6
6
|
import "node:path";
|
|
7
7
|
//#region ../../foundations/po-config/src/services/harnessStore/core.ts
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Et as String, It as Literal, Lt as Integer, Qt as _Object_, an as _Array_, en as Optional, nr as defineServiceContract, wt as Union } from "./serverPlugin-pCqlBqQG.js";
|
|
2
|
+
import "./value-DGT5IoiK.js";
|
|
3
|
+
//#region ../../core/po-core/src/schemas/help.ts
|
|
4
|
+
const PO_HELP_WHEN = {
|
|
5
|
+
state: { "minor-mode": "help" },
|
|
6
|
+
attribution: {
|
|
7
|
+
kind: "minor",
|
|
8
|
+
mode: "help"
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
defineServiceContract("po/package-health", { scope: "global" });
|
|
12
|
+
defineServiceContract("po/self-improve", { scope: "global" });
|
|
13
|
+
const MAX_SOURCE_LENGTH = 128;
|
|
14
|
+
const MAX_SKILL_NAME_LENGTH = 64;
|
|
15
|
+
const MAX_MODULE_URL_LENGTH = 4096;
|
|
16
|
+
const MAX_IDENTIFIER_LENGTH = 256;
|
|
17
|
+
const PoHelpSourceSchema = String({
|
|
18
|
+
minLength: 1,
|
|
19
|
+
maxLength: MAX_SOURCE_LENGTH,
|
|
20
|
+
pattern: "^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$"
|
|
21
|
+
});
|
|
22
|
+
const PoHelpSkillNameSchema = String({
|
|
23
|
+
minLength: 1,
|
|
24
|
+
maxLength: MAX_SKILL_NAME_LENGTH,
|
|
25
|
+
pattern: "^[a-z0-9][a-z0-9-]*$"
|
|
26
|
+
});
|
|
27
|
+
const PoHelpSkillDescriptorSchema = _Object_({
|
|
28
|
+
name: PoHelpSkillNameSchema,
|
|
29
|
+
description: String({
|
|
30
|
+
minLength: 1,
|
|
31
|
+
maxLength: 512
|
|
32
|
+
})
|
|
33
|
+
}, { additionalProperties: false });
|
|
34
|
+
_Object_({
|
|
35
|
+
source: PoHelpSourceSchema,
|
|
36
|
+
moduleUrl: String({
|
|
37
|
+
minLength: 1,
|
|
38
|
+
maxLength: MAX_MODULE_URL_LENGTH
|
|
39
|
+
}),
|
|
40
|
+
skills: _Array_(PoHelpSkillDescriptorSchema, {
|
|
41
|
+
minItems: 1,
|
|
42
|
+
maxItems: 64
|
|
43
|
+
})
|
|
44
|
+
}, { additionalProperties: false });
|
|
45
|
+
const GenerationSchema = String({
|
|
46
|
+
minLength: 1,
|
|
47
|
+
maxLength: MAX_IDENTIFIER_LENGTH
|
|
48
|
+
});
|
|
49
|
+
const PoHelpActivationSchema = Union([
|
|
50
|
+
Literal("inactive"),
|
|
51
|
+
Literal("activating"),
|
|
52
|
+
Literal("active"),
|
|
53
|
+
Literal("degraded")
|
|
54
|
+
]);
|
|
55
|
+
const PoHelpSkillSchema = _Object_({
|
|
56
|
+
source: PoHelpSourceSchema,
|
|
57
|
+
name: PoHelpSkillNameSchema,
|
|
58
|
+
description: String({
|
|
59
|
+
minLength: 1,
|
|
60
|
+
maxLength: 512
|
|
61
|
+
}),
|
|
62
|
+
filePath: String({
|
|
63
|
+
minLength: 1,
|
|
64
|
+
maxLength: MAX_MODULE_URL_LENGTH
|
|
65
|
+
}),
|
|
66
|
+
baseDir: String({
|
|
67
|
+
minLength: 1,
|
|
68
|
+
maxLength: MAX_MODULE_URL_LENGTH
|
|
69
|
+
})
|
|
70
|
+
}, { additionalProperties: false });
|
|
71
|
+
const PoHelpDiagnosticSchema = _Object_({
|
|
72
|
+
source: Optional(PoHelpSourceSchema),
|
|
73
|
+
code: String({
|
|
74
|
+
minLength: 1,
|
|
75
|
+
maxLength: 64,
|
|
76
|
+
pattern: "^[A-Z0-9_]+$"
|
|
77
|
+
}),
|
|
78
|
+
message: String({
|
|
79
|
+
minLength: 1,
|
|
80
|
+
maxLength: 512
|
|
81
|
+
})
|
|
82
|
+
}, { additionalProperties: false });
|
|
83
|
+
_Object_({
|
|
84
|
+
hostGeneration: GenerationSchema,
|
|
85
|
+
revision: Integer({ minimum: 0 }),
|
|
86
|
+
activation: PoHelpActivationSchema,
|
|
87
|
+
skills: _Array_(PoHelpSkillSchema, { maxItems: 64 }),
|
|
88
|
+
diagnostics: _Array_(PoHelpDiagnosticSchema, { maxItems: 64 })
|
|
89
|
+
}, { additionalProperties: false });
|
|
90
|
+
//#endregion
|
|
91
|
+
export { PO_HELP_WHEN as t };
|
|
@@ -64,32 +64,8 @@ function poApiCallerFrom(headers) {
|
|
|
64
64
|
...federation
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
* Rekey well before the counter could wrap.
|
|
70
|
-
*
|
|
71
|
-
* A repeated nonce under one AES-GCM key is catastrophic, not merely weak: it
|
|
72
|
-
* leaks the XOR of two plaintexts and the authentication subkey. The counter is
|
|
73
|
-
* 64 bits, so this bound is nowhere near it; the point is that the bound exists
|
|
74
|
-
* and is enforced rather than assumed.
|
|
75
|
-
*/
|
|
76
|
-
const MAX_MESSAGES_PER_KEY = 2 ** 32;
|
|
77
|
-
/**
|
|
78
|
-
* HKDF info strings, one per direction.
|
|
79
|
-
*
|
|
80
|
-
* Separate keys per direction, not one shared key, so a message the server sent
|
|
81
|
-
* can never be replayed back at it as though the client had sent it.
|
|
82
|
-
*/
|
|
83
|
-
const CLIENT_TO_SERVER_INFO = "po/sealed/c2s/v1";
|
|
84
|
-
const SERVER_TO_CLIENT_INFO = "po/sealed/s2c/v1";
|
|
85
|
-
function infoFor(direction) {
|
|
86
|
-
return direction === "c2s" ? CLIENT_TO_SERVER_INFO : SERVER_TO_CLIENT_INFO;
|
|
87
|
-
}
|
|
88
|
-
function isSealedEnvelope(value) {
|
|
89
|
-
if (typeof value !== "object" || value === null) return false;
|
|
90
|
-
const candidate = value;
|
|
91
|
-
return candidate.v === 1 && typeof candidate.n === "string" && typeof candidate.c === "string";
|
|
92
|
-
}
|
|
67
|
+
const PO_EDIT_PRESENCE_SERVICE = "po/edit-presence";
|
|
68
|
+
const PO_EDIT_PRESENCE_CONTRACT = defineServiceContract(PO_EDIT_PRESENCE_SERVICE, { scope: "workspace" });
|
|
93
69
|
//#endregion
|
|
94
70
|
//#region ../../core/po-core/src/schemas/hubChannel.ts
|
|
95
71
|
/** Compact host-wide session attention, published over the existing direct event bus. */
|
|
@@ -109,4 +85,4 @@ const REMOTE_CONVERSATION_SESSION_PROVENANCE = "remote-conversation";
|
|
|
109
85
|
*/
|
|
110
86
|
const COORDINATOR_SESSION_PROVENANCE = "coordinator";
|
|
111
87
|
//#endregion
|
|
112
|
-
export {
|
|
88
|
+
export { PO_API_ROUTE_PREFIX as a, parsePoSocketPath as c, WORKFLOW_STEP_SESSION_PROVENANCE as i, poApiCallerFrom as l, PO_SESSION_ATTENTION_EVENT as n, PO_EDIT_PRESENCE_CONTRACT as o, REMOTE_CONVERSATION_SESSION_PROVENANCE as r, PO_EDIT_PRESENCE_SERVICE as s, COORDINATOR_SESSION_PROVENANCE as t };
|