@tangle-network/agent-app 0.61.4 → 0.62.0
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/{DesignCanvas-L6J72JQ2.js → DesignCanvas-IQKYAEC4.js} +3 -2
- package/dist/{DesignCanvasEditor-QFQD63MR.js → DesignCanvasEditor-O7OCZTGC.js} +5 -4
- package/dist/{TimelineEditor-7KBPJQLT.js → TimelineEditor-VB2UJ34D.js} +4 -2
- package/dist/VaultPane-AYW7CO33.js +8 -0
- package/dist/agent-profiles/d1.js +1 -1
- package/dist/agent-profiles/index.d.ts +0 -82
- package/dist/agent-profiles/index.js +1 -21
- package/dist/agent-profiles/self-management.d.ts +0 -55
- package/dist/alerting/index.d.ts +1 -1
- package/dist/alerting/index.js +1 -3
- package/dist/alerting/slack.d.ts +6 -79
- package/dist/app-auth/drizzle.d.ts +17 -271
- package/dist/app-auth/drizzle.js +6 -2
- package/dist/app-auth/drizzle.js.map +1 -1
- package/dist/app-auth/index.js +3 -3
- package/dist/assets/types.d.ts +2 -1
- package/dist/assistant/AssistantPanel.d.ts +1 -1
- package/dist/assistant/index.js +635 -392
- package/dist/assistant/index.js.map +1 -1
- package/dist/billing/identity-locks.d.ts +5 -0
- package/dist/billing/index.js +1 -1
- package/dist/brand-extraction/index.js.map +1 -1
- package/dist/brand-extraction/types.d.ts +2 -1
- package/dist/chat-react/index.js +6 -5
- package/dist/chat-routes/attachment-write-safety.d.ts +4 -0
- package/dist/chat-routes/draft-persistence.d.ts +2 -14
- package/dist/chat-routes/index.d.ts +1 -0
- package/dist/chat-routes/index.js +853 -773
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/sandbox-model-source.d.ts +20 -0
- package/dist/chat-routes/stored-attachments.d.ts +18 -0
- package/dist/chat-routes/turn-admission.d.ts +1 -1
- package/dist/chat-routes/turn-execution.d.ts +2 -2
- package/dist/chat-routes/turn-route-contracts.d.ts +3 -29
- package/dist/chat-store/core.d.ts +19 -1
- package/dist/chat-store/index.js.map +1 -1
- package/dist/chat-store/store.d.ts +3 -29
- package/dist/{chunk-ATQQCG4I.js → chunk-2VJLLRVV.js} +2 -2
- package/dist/{chunk-R4X5474U.js → chunk-52SDU43B.js} +12 -27
- package/dist/chunk-52SDU43B.js.map +1 -0
- package/dist/{chunk-MDRH3SDA.js → chunk-54YIL7WM.js} +3 -3
- package/dist/{chunk-6QJ3GB3A.js → chunk-5GSZGTPJ.js} +2 -2
- package/dist/{chunk-5IM2CLYX.js → chunk-6JEDSKFH.js} +232 -218
- package/dist/chunk-6JEDSKFH.js.map +1 -0
- package/dist/{chunk-6PRQ45QE.js → chunk-6OG4244Y.js} +1 -1
- package/dist/chunk-6OG4244Y.js.map +1 -0
- package/dist/{chunk-ZDPUC6CM.js → chunk-6ZVSMA4T.js} +3 -3
- package/dist/{chunk-TXUAGSFR.js → chunk-76MPX7JQ.js} +47 -1
- package/dist/chunk-76MPX7JQ.js.map +1 -0
- package/dist/{chunk-BOQ4HVVH.js → chunk-7ISHKBAD.js} +61 -52
- package/dist/chunk-7ISHKBAD.js.map +1 -0
- package/dist/chunk-7PULOECS.js +22 -0
- package/dist/chunk-7PULOECS.js.map +1 -0
- package/dist/{chunk-KJODHPWM.js → chunk-CPVGRQ43.js} +511 -339
- package/dist/chunk-CPVGRQ43.js.map +1 -0
- package/dist/{chunk-LO6VQ35O.js → chunk-CQZVJVME.js} +2 -2
- package/dist/{chunk-Y43PXON2.js → chunk-EFQUAWWF.js} +577 -546
- package/dist/chunk-EFQUAWWF.js.map +1 -0
- package/dist/{chunk-FPNZMIAW.js → chunk-ELX5YITO.js} +1 -1
- package/dist/chunk-ELX5YITO.js.map +1 -0
- package/dist/chunk-FGAROAUF.js +19 -0
- package/dist/chunk-FGAROAUF.js.map +1 -0
- package/dist/{chunk-HN6MZ2XL.js → chunk-FTNGGR37.js} +641 -466
- package/dist/chunk-FTNGGR37.js.map +1 -0
- package/dist/{chunk-G4F2NWZH.js → chunk-FZ3ZFVAC.js} +4 -4
- package/dist/{chunk-UCCSJX64.js → chunk-GIEUZBQQ.js} +1112 -644
- package/dist/chunk-GIEUZBQQ.js.map +1 -0
- package/dist/{chunk-MEKOWH5E.js → chunk-IVBREL7A.js} +785 -526
- package/dist/chunk-IVBREL7A.js.map +1 -0
- package/dist/{chunk-WSEXFTN4.js → chunk-JBXNU5WD.js} +26 -26
- package/dist/chunk-JBXNU5WD.js.map +1 -0
- package/dist/{chunk-F2VX6TTJ.js → chunk-JRCZHDRG.js} +2 -41
- package/dist/chunk-JRCZHDRG.js.map +1 -0
- package/dist/{chunk-LXYQOOXU.js → chunk-JRW6LCIA.js} +552 -302
- package/dist/chunk-JRW6LCIA.js.map +1 -0
- package/dist/{chunk-TVPH5T4F.js → chunk-KS4I7KVC.js} +16 -22
- package/dist/{chunk-TVPH5T4F.js.map → chunk-KS4I7KVC.js.map} +1 -1
- package/dist/{chunk-J2BBYVGF.js → chunk-MRZP65DZ.js} +1 -117
- package/dist/chunk-MRZP65DZ.js.map +1 -0
- package/dist/{chunk-4ZSLX3LY.js → chunk-OODZCBSM.js} +1 -1
- package/dist/chunk-OODZCBSM.js.map +1 -0
- package/dist/chunk-P4RRC4AO.js +47 -0
- package/dist/chunk-P4RRC4AO.js.map +1 -0
- package/dist/{chunk-ORQD4AUO.js → chunk-PCAY23GS.js} +1 -6
- package/dist/chunk-PCAY23GS.js.map +1 -0
- package/dist/{chunk-NMZUW6VJ.js → chunk-PEJ5OP5B.js} +3 -3
- package/dist/chunk-PEJ5OP5B.js.map +1 -0
- package/dist/{chunk-NHYRIM4I.js → chunk-PIPNDZ6H.js} +304 -194
- package/dist/chunk-PIPNDZ6H.js.map +1 -0
- package/dist/{chunk-L7LQRJGD.js → chunk-TCJ4TMOW.js} +37 -33
- package/dist/{chunk-L7LQRJGD.js.map → chunk-TCJ4TMOW.js.map} +1 -1
- package/dist/chunk-UHSUY6H6.js +79 -0
- package/dist/chunk-UHSUY6H6.js.map +1 -0
- package/dist/{chunk-PDD5A43Y.js → chunk-UTL6TEN6.js} +3 -3
- package/dist/{chunk-VJBFCNAU.js → chunk-UW2DKTEM.js} +123 -130
- package/dist/chunk-UW2DKTEM.js.map +1 -0
- package/dist/{chunk-S27DKRI6.js → chunk-VDYEVCQQ.js} +2 -2
- package/dist/{chunk-UFQM46NV.js → chunk-VK3F4N4U.js} +2 -2
- package/dist/{chunk-6ZIC6OG5.js → chunk-VYBTQK25.js} +126 -122
- package/dist/chunk-VYBTQK25.js.map +1 -0
- package/dist/{chunk-RL3Z747H.js → chunk-W2BV2XOC.js} +1491 -700
- package/dist/chunk-W2BV2XOC.js.map +1 -0
- package/dist/{chunk-FUZETA6Z.js → chunk-X6SZGQTK.js} +2 -2
- package/dist/{chunk-CD2LQXY6.js → chunk-XOHE6SKU.js} +14 -16
- package/dist/{chunk-CD2LQXY6.js.map → chunk-XOHE6SKU.js.map} +1 -1
- package/dist/{chunk-ZBB5KQ6B.js → chunk-Y3GO6SG3.js} +73 -66
- package/dist/chunk-Y3GO6SG3.js.map +1 -0
- package/dist/chunk-ZAMHLXNS.js +56 -0
- package/dist/chunk-ZAMHLXNS.js.map +1 -0
- package/dist/{chunk-RHFN7TUV.js → chunk-ZDHCV462.js} +47 -44
- package/dist/{chunk-RHFN7TUV.js.map → chunk-ZDHCV462.js.map} +1 -1
- package/dist/chunk-ZOS3D26Z.js +72 -0
- package/dist/chunk-ZOS3D26Z.js.map +1 -0
- package/dist/design-canvas/index.js +32 -32
- package/dist/design-canvas/index.js.map +1 -1
- package/dist/design-canvas-react/components/DesignCanvas.d.ts +1 -1
- package/dist/design-canvas-react/components/Workspace.d.ts +1 -1
- package/dist/design-canvas-react/components/glyphs.d.ts +31 -40
- package/dist/design-canvas-react/components/transform-math.d.ts +0 -8
- package/dist/design-canvas-react/components/use-workspace-keyboard.d.ts +2 -2
- package/dist/design-canvas-react/contracts.d.ts +2 -2
- package/dist/design-canvas-react/engine.js +1 -1
- package/dist/design-canvas-react/index.js +9 -7
- package/dist/design-canvas-react/index.js.map +1 -1
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/eval/calibration.d.ts +1 -38
- package/dist/eval/index.d.ts +2 -4
- package/dist/eval/index.js +0 -84
- package/dist/eval/index.js.map +1 -1
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.js +1 -1
- package/dist/harness/session-selection.d.ts +2 -2
- package/dist/hub-approvals/index.js +1 -1
- package/dist/hub-approvals/result.d.ts +1 -1
- package/dist/hub-approvals-react/index.js +4 -4
- package/dist/hub-approvals-react/index.js.map +1 -1
- package/dist/hub-approvals-react/parts.d.ts +1 -1
- package/dist/launch-invariants/cli.js +4 -4
- package/dist/launch-invariants/index.js +3 -3
- package/dist/launch-invariants/testing.js +4 -4
- package/dist/legibility/cli.js +1 -1
- package/dist/legibility/index.js +1 -1
- package/dist/{mention-editor-B23OMFT2.js → mention-editor-4BKBMWIK.js} +83 -57
- package/dist/mention-editor-4BKBMWIK.js.map +1 -0
- package/dist/missions/index.js +144 -137
- package/dist/missions/index.js.map +1 -1
- package/dist/operator/index.js +1 -1
- package/dist/peer-floors/check.js +1 -1
- package/dist/peer-floors/cli.js +6 -14
- package/dist/peer-floors/cli.js.map +1 -1
- package/dist/peer-floors/source-entries.d.ts +6 -0
- package/dist/platform/index.js +10 -10
- package/dist/preset-cloudflare/index.js +1 -1
- package/dist/profile/index.d.ts +0 -1
- package/dist/profile/index.js +1 -422
- package/dist/profile/index.js.map +1 -1
- package/dist/profile-editor/server.d.ts +0 -1
- package/dist/profile-editor/server.js +0 -1
- package/dist/profile-editor/server.js.map +1 -1
- package/dist/public-consultation/index.d.ts +2 -2
- package/dist/public-consultation/index.js +6 -6
- package/dist/record/drizzle.js +156 -148
- package/dist/record/drizzle.js.map +1 -1
- package/dist/runtime/index.js +4 -4
- package/dist/runtime/router-turn.js +3 -3
- package/dist/sandbox/index.js +5 -5
- package/dist/sequences/drizzle.js +5 -15
- package/dist/sequences/drizzle.js.map +1 -1
- package/dist/sequences/index.d.ts +1 -0
- package/dist/sequences/index.js +18 -14
- package/dist/sequences/index.js.map +1 -1
- package/dist/sequences/row-mapping.d.ts +7 -0
- package/dist/sequences-react/components/TimelineEditor.d.ts +0 -40
- package/dist/sequences-react/components/TimelineHistory.d.ts +31 -0
- package/dist/sequences-react/components/glyphs.d.ts +12 -21
- package/dist/sequences-react/components/index.d.ts +0 -2
- package/dist/sequences-react/components/interaction-math.d.ts +3 -3
- package/dist/sequences-react/contracts.d.ts +1 -1
- package/dist/sequences-react/engine/snap.d.ts +2 -2
- package/dist/sequences-react/index.js +4 -4
- package/dist/sequences-react/index.js.map +1 -1
- package/dist/settings-react/index.js +13 -30
- package/dist/settings-react/index.js.map +1 -1
- package/dist/settings-react/timezone-picker.d.ts +0 -6
- package/dist/signoff/browser-budget.d.ts +6 -1
- package/dist/signoff/cli.d.ts +0 -7
- package/dist/signoff/cli.js +1 -2
- package/dist/signoff/cli.js.map +1 -1
- package/dist/signoff/index.js +1 -1
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.js +5 -25
- package/dist/skills/marketplace.d.ts +1 -75
- package/dist/skills-placement/box.js +3 -4
- package/dist/skills-placement/box.js.map +1 -1
- package/dist/skills-placement/index.js +3 -4
- package/dist/spend/cli-args.d.ts +1 -1
- package/dist/spend/cli.js +3 -3
- package/dist/spend/cli.js.map +1 -1
- package/dist/spend/index.js +1 -1
- package/dist/stories/design-canvas/fixtures.d.ts +1 -14
- package/dist/stream/index.js +17 -17
- package/dist/studio/generation.d.ts +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/studio-react/index.js +353 -184
- package/dist/studio-react/index.js.map +1 -1
- package/dist/studio-react/studio-composer.d.ts +1 -5
- package/dist/studio-react/studio-history-screen.d.ts +1 -1
- package/dist/teams/invitations-api.d.ts +3 -3
- package/dist/teams/invitations-api.js +74 -72
- package/dist/teams/invitations-api.js.map +1 -1
- package/dist/teams/member-sync.d.ts +2 -0
- package/dist/teams/members-api.d.ts +2 -2
- package/dist/teams/members-api.js +1 -1
- package/dist/teams-react/index.js +28 -45
- package/dist/teams-react/index.js.map +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/mcp-arguments.d.ts +1 -1
- package/dist/trace/index.d.ts +1 -18
- package/dist/trace/index.js +1 -36
- package/dist/trace/index.js.map +1 -1
- package/dist/trace/mission-flow.d.ts +1 -59
- package/dist/turn-health/index.d.ts +1 -1
- package/dist/turn-health/index.js +2 -2
- package/dist/turn-health/sink.d.ts +2 -1
- package/dist/turn-trace/index.js +2 -4
- package/dist/turn-trace/recorder.d.ts +0 -2
- package/dist/vault/VaultPane.d.ts +0 -20
- package/dist/vault/VaultPaneOperations.d.ts +318 -0
- package/dist/vault/index.js +2 -1
- package/dist/vault/index.js.map +1 -1
- package/dist/vault/lazy.js +1 -1
- package/dist/web-react/agent-profile-editor.d.ts +1 -2
- package/dist/web-react/agent-profile-editor.js +6 -5
- package/dist/web-react/chat-composer.d.ts +1 -1
- package/dist/web-react/durable-plan-flow.d.ts +6 -1
- package/dist/web-react/editor-glyphs.d.ts +12 -0
- package/dist/web-react/focus-navigation.d.ts +12 -0
- package/dist/web-react/history-controls.d.ts +37 -0
- package/dist/web-react/index.js +36 -34
- package/dist/web-react/interaction-question-card.d.ts +1 -1
- package/dist/web-react/record-grid-writes.d.ts +31 -0
- package/dist/web-react/record-grid.d.ts +1 -48
- package/dist/web-react/session-history-panel.d.ts +1 -9
- package/dist/web-react/use-document-dark.d.ts +1 -0
- package/dist/workspace-export/engine.d.ts +1 -6
- package/dist/workspace-export/index.js +198 -185
- package/dist/workspace-export/index.js.map +1 -1
- package/dist/workspace-export/routes.d.ts +1 -1
- package/dist/workspace-react/index.js +9 -8
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +1 -11
- package/dist/VaultPane-RXL3WLA2.js +0 -7
- package/dist/agent-profiles/reaper.d.ts +0 -31
- package/dist/agent-profiles/reaper.js +0 -29
- package/dist/agent-profiles/reaper.js.map +0 -1
- package/dist/chunk-4ZSLX3LY.js.map +0 -1
- package/dist/chunk-5IM2CLYX.js.map +0 -1
- package/dist/chunk-6OSJNJA2.js +0 -251
- package/dist/chunk-6OSJNJA2.js.map +0 -1
- package/dist/chunk-6PRQ45QE.js.map +0 -1
- package/dist/chunk-6ZIC6OG5.js.map +0 -1
- package/dist/chunk-BDEBQ4WO.js +0 -38
- package/dist/chunk-BDEBQ4WO.js.map +0 -1
- package/dist/chunk-BOQ4HVVH.js.map +0 -1
- package/dist/chunk-F2VX6TTJ.js.map +0 -1
- package/dist/chunk-FPNZMIAW.js.map +0 -1
- package/dist/chunk-HN6MZ2XL.js.map +0 -1
- package/dist/chunk-J2BBYVGF.js.map +0 -1
- package/dist/chunk-KJODHPWM.js.map +0 -1
- package/dist/chunk-LTWJYNEC.js +0 -100
- package/dist/chunk-LTWJYNEC.js.map +0 -1
- package/dist/chunk-LXYQOOXU.js.map +0 -1
- package/dist/chunk-MEKOWH5E.js.map +0 -1
- package/dist/chunk-NHYRIM4I.js.map +0 -1
- package/dist/chunk-NMZUW6VJ.js.map +0 -1
- package/dist/chunk-ORQD4AUO.js.map +0 -1
- package/dist/chunk-R4X5474U.js.map +0 -1
- package/dist/chunk-RL3Z747H.js.map +0 -1
- package/dist/chunk-TXUAGSFR.js.map +0 -1
- package/dist/chunk-UCCSJX64.js.map +0 -1
- package/dist/chunk-VJBFCNAU.js.map +0 -1
- package/dist/chunk-WSEXFTN4.js.map +0 -1
- package/dist/chunk-Y43PXON2.js.map +0 -1
- package/dist/chunk-ZBB5KQ6B.js.map +0 -1
- package/dist/eval/parity.d.ts +0 -74
- package/dist/mention-editor-B23OMFT2.js.map +0 -1
- package/dist/profile/humanizer-skill.d.ts +0 -23
- package/dist/profile/humanizer-skill.vendored.d.ts +0 -4
- package/dist/sequences-react/components/BrandMark.d.ts +0 -10
- package/dist/skills/marketplace-drizzle.d.ts +0 -121
- package/dist/skills/marketplace-drizzle.js +0 -34
- package/dist/skills/marketplace-drizzle.js.map +0 -1
- package/dist/teams-react/components/BrandMark.d.ts +0 -10
- /package/dist/{DesignCanvas-L6J72JQ2.js.map → DesignCanvas-IQKYAEC4.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-QFQD63MR.js.map → DesignCanvasEditor-O7OCZTGC.js.map} +0 -0
- /package/dist/{TimelineEditor-7KBPJQLT.js.map → TimelineEditor-VB2UJ34D.js.map} +0 -0
- /package/dist/{VaultPane-RXL3WLA2.js.map → VaultPane-AYW7CO33.js.map} +0 -0
- /package/dist/{chunk-ATQQCG4I.js.map → chunk-2VJLLRVV.js.map} +0 -0
- /package/dist/{chunk-MDRH3SDA.js.map → chunk-54YIL7WM.js.map} +0 -0
- /package/dist/{chunk-6QJ3GB3A.js.map → chunk-5GSZGTPJ.js.map} +0 -0
- /package/dist/{chunk-ZDPUC6CM.js.map → chunk-6ZVSMA4T.js.map} +0 -0
- /package/dist/{chunk-LO6VQ35O.js.map → chunk-CQZVJVME.js.map} +0 -0
- /package/dist/{chunk-G4F2NWZH.js.map → chunk-FZ3ZFVAC.js.map} +0 -0
- /package/dist/{chunk-PDD5A43Y.js.map → chunk-UTL6TEN6.js.map} +0 -0
- /package/dist/{chunk-S27DKRI6.js.map → chunk-VDYEVCQQ.js.map} +0 -0
- /package/dist/{chunk-UFQM46NV.js.map → chunk-VK3F4N4U.js.map} +0 -0
- /package/dist/{chunk-FUZETA6Z.js.map → chunk-X6SZGQTK.js.map} +0 -0
package/dist/operator/index.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
createApiKeyFetch
|
|
11
11
|
} from "../chunk-RN4WPTBH.js";
|
|
12
|
-
import "../chunk-G7M2C72Q.js";
|
|
13
12
|
import {
|
|
14
13
|
messageHasTurnId
|
|
15
14
|
} from "../chunk-YG66IHDU.js";
|
|
15
|
+
import "../chunk-G7M2C72Q.js";
|
|
16
16
|
import {
|
|
17
17
|
sha256Hex
|
|
18
18
|
} from "../chunk-HY57QRRW.js";
|
package/dist/peer-floors/cli.js
CHANGED
|
@@ -7,16 +7,17 @@ import {
|
|
|
7
7
|
checkDependencySources,
|
|
8
8
|
checkPeerFloors,
|
|
9
9
|
formatDependencySourceReport,
|
|
10
|
-
formatPeerFloorReport
|
|
11
|
-
|
|
10
|
+
formatPeerFloorReport,
|
|
11
|
+
sourceDirectoryEntries
|
|
12
|
+
} from "../chunk-7ISHKBAD.js";
|
|
12
13
|
|
|
13
14
|
// src/peer-floors/cli.ts
|
|
14
15
|
import { readFileSync as readFileSync2 } from "fs";
|
|
15
16
|
import { join as join2 } from "path";
|
|
16
17
|
|
|
17
18
|
// src/peer-floors/durability-owners.ts
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
19
|
+
import { readFileSync } from "fs";
|
|
20
|
+
import { relative, sep } from "path";
|
|
20
21
|
var RULES = [
|
|
21
22
|
{
|
|
22
23
|
id: "turn-tables",
|
|
@@ -63,16 +64,7 @@ var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
|
63
64
|
"evals"
|
|
64
65
|
]);
|
|
65
66
|
function collect(dir, repoDir, exclude, out) {
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
69
|
-
} catch {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
for (const entry of entries) {
|
|
73
|
-
const full = join(dir, entry.name);
|
|
74
|
-
const rel = relative(repoDir, full).split(sep).join("/");
|
|
75
|
-
if (exclude.some((prefix) => rel === prefix || rel.startsWith(`${prefix}/`))) continue;
|
|
67
|
+
for (const { entry, full } of sourceDirectoryEntries(dir, repoDir, exclude)) {
|
|
76
68
|
if (entry.isDirectory()) {
|
|
77
69
|
if (!SKIP_DIRS.has(entry.name)) collect(full, repoDir, exclude, out);
|
|
78
70
|
} else if (entry.isFile() && SOURCE_FILE.test(entry.name) && !TEST_FILE.test(entry.name)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/peer-floors/cli.ts","../../src/peer-floors/durability-owners.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * `agent-app-peer-check` — fail a consumer's CI when its dependencies are wrong\n * through installed compatibility, source, and declared-version checks.\n *\n * Runs in the CONSUMER's repo, over the consumer's own tree, because both\n * installed checks only mean anything against a real install. Add it next to\n * typecheck:\n *\n * \"scripts\": { \"peer-check\": \"agent-app-peer-check\" }\n *\n * Four gates, one report, one exit code:\n *\n * PEER FLOORS — is the installed version inside the range the shell\n * declares. `pnpm` only WARNS on an unmet peer that is\n * also a direct dependency and says nothing at all for an\n * unmet optional one.\n * DEPENDENCY SOURCE — is the installed package the one the registry\n * publishes at all. A `file:` tarball, a `link:` out of\n * the repo, or a hand-patched `node_modules` all report\n * the same version as the real release and ship different\n * bytes.\n * DECLARED PINS — do installed exact Tangle versions match the consumer's\n * dependency and development dependency declarations.\n * DURABILITY OWNERS — does product source write the shared turn tables,\n * open its own session-event replay, or mint follow-up\n * execution ids that Agent App already owns.\n *\n * The source gate runs FIRST and independently: it needs no installed shell, so\n * a repo whose install is broken still gets the answer that explains why.\n *\n * Usage: agent-app-peer-check [repoDir] [--exclude <path>]...\n * `--exclude` takes a repo-relative path prefix the source-tree walk skips —\n * the escape hatch for a repo that genuinely carries a tarball as test data.\n * Exits 1 on any violation, 0 otherwise.\n */\nimport { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { checkAllPeerFloors, checkPeerFloors, formatPeerFloorReport } from './check'\nimport { checkDependencySources, formatDependencySourceReport } from './dependency-source'\nimport { checkDurabilityOwners, formatDurabilityOwnerReport } from './durability-owners'\nimport { invokedAsScript } from '../signoff/invoked-as-script'\n\ninterface CliArgs {\n readonly appDir: string\n readonly exclude: readonly string[]\n}\n\n/** Exact consumer pins choose an artifact; engine peer ranges choose compatibility. */\nfunction checkDeclaredPins(appDir: string): boolean {\n const manifest = JSON.parse(readFileSync(join(appDir, 'package.json'), 'utf8')) as {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n }\n const pins = Object.fromEntries(\n Object.entries({ ...manifest.devDependencies, ...manifest.dependencies })\n .filter(([name, version]) => name.startsWith('@tangle-network/')\n && /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(version)),\n )\n const report = checkPeerFloors({ appDir, shellManifest: { peerDependencies: pins } })\n const installed = report.rows.filter((row) => row.installed !== null)\n const mismatches = installed.filter((row) => row.installed !== row.range)\n for (const row of mismatches) {\n process.stderr.write(`DECLARED PIN VIOLATED: ${row.name} declares ${row.range}, but ${row.installed} is installed. Reinstall from the current frozen lockfile.\\n`)\n }\n if (mismatches.length === 0) {\n process.stdout.write(`declared pins: ${installed.length} installed exact Tangle versions matched\\n`)\n }\n return mismatches.length === 0\n}\n\nexport function parsePeerCheckArgs(argv: readonly string[]): CliArgs {\n const exclude: string[] = []\n let appDir: string | undefined\n for (let i = 0; i < argv.length; i += 1) {\n const arg = argv[i] as string\n if (arg === '--exclude') {\n const value = argv[i + 1]\n if (value) exclude.push(value)\n i += 1\n } else if (arg.startsWith('--exclude=')) {\n exclude.push(arg.slice('--exclude='.length))\n } else if (!arg.startsWith('-') && appDir === undefined) {\n appDir = arg\n }\n }\n return { appDir: appDir ?? process.cwd(), exclude }\n}\n\nfunction main(): void {\n const { appDir, exclude } = parsePeerCheckArgs(process.argv.slice(2))\n let failed = false\n\n try {\n const sources = checkDependencySources({ repoDir: appDir, exclude })\n process.stdout.write(`${formatDependencySourceReport(sources)}\\n\\n`)\n if (!sources.ok) failed = true\n } catch (err) {\n process.stderr.write(`agent-app-peer-check (dependency sources) failed: ${err instanceof Error ? err.message : String(err)}\\n`)\n failed = true\n }\n\n try {\n const reports = checkAllPeerFloors({ appDir })\n process.stdout.write(`${reports.map((report) => formatPeerFloorReport(report)).join('\\n\\n')}\\n`)\n if (reports.some((report) => !report.ok)) failed = true\n } catch (err) {\n process.stderr.write(`agent-app-peer-check (peer floors) failed: ${err instanceof Error ? err.message : String(err)}\\n`)\n failed = true\n }\n\n try {\n if (!checkDeclaredPins(appDir)) failed = true\n } catch (err) {\n process.stderr.write(`agent-app-peer-check (declared pins) failed: ${err instanceof Error ? err.message : String(err)}\\n`)\n failed = true\n }\n\n try {\n const durability = checkDurabilityOwners({ repoDir: appDir, exclude })\n const report = formatDurabilityOwnerReport(durability)\n if (durability.ok) process.stdout.write(`${report}\\n`)\n else {\n process.stderr.write(`${report}\\n`)\n failed = true\n }\n } catch (err) {\n process.stderr.write(`agent-app-peer-check (durability owners) failed: ${err instanceof Error ? err.message : String(err)}\\n`)\n failed = true\n }\n\n process.exit(failed ? 1 : 0)\n}\n\n/* c8 ignore start — process wiring, exercised by the bin itself */\nif (invokedAsScript(import.meta.url, process.argv[1])) main()\n/* c8 ignore stop */\n","/**\n * DURABILITY OWNERS — products must not grow their own turn durability.\n *\n * Agent App owns the turn event buffer and status rows, running-turn claims,\n * detached-turn crash recovery and the session-event attach that replays an\n * execution. A product that writes those tables, opens its own session-event\n * replay loop or mints a follow-up execution id forks recovery semantics the\n * shared owner tests, and the fork drifts: four copies of the plan follow-up\n * attach had three different execution identities before they were merged.\n *\n * The scan reads product source (not tests, migrations or build output). A\n * line that must stay product-local carries `agent-app-durability-owner:\n * <reason>` on it or within the three lines above it, so every exception is\n * named where a reviewer sees it.\n */\nimport { readdirSync, readFileSync } from 'node:fs'\nimport { join, relative, sep } from 'node:path'\n\ninterface DurabilityRule {\n readonly id: string\n readonly pattern: RegExp\n readonly owner: string\n}\n\nconst RULES: readonly DurabilityRule[] = [\n {\n id: 'turn-tables',\n pattern: /\\b(?:INSERT\\s+(?:OR\\s+\\w+\\s+)?INTO|UPDATE|DELETE\\s+FROM)\\s+[`\"']?(?:turn_status|turn_events)\\b/i,\n owner: 'TurnEventStore from @tangle-network/agent-app/stream owns turn_status and turn_events '\n + '(setStatus, resetEvents, deleteTurn, pruneTerminalTurns); createD1PlanFollowUpGate owns follow-up claims.',\n },\n {\n id: 'session-replay',\n pattern: /\\.session\\([^)]*\\)\\s*\\.events\\(/,\n owner: 'Agent App owns session-event attach and replay: streamPlanFollowUpEvents or the sandbox chat producer '\n + 'from @tangle-network/agent-app/chat-routes.',\n },\n {\n id: 'execution-identity',\n pattern: /['\"`]plan-followup-/,\n owner: 'planFollowUpExecutionId from @tangle-network/agent-app/chat-routes matches the Sidecar byte for byte.',\n },\n]\n\nconst WAIVER = /agent-app-durability-owner:\\s*\\S/\nconst SOURCE_FILE = /\\.(?:[cm]?[jt]sx?)$/\nconst TEST_FILE = /(?:\\.|-)(?:test|spec|stories)\\.[cm]?[jt]sx?$/\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', 'dist', 'build', 'out', 'coverage', '.wrangler', '.react-router', '.next',\n '.turbo', '.cache', '.worktrees', 'storybook-static', 'test', 'tests', '__tests__', 'fixtures',\n 'fixture_modules', 'migrations', 'drizzle', 'scripts', 'e2e', 'evals',\n])\n\n/** One product-local durability primitive the shared owner already provides. */\ninterface DurabilityOwnerViolation {\n readonly file: string\n readonly line: number\n readonly rule: string\n readonly owner: string\n readonly text: string\n}\n\n/** Result of one durability-owner scan. */\nexport interface DurabilityOwnerReport {\n readonly ok: boolean\n readonly scannedFiles: number\n readonly waived: number\n readonly violations: readonly DurabilityOwnerViolation[]\n}\n\nfunction collect(dir: string, repoDir: string, exclude: readonly string[], out: string[]): void {\n let entries: import('node:fs').Dirent[]\n try {\n entries = readdirSync(dir, { withFileTypes: true })\n } catch {\n return\n }\n for (const entry of entries) {\n const full = join(dir, entry.name)\n const rel = relative(repoDir, full).split(sep).join('/')\n if (exclude.some((prefix) => rel === prefix || rel.startsWith(`${prefix}/`))) continue\n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name)) collect(full, repoDir, exclude, out)\n } else if (entry.isFile() && SOURCE_FILE.test(entry.name) && !TEST_FILE.test(entry.name)) {\n out.push(full)\n }\n }\n}\n\n/** Scan a product checkout for durability primitives Agent App owns. */\nexport function checkDurabilityOwners(options: {\n repoDir: string\n exclude?: readonly string[]\n}): DurabilityOwnerReport {\n const files: string[] = []\n collect(options.repoDir, options.repoDir, options.exclude ?? [], files)\n const violations: DurabilityOwnerViolation[] = []\n let waived = 0\n for (const file of files) {\n const lines = readFileSync(file, 'utf8').split('\\n')\n lines.forEach((text, index) => {\n const rule = RULES.find((candidate) => candidate.pattern.test(text))\n if (!rule) return\n if (lines.slice(Math.max(0, index - 3), index + 1).some((line) => WAIVER.test(line))) {\n waived += 1\n return\n }\n violations.push({\n file: relative(options.repoDir, file).split(sep).join('/'),\n line: index + 1,\n rule: rule.id,\n owner: rule.owner,\n text: text.trim(),\n })\n })\n }\n return { ok: violations.length === 0, scannedFiles: files.length, waived, violations }\n}\n\n/** Human report for the peer-check CLI. */\nexport function formatDurabilityOwnerReport(report: DurabilityOwnerReport): string {\n if (report.ok) {\n return `durability owners: ${report.scannedFiles} source files use the shared turn durability`\n + (report.waived ? ` (${report.waived} named exceptions)` : '')\n }\n return [\n `DURABILITY OWNER VIOLATED: ${report.violations.length} product-local durability primitive(s).`,\n ...report.violations.map((violation) =>\n ` ${violation.file}:${violation.line} [${violation.rule}] ${violation.text}\\n use: ${violation.owner}`),\n 'Move the behavior to the shared owner, or name a product-only reason with `agent-app-durability-owner: <reason>`.',\n ].join('\\n')\n}\n"],"mappings":";;;;;;;;;;;;;AAoCA,SAAS,gBAAAA,qBAAoB;AAC7B,SAAS,QAAAC,aAAY;;;ACtBrB,SAAS,aAAa,oBAAoB;AAC1C,SAAS,MAAM,UAAU,WAAW;AAQpC,IAAM,QAAmC;AAAA,EACvC;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EAET;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EAET;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AACF;AAEA,IAAM,SAAS;AACf,IAAM,cAAc;AACpB,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;AAEA,UAAQ,KAAK,SAAS,IAAI,CAAC;AAC7B;AAGA,IAAI,gBAAgB,YAAY,KAAK,QAAQ,KAAK,CAAC,CAAC,EAAG,MAAK;","names":["readFileSync","join","readFileSync","join"]}
|
|
1
|
+
{"version":3,"sources":["../../src/peer-floors/cli.ts","../../src/peer-floors/durability-owners.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * `agent-app-peer-check` — fail a consumer's CI when its dependencies are wrong\n * through installed compatibility, source, and declared-version checks.\n *\n * Runs in the CONSUMER's repo, over the consumer's own tree, because both\n * installed checks only mean anything against a real install. Add it next to\n * typecheck:\n *\n * \"scripts\": { \"peer-check\": \"agent-app-peer-check\" }\n *\n * Four gates, one report, one exit code:\n *\n * PEER FLOORS — is the installed version inside the range the shell\n * declares. `pnpm` only WARNS on an unmet peer that is\n * also a direct dependency and says nothing at all for an\n * unmet optional one.\n * DEPENDENCY SOURCE — is the installed package the one the registry\n * publishes at all. A `file:` tarball, a `link:` out of\n * the repo, or a hand-patched `node_modules` all report\n * the same version as the real release and ship different\n * bytes.\n * DECLARED PINS — do installed exact Tangle versions match the consumer's\n * dependency and development dependency declarations.\n * DURABILITY OWNERS — does product source write the shared turn tables,\n * open its own session-event replay, or mint follow-up\n * execution ids that Agent App already owns.\n *\n * The source gate runs FIRST and independently: it needs no installed shell, so\n * a repo whose install is broken still gets the answer that explains why.\n *\n * Usage: agent-app-peer-check [repoDir] [--exclude <path>]...\n * `--exclude` takes a repo-relative path prefix the source-tree walk skips —\n * the escape hatch for a repo that genuinely carries a tarball as test data.\n * Exits 1 on any violation, 0 otherwise.\n */\nimport { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { checkAllPeerFloors, checkPeerFloors, formatPeerFloorReport } from './check'\nimport { checkDependencySources, formatDependencySourceReport } from './dependency-source'\nimport { checkDurabilityOwners, formatDurabilityOwnerReport } from './durability-owners'\nimport { invokedAsScript } from '../signoff/invoked-as-script'\n\ninterface CliArgs {\n readonly appDir: string\n readonly exclude: readonly string[]\n}\n\n/** Exact consumer pins choose an artifact; engine peer ranges choose compatibility. */\nfunction checkDeclaredPins(appDir: string): boolean {\n const manifest = JSON.parse(readFileSync(join(appDir, 'package.json'), 'utf8')) as {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n }\n const pins = Object.fromEntries(\n Object.entries({ ...manifest.devDependencies, ...manifest.dependencies })\n .filter(([name, version]) => name.startsWith('@tangle-network/')\n && /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(version)),\n )\n const report = checkPeerFloors({ appDir, shellManifest: { peerDependencies: pins } })\n const installed = report.rows.filter((row) => row.installed !== null)\n const mismatches = installed.filter((row) => row.installed !== row.range)\n for (const row of mismatches) {\n process.stderr.write(`DECLARED PIN VIOLATED: ${row.name} declares ${row.range}, but ${row.installed} is installed. Reinstall from the current frozen lockfile.\\n`)\n }\n if (mismatches.length === 0) {\n process.stdout.write(`declared pins: ${installed.length} installed exact Tangle versions matched\\n`)\n }\n return mismatches.length === 0\n}\n\nexport function parsePeerCheckArgs(argv: readonly string[]): CliArgs {\n const exclude: string[] = []\n let appDir: string | undefined\n for (let i = 0; i < argv.length; i += 1) {\n const arg = argv[i] as string\n if (arg === '--exclude') {\n const value = argv[i + 1]\n if (value) exclude.push(value)\n i += 1\n } else if (arg.startsWith('--exclude=')) {\n exclude.push(arg.slice('--exclude='.length))\n } else if (!arg.startsWith('-') && appDir === undefined) {\n appDir = arg\n }\n }\n return { appDir: appDir ?? process.cwd(), exclude }\n}\n\nfunction main(): void {\n const { appDir, exclude } = parsePeerCheckArgs(process.argv.slice(2))\n let failed = false\n\n try {\n const sources = checkDependencySources({ repoDir: appDir, exclude })\n process.stdout.write(`${formatDependencySourceReport(sources)}\\n\\n`)\n if (!sources.ok) failed = true\n } catch (err) {\n process.stderr.write(`agent-app-peer-check (dependency sources) failed: ${err instanceof Error ? err.message : String(err)}\\n`)\n failed = true\n }\n\n try {\n const reports = checkAllPeerFloors({ appDir })\n process.stdout.write(`${reports.map((report) => formatPeerFloorReport(report)).join('\\n\\n')}\\n`)\n if (reports.some((report) => !report.ok)) failed = true\n } catch (err) {\n process.stderr.write(`agent-app-peer-check (peer floors) failed: ${err instanceof Error ? err.message : String(err)}\\n`)\n failed = true\n }\n\n try {\n if (!checkDeclaredPins(appDir)) failed = true\n } catch (err) {\n process.stderr.write(`agent-app-peer-check (declared pins) failed: ${err instanceof Error ? err.message : String(err)}\\n`)\n failed = true\n }\n\n try {\n const durability = checkDurabilityOwners({ repoDir: appDir, exclude })\n const report = formatDurabilityOwnerReport(durability)\n if (durability.ok) process.stdout.write(`${report}\\n`)\n else {\n process.stderr.write(`${report}\\n`)\n failed = true\n }\n } catch (err) {\n process.stderr.write(`agent-app-peer-check (durability owners) failed: ${err instanceof Error ? err.message : String(err)}\\n`)\n failed = true\n }\n\n process.exit(failed ? 1 : 0)\n}\n\n/* c8 ignore start — process wiring, exercised by the bin itself */\nif (invokedAsScript(import.meta.url, process.argv[1])) main()\n/* c8 ignore stop */\n","import { sourceDirectoryEntries } from './source-entries'\n/**\n * DURABILITY OWNERS — products must not grow their own turn durability.\n *\n * Agent App owns the turn event buffer and status rows, running-turn claims,\n * detached-turn crash recovery and the session-event attach that replays an\n * execution. A product that writes those tables, opens its own session-event\n * replay loop or mints a follow-up execution id forks recovery semantics the\n * shared owner tests, and the fork drifts: four copies of the plan follow-up\n * attach had three different execution identities before they were merged.\n *\n * The scan reads product source (not tests, migrations or build output). A\n * line that must stay product-local carries `agent-app-durability-owner:\n * <reason>` on it or within the three lines above it, so every exception is\n * named where a reviewer sees it.\n */\nimport { readdirSync, readFileSync } from 'node:fs'\nimport { join, relative, sep } from 'node:path'\n\ninterface DurabilityRule {\n readonly id: string\n readonly pattern: RegExp\n readonly owner: string\n}\n\nconst RULES: readonly DurabilityRule[] = [\n {\n id: 'turn-tables',\n pattern: /\\b(?:INSERT\\s+(?:OR\\s+\\w+\\s+)?INTO|UPDATE|DELETE\\s+FROM)\\s+[`\"']?(?:turn_status|turn_events)\\b/i,\n owner: 'TurnEventStore from @tangle-network/agent-app/stream owns turn_status and turn_events '\n + '(setStatus, resetEvents, deleteTurn, pruneTerminalTurns); createD1PlanFollowUpGate owns follow-up claims.',\n },\n {\n id: 'session-replay',\n pattern: /\\.session\\([^)]*\\)\\s*\\.events\\(/,\n owner: 'Agent App owns session-event attach and replay: streamPlanFollowUpEvents or the sandbox chat producer '\n + 'from @tangle-network/agent-app/chat-routes.',\n },\n {\n id: 'execution-identity',\n pattern: /['\"`]plan-followup-/,\n owner: 'planFollowUpExecutionId from @tangle-network/agent-app/chat-routes matches the Sidecar byte for byte.',\n },\n]\n\nconst WAIVER = /agent-app-durability-owner:\\s*\\S/\nconst SOURCE_FILE = /\\.(?:[cm]?[jt]sx?)$/\nconst TEST_FILE = /(?:\\.|-)(?:test|spec|stories)\\.[cm]?[jt]sx?$/\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', 'dist', 'build', 'out', 'coverage', '.wrangler', '.react-router', '.next',\n '.turbo', '.cache', '.worktrees', 'storybook-static', 'test', 'tests', '__tests__', 'fixtures',\n 'fixture_modules', 'migrations', 'drizzle', 'scripts', 'e2e', 'evals',\n])\n\n/** One product-local durability primitive the shared owner already provides. */\ninterface DurabilityOwnerViolation {\n readonly file: string\n readonly line: number\n readonly rule: string\n readonly owner: string\n readonly text: string\n}\n\n/** Result of one durability-owner scan. */\nexport interface DurabilityOwnerReport {\n readonly ok: boolean\n readonly scannedFiles: number\n readonly waived: number\n readonly violations: readonly DurabilityOwnerViolation[]\n}\n\nfunction collect(dir: string, repoDir: string, exclude: readonly string[], out: string[]): void {\n for (const { entry, full } of sourceDirectoryEntries(dir, repoDir, exclude)) {\n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name)) collect(full, repoDir, exclude, out)\n } else if (entry.isFile() && SOURCE_FILE.test(entry.name) && !TEST_FILE.test(entry.name)) {\n out.push(full)\n }\n\n }\n}\n\n/** Scan a product checkout for durability primitives Agent App owns. */\nexport function checkDurabilityOwners(options: {\n repoDir: string\n exclude?: readonly string[]\n}): DurabilityOwnerReport {\n const files: string[] = []\n collect(options.repoDir, options.repoDir, options.exclude ?? [], files)\n const violations: DurabilityOwnerViolation[] = []\n let waived = 0\n for (const file of files) {\n const lines = readFileSync(file, 'utf8').split('\\n')\n lines.forEach((text, index) => {\n const rule = RULES.find((candidate) => candidate.pattern.test(text))\n if (!rule) return\n if (lines.slice(Math.max(0, index - 3), index + 1).some((line) => WAIVER.test(line))) {\n waived += 1\n return\n }\n violations.push({\n file: relative(options.repoDir, file).split(sep).join('/'),\n line: index + 1,\n rule: rule.id,\n owner: rule.owner,\n text: text.trim(),\n })\n })\n }\n return { ok: violations.length === 0, scannedFiles: files.length, waived, violations }\n}\n\n/** Human report for the peer-check CLI. */\nexport function formatDurabilityOwnerReport(report: DurabilityOwnerReport): string {\n if (report.ok) {\n return `durability owners: ${report.scannedFiles} source files use the shared turn durability`\n + (report.waived ? ` (${report.waived} named exceptions)` : '')\n }\n return [\n `DURABILITY OWNER VIOLATED: ${report.violations.length} product-local durability primitive(s).`,\n ...report.violations.map((violation) =>\n ` ${violation.file}:${violation.line} [${violation.rule}] ${violation.text}\\n use: ${violation.owner}`),\n 'Move the behavior to the shared owner, or name a product-only reason with `agent-app-durability-owner: <reason>`.',\n ].join('\\n')\n}\n"],"mappings":";;;;;;;;;;;;;;AAoCA,SAAS,gBAAAA,qBAAoB;AAC7B,SAAS,QAAAC,aAAY;;;ACrBrB,SAAsB,oBAAoB;AAC1C,SAAe,UAAU,WAAW;AAQpC,IAAM,QAAmC;AAAA,EACvC;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EAET;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,EAET;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT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ary exclusions. Callers retain their own file and directory policy. */
|
|
2
|
+
export declare function sourceDirectoryEntries(dir: string, repoDir: string, exclude: readonly string[]): {
|
|
3
|
+
entry: import("fs").Dirent<string>;
|
|
4
|
+
full: string;
|
|
5
|
+
rel: string;
|
|
6
|
+
}[];
|
package/dist/platform/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PLATFORM_AGENT_KEY_PROVISIONER,
|
|
3
|
+
PLATFORM_KEY_PREFIX,
|
|
4
|
+
agentOperatorScopes,
|
|
5
|
+
createApiKeyRequestAuth,
|
|
6
|
+
createPlatformAgentKeyVerifier,
|
|
7
|
+
platformKeyRefusal
|
|
8
|
+
} from "../chunk-XB4KZVUV.js";
|
|
1
9
|
import {
|
|
2
10
|
TangleSsoAccountConflictError,
|
|
3
11
|
TangleSsoUserCreateError,
|
|
@@ -15,19 +23,11 @@ import {
|
|
|
15
23
|
verifySignedSsoState
|
|
16
24
|
} from "../chunk-4P5NFBWX.js";
|
|
17
25
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
agentOperatorScopes,
|
|
21
|
-
createApiKeyRequestAuth,
|
|
22
|
-
createPlatformAgentKeyVerifier,
|
|
23
|
-
platformKeyRefusal
|
|
24
|
-
} from "../chunk-XB4KZVUV.js";
|
|
26
|
+
createWarmCache
|
|
27
|
+
} from "../chunk-F4TUZYMX.js";
|
|
25
28
|
import {
|
|
26
29
|
assertWorkspaceKeyCryptoUsable
|
|
27
30
|
} from "../chunk-VGS2NXLB.js";
|
|
28
|
-
import {
|
|
29
|
-
createWarmCache
|
|
30
|
-
} from "../chunk-F4TUZYMX.js";
|
|
31
31
|
import {
|
|
32
32
|
resolveTangleExecutionEnvironment
|
|
33
33
|
} from "../chunk-D6UJEOZQ.js";
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -49,7 +49,6 @@ export { LEARNED_GUIDANCE_SECTION_ID, renderAgentPrompt, stripComments, type Age
|
|
|
49
49
|
export { defaultSystemPromptPlacement, HARNESS_PROMPT_RECAST, HARNESSES_WITH_OWN_PROMPT, placedSystemPrompt, type SystemPromptPlacement, } from './prompt-placement';
|
|
50
50
|
export { OPERATING_CONTRACT_CLAUSES, OPERATING_CONTRACT_VERSION, renderOperatingContract, type OperatingContractClause, type OperatingContractClauseId, type OperatingContractOptions, type RenderedOperatingContract, } from './operating-contract';
|
|
51
51
|
export { defaultQualitySkills, HUMAN_PROSE_SKILL_ID, humanProseSkill, withDefaultQualitySkills, type HumanProseSkillOptions, type QualitySkillOptions, } from './quality-skills';
|
|
52
|
-
export { HUMANIZER_LICENSE, HUMANIZER_SKILL_ID, HUMANIZER_SOURCE, humanizerSkill } from './humanizer-skill';
|
|
53
52
|
export { captureModelInput, createMemoryModelInputStore, MODEL_INPUT_RECORD_SCHEMA, modelInputBlob, readModelInput, type CaptureModelInputInput, type ModelInputBlob, type ModelInputKind, type ModelInputMediaType, type ModelInputOutcome, type ModelInputRecord, type ModelInputRef, type ModelInputSectionRef, type ModelInputStore, } from './model-input';
|
|
54
53
|
/** The file-mount channels layered onto `resources.files`. The first three
|
|
55
54
|
* mirror {@link ComposeShellResourcesInput}; `userSkills` is the per-user /
|