wyrm-mcp 7.0.3 → 7.2.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/LICENSE +1 -1
- package/NOTICE +40 -0
- package/dist/activation.d.ts +35 -0
- package/dist/activation.d.ts.map +1 -0
- package/dist/activation.js +44 -0
- package/dist/activation.js.map +1 -0
- package/dist/agent-daemon.d.ts +1 -1
- package/dist/agent-daemon.js +1 -1
- package/dist/agent-loop.d.ts +1 -1
- package/dist/agent-loop.js +1 -1
- package/dist/analytics.d.ts +1 -1
- package/dist/analytics.js +1 -1
- package/dist/audit.d.ts +1 -1
- package/dist/audit.js +1 -1
- package/dist/auto-capture.js +1 -1
- package/dist/auto-orchestrator.d.ts +1 -1
- package/dist/auto-orchestrator.js +1 -1
- package/dist/autoconfig.d.ts +1 -1
- package/dist/autoconfig.js +1 -1
- package/dist/buddy-runner.d.ts +24 -0
- package/dist/buddy-runner.d.ts.map +1 -0
- package/dist/buddy-runner.js +109 -0
- package/dist/buddy-runner.js.map +1 -0
- package/dist/buddy.d.ts +1 -1
- package/dist/buddy.js +1 -1
- package/dist/build-flags.d.ts +17 -0
- package/dist/build-flags.d.ts.map +1 -0
- package/dist/build-flags.js +17 -0
- package/dist/build-flags.js.map +1 -0
- package/dist/capabilities.d.ts +1 -1
- package/dist/capabilities.js +1 -1
- package/dist/capture.d.ts +1 -1
- package/dist/capture.js +1 -1
- package/dist/causality.d.ts +1 -1
- package/dist/causality.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/cloud-backup.d.ts +1 -1
- package/dist/cloud-backup.js +1 -1
- package/dist/cloud-profile.d.ts +103 -0
- package/dist/cloud-profile.d.ts.map +1 -0
- package/dist/cloud-profile.js +138 -0
- package/dist/cloud-profile.js.map +1 -0
- package/dist/cloud-sync-entrypoint.d.ts +1 -1
- package/dist/cloud-sync-entrypoint.js +1 -1
- package/dist/cloud-sync.d.ts +1 -1
- package/dist/cloud-sync.js +1 -1
- package/dist/constellation.d.ts +1 -1
- package/dist/constellation.js +1 -1
- package/dist/context-build-budgeted.d.ts +43 -0
- package/dist/context-build-budgeted.d.ts.map +1 -0
- package/dist/context-build-budgeted.js +144 -0
- package/dist/context-build-budgeted.js.map +1 -0
- package/dist/context-ranking.d.ts +1 -1
- package/dist/context-ranking.js +1 -1
- package/dist/crypto.d.ts +1 -1
- package/dist/crypto.js +1 -1
- package/dist/database.d.ts +1 -1
- package/dist/database.js +1 -1
- package/dist/design.d.ts +1 -1
- package/dist/design.js +1 -1
- package/dist/event-replication.d.ts +1 -1
- package/dist/event-replication.js +1 -1
- package/dist/events-sse.d.ts +1 -1
- package/dist/events-sse.js +1 -1
- package/dist/events.js +1 -1
- package/dist/failure-patterns.d.ts +1 -1
- package/dist/failure-patterns.js +1 -1
- package/dist/federation.d.ts +1 -1
- package/dist/federation.js +1 -1
- package/dist/goals.d.ts +1 -1
- package/dist/goals.js +1 -1
- package/dist/handlers/agent.d.ts +7 -0
- package/dist/handlers/agent.d.ts.map +1 -0
- package/dist/handlers/agent.js +165 -0
- package/dist/handlers/agent.js.map +1 -0
- package/dist/handlers/aliases.d.ts +2 -2
- package/dist/handlers/aliases.d.ts.map +1 -1
- package/dist/handlers/aliases.js +3 -2
- package/dist/handlers/aliases.js.map +1 -1
- package/dist/handlers/audit.d.ts +7 -0
- package/dist/handlers/audit.d.ts.map +1 -0
- package/dist/handlers/audit.js +87 -0
- package/dist/handlers/audit.js.map +1 -0
- package/dist/handlers/boundary.d.ts +4 -0
- package/dist/handlers/boundary.d.ts.map +1 -1
- package/dist/handlers/boundary.js +18 -0
- package/dist/handlers/boundary.js.map +1 -1
- package/dist/handlers/capture.d.ts.map +1 -1
- package/dist/handlers/capture.js +146 -2
- package/dist/handlers/capture.js.map +1 -1
- package/dist/handlers/causality.d.ts +7 -0
- package/dist/handlers/causality.d.ts.map +1 -0
- package/dist/handlers/causality.js +114 -0
- package/dist/handlers/causality.js.map +1 -0
- package/dist/handlers/cloud.d.ts +7 -0
- package/dist/handlers/cloud.d.ts.map +1 -0
- package/dist/handlers/cloud.js +382 -0
- package/dist/handlers/cloud.js.map +1 -0
- package/dist/handlers/companion.d.ts +7 -0
- package/dist/handlers/companion.d.ts.map +1 -0
- package/dist/handlers/companion.js +459 -0
- package/dist/handlers/companion.js.map +1 -0
- package/dist/handlers/datalake.d.ts +7 -0
- package/dist/handlers/datalake.d.ts.map +1 -0
- package/dist/handlers/datalake.js +187 -0
- package/dist/handlers/datalake.js.map +1 -0
- package/dist/handlers/dispatch-context.d.ts +153 -0
- package/dist/handlers/dispatch-context.d.ts.map +1 -0
- package/dist/handlers/dispatch-context.js +22 -0
- package/dist/handlers/dispatch-context.js.map +1 -0
- package/dist/handlers/entity.d.ts +7 -0
- package/dist/handlers/entity.d.ts.map +1 -0
- package/dist/handlers/entity.js +256 -0
- package/dist/handlers/entity.js.map +1 -0
- package/dist/handlers/events.d.ts +7 -0
- package/dist/handlers/events.d.ts.map +1 -0
- package/dist/handlers/events.js +335 -0
- package/dist/handlers/events.js.map +1 -0
- package/dist/handlers/intelligence.d.ts +7 -0
- package/dist/handlers/intelligence.d.ts.map +1 -0
- package/dist/handlers/intelligence.js +674 -0
- package/dist/handlers/intelligence.js.map +1 -0
- package/dist/handlers/invoicing.d.ts +7 -0
- package/dist/handlers/invoicing.d.ts.map +1 -0
- package/dist/handlers/invoicing.js +70 -0
- package/dist/handlers/invoicing.js.map +1 -0
- package/dist/handlers/mcpclient.d.ts +7 -0
- package/dist/handlers/mcpclient.d.ts.map +1 -0
- package/dist/handlers/mcpclient.js +137 -0
- package/dist/handlers/mcpclient.js.map +1 -0
- package/dist/handlers/orchestration.d.ts +7 -0
- package/dist/handlers/orchestration.d.ts.map +1 -0
- package/dist/handlers/orchestration.js +125 -0
- package/dist/handlers/orchestration.js.map +1 -0
- package/dist/handlers/presence.d.ts +7 -0
- package/dist/handlers/presence.d.ts.map +1 -0
- package/dist/handlers/presence.js +99 -0
- package/dist/handlers/presence.js.map +1 -0
- package/dist/handlers/project.d.ts +7 -0
- package/dist/handlers/project.d.ts.map +1 -0
- package/dist/handlers/project.js +182 -0
- package/dist/handlers/project.js.map +1 -0
- package/dist/handlers/prompts.d.ts.map +1 -1
- package/dist/handlers/prompts.js +3 -2
- package/dist/handlers/prompts.js.map +1 -1
- package/dist/handlers/recall.d.ts +3 -3
- package/dist/handlers/recall.d.ts.map +1 -1
- package/dist/handlers/recall.js +33 -3
- package/dist/handlers/recall.js.map +1 -1
- package/dist/handlers/registry.d.ts.map +1 -1
- package/dist/handlers/registry.js +45 -0
- package/dist/handlers/registry.js.map +1 -1
- package/dist/handlers/resources.d.ts +131 -0
- package/dist/handlers/resources.d.ts.map +1 -0
- package/dist/handlers/resources.js +288 -0
- package/dist/handlers/resources.js.map +1 -0
- package/dist/handlers/review.d.ts.map +1 -1
- package/dist/handlers/review.js +8 -0
- package/dist/handlers/review.js.map +1 -1
- package/dist/handlers/session.d.ts.map +1 -1
- package/dist/handlers/session.js +3 -2
- package/dist/handlers/session.js.map +1 -1
- package/dist/handlers/share.d.ts +7 -0
- package/dist/handlers/share.d.ts.map +1 -0
- package/dist/handlers/share.js +184 -0
- package/dist/handlers/share.js.map +1 -0
- package/dist/handlers/shims.d.ts.map +1 -1
- package/dist/handlers/shims.js +1 -0
- package/dist/handlers/shims.js.map +1 -1
- package/dist/handlers/skill.d.ts +7 -0
- package/dist/handlers/skill.d.ts.map +1 -0
- package/dist/handlers/skill.js +449 -0
- package/dist/handlers/skill.js.map +1 -0
- package/dist/handlers/survivors.d.ts +19 -0
- package/dist/handlers/survivors.d.ts.map +1 -1
- package/dist/handlers/survivors.js +19 -0
- package/dist/handlers/survivors.js.map +1 -1
- package/dist/handlers/symbols.d.ts +7 -0
- package/dist/handlers/symbols.d.ts.map +1 -0
- package/dist/handlers/symbols.js +109 -0
- package/dist/handlers/symbols.js.map +1 -0
- package/dist/handlers/syncops.d.ts +7 -0
- package/dist/handlers/syncops.d.ts.map +1 -0
- package/dist/handlers/syncops.js +310 -0
- package/dist/handlers/syncops.js.map +1 -0
- package/dist/handlers/types.d.ts +39 -4
- package/dist/handlers/types.d.ts.map +1 -1
- package/dist/handlers/types.js +7 -1
- package/dist/handlers/types.js.map +1 -1
- package/dist/harvest.d.ts +1 -1
- package/dist/harvest.js +1 -1
- package/dist/hours.d.ts +1 -1
- package/dist/hours.js +1 -1
- package/dist/http-auth.d.ts +1 -1
- package/dist/http-auth.js +1 -1
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +221 -4346
- package/dist/index.js.map +1 -1
- package/dist/indexer.d.ts +1 -1
- package/dist/indexer.js +1 -1
- package/dist/intelligence.d.ts +1 -1
- package/dist/intelligence.js +1 -1
- package/dist/internal-dispatch.d.ts +35 -0
- package/dist/internal-dispatch.d.ts.map +1 -0
- package/dist/internal-dispatch.js +217 -0
- package/dist/internal-dispatch.js.map +1 -0
- package/dist/keyset.d.ts +78 -0
- package/dist/keyset.d.ts.map +1 -0
- package/dist/keyset.js +110 -0
- package/dist/keyset.js.map +1 -0
- package/dist/knowledge-graph.d.ts +1 -1
- package/dist/knowledge-graph.js +1 -1
- package/dist/license.d.ts +1 -1
- package/dist/license.js +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/dist/mcp-client.d.ts +1 -1
- package/dist/mcp-client.js +1 -1
- package/dist/memory-artifacts.d.ts +20 -1
- package/dist/memory-artifacts.d.ts.map +1 -1
- package/dist/memory-artifacts.js +48 -1
- package/dist/memory-artifacts.js.map +1 -1
- package/dist/migrate-prompt.d.ts +1 -1
- package/dist/migrate-prompt.js +1 -1
- package/dist/migrations.d.ts +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +33 -1
- package/dist/migrations.js.map +1 -1
- package/dist/presence.d.ts +1 -1
- package/dist/presence.js +1 -1
- package/dist/priority-embed.d.ts +1 -1
- package/dist/priority-embed.js +1 -1
- package/dist/providers/embedding-provider.d.ts +1 -1
- package/dist/providers/embedding-provider.js +1 -1
- package/dist/rehydration.d.ts +1 -1
- package/dist/rehydration.js +1 -1
- package/dist/render-target.d.ts +302 -0
- package/dist/render-target.d.ts.map +1 -0
- package/dist/render-target.js +535 -0
- package/dist/render-target.js.map +1 -0
- package/dist/repl-guard.d.ts +1 -1
- package/dist/repl-guard.js +1 -1
- package/dist/replication-daemon-entrypoint.d.ts +1 -1
- package/dist/replication-daemon-entrypoint.js +1 -1
- package/dist/replication-daemon.d.ts +1 -1
- package/dist/replication-daemon.js +1 -1
- package/dist/resilience.d.ts +1 -1
- package/dist/resilience.js +1 -1
- package/dist/reverse-bridge.d.ts +253 -0
- package/dist/reverse-bridge.d.ts.map +1 -0
- package/dist/reverse-bridge.js +363 -0
- package/dist/reverse-bridge.js.map +1 -0
- package/dist/security.d.ts +1 -1
- package/dist/security.js +1 -1
- package/dist/session-seen.d.ts +1 -1
- package/dist/session-seen.js +1 -1
- package/dist/setup.d.ts +1 -1
- package/dist/setup.js +1 -1
- package/dist/skill-author.d.ts +1 -1
- package/dist/skill-author.js +1 -1
- package/dist/spec-kit.d.ts +1 -1
- package/dist/spec-kit.js +1 -1
- package/dist/statusline.d.ts +1 -1
- package/dist/statusline.js +1 -1
- package/dist/sub-agent.d.ts +1 -1
- package/dist/sub-agent.js +1 -1
- package/dist/symbols.d.ts +1 -1
- package/dist/symbols.js +1 -1
- package/dist/sync.d.ts +1 -1
- package/dist/sync.js +1 -1
- package/dist/tasks-dispatch.d.ts +48 -0
- package/dist/tasks-dispatch.d.ts.map +1 -0
- package/dist/tasks-dispatch.js +84 -0
- package/dist/tasks-dispatch.js.map +1 -0
- package/dist/tasks.d.ts +214 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +282 -0
- package/dist/tasks.js.map +1 -0
- package/dist/token-budget.d.ts +1 -1
- package/dist/token-budget.js +1 -1
- package/dist/tool-analytics.d.ts +1 -1
- package/dist/tool-analytics.js +1 -1
- package/dist/tool-annotations.d.ts.map +1 -1
- package/dist/tool-annotations.js +3 -0
- package/dist/tool-annotations.js.map +1 -1
- package/dist/tool-manifest-v2.json +84 -0
- package/dist/tool-manifest.json +1 -1
- package/dist/tool-profiles.d.ts +1 -1
- package/dist/tool-profiles.js +1 -1
- package/dist/trace-harvest.d.ts +78 -0
- package/dist/trace-harvest.d.ts.map +1 -0
- package/dist/trace-harvest.js +244 -0
- package/dist/trace-harvest.js.map +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/ui-dashboard.d.ts +1 -1
- package/dist/ui-dashboard.js +1 -1
- package/dist/vault.js +1 -1
- package/dist/vectors.d.ts +1 -1
- package/dist/vectors.js +1 -1
- package/dist/version-check.d.ts +1 -1
- package/dist/version-check.js +1 -1
- package/dist/visibility.d.ts +1 -1
- package/dist/visibility.js +1 -1
- package/dist/wyrm-cli.d.ts +1 -1
- package/dist/wyrm-cli.js +252 -1
- package/dist/wyrm-cli.js.map +1 -1
- package/dist/wyrm-loop.d.ts +1 -1
- package/dist/wyrm-loop.js +1 -1
- package/dist/wyrm-manifest.json +219 -1
- package/dist/wyrm-statusline-daemon.d.ts +1 -1
- package/dist/wyrm-statusline-daemon.js +1 -1
- package/dist/wyrm-statusline.d.ts +1 -1
- package/dist/wyrm-statusline.js +1 -1
- package/dist/wyrm-ui.d.ts +1 -1
- package/dist/wyrm-ui.js +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v7 F4 (T042) — Cloud parity v2: the cloud-capable subset of the STANDARD tier.
|
|
3
|
+
*
|
|
4
|
+
* Cloud parity v1 (`cloud-tools.json`, contract `wyrm-cloud-memory-v1`) was a
|
|
5
|
+
* HAND-CURATED 9-name list: the memory/search/truth/quest/stats core the
|
|
6
|
+
* mcp.wyrm.ghosts.lk edge first shipped. v2 makes the cloud subset a
|
|
7
|
+
* MEASURABLE PROPERTY of the frozen surface instead of a guess (spec FR-4 /
|
|
8
|
+
* §7 criterion 12, Article V — "per-tool cloudSupported flags generated from
|
|
9
|
+
* the registry, cannot lie; cloud parity is a measurable property").
|
|
10
|
+
*
|
|
11
|
+
* THE v2 RULE (spec.md:334-336):
|
|
12
|
+
*
|
|
13
|
+
* cloud-capable v2 = STANDARD tier
|
|
14
|
+
* − device-local
|
|
15
|
+
* − egress
|
|
16
|
+
* − subprocess
|
|
17
|
+
*
|
|
18
|
+
* The three exclusion classes below are the tools a STATELESS WORKER cannot
|
|
19
|
+
* honestly serve against a remote D1/KV-backed store:
|
|
20
|
+
*
|
|
21
|
+
* - SUBPROCESS — spawns a local OS process / long-running loop / index build
|
|
22
|
+
* on the operator's machine. Meaningless on the edge (no process to spawn,
|
|
23
|
+
* no local Ollama, no daemon). wyrm_run (the agent run loop) +
|
|
24
|
+
* wyrm_maintenance (reindex / vector-backfill).
|
|
25
|
+
*
|
|
26
|
+
* - EGRESS — reaches OUT to another network endpoint (a peer Worker, a third
|
|
27
|
+
* -party MCP server, a federation peer, a companion model). The edge is the
|
|
28
|
+
* server, not a client; it must not fan out. wyrm_call_external + wyrm_mcp
|
|
29
|
+
* (outbound MCP client) + wyrm_replication (peer push/pull) + wyrm_share
|
|
30
|
+
* (federation egress) + buddy (companion external replies).
|
|
31
|
+
*
|
|
32
|
+
* - DEVICE-LOCAL — semantically bound to THIS machine / process / on-disk
|
|
33
|
+
* session, or a multi-action shim with a device-local action that touches
|
|
34
|
+
* the local filesystem. A stateless Worker has no "this device", no local
|
|
35
|
+
* agent presence, no per-process OODA loop, no server-self capability report
|
|
36
|
+
* that matches the edge's surface, no local disk to write SKILL.md to, and no
|
|
37
|
+
* local tree to scan. wyrm_act + wyrm_presence + wyrm_session +
|
|
38
|
+
* wyrm_capabilities + wyrm_skill (create/register write SKILL.md) +
|
|
39
|
+
* wyrm_project (scan walks the tree; sync reads/writes local .wyrm folders).
|
|
40
|
+
*
|
|
41
|
+
* Everything else on the standard tier is a pure local-DB memory op (capture /
|
|
42
|
+
* recall / search / truth / quest / goal / review / entity / reference / audit /
|
|
43
|
+
* causality / design-token / stats / failure / context) — the edge serves these
|
|
44
|
+
* against its remote store with identical semantics. (NOTE: skill and project
|
|
45
|
+
* are NOT in this list — their multi-action surfaces include a device-local FS
|
|
46
|
+
* write/scan, so they are excluded above, not served pure-DB.)
|
|
47
|
+
*
|
|
48
|
+
* The sets are CLOSED over the standard tier: cloud-profile.test.ts asserts
|
|
49
|
+
* every excluded name is a standard-tier member and the three classes are
|
|
50
|
+
* disjoint, so the subtraction can never silently include a legacy/core-only
|
|
51
|
+
* name or double-count. The measured v2 count is whatever this derivation
|
|
52
|
+
* yields — published, never asserted to a magic literal beyond the spec's
|
|
53
|
+
* ~18-22 sanity band.
|
|
54
|
+
*
|
|
55
|
+
* Article V (vendor-neutral): the exclusion is by TOOL CAPABILITY CLASS, never
|
|
56
|
+
* by client/vendor name. Article VI (back-compat): every v1 name still
|
|
57
|
+
* resolves under v2 — the 9 v1 names are either v2 members or aliases whose
|
|
58
|
+
* target is a v2 member (cloudV1ResolvesUnderV2).
|
|
59
|
+
*
|
|
60
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
61
|
+
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
62
|
+
*/
|
|
63
|
+
/** Contract names. v1 stays for back-compat; v2 is the expanded subset. */
|
|
64
|
+
export declare const CLOUD_CONTRACT_V1: "wyrm-cloud-memory-v1";
|
|
65
|
+
export declare const CLOUD_CONTRACT_V2: "wyrm-cloud-memory-v2";
|
|
66
|
+
/**
|
|
67
|
+
* SUBPROCESS — spawns a local process / loop / index build. Cannot run on a
|
|
68
|
+
* stateless edge Worker.
|
|
69
|
+
*/
|
|
70
|
+
export declare const CLOUD_EXCLUDE_SUBPROCESS: ReadonlySet<string>;
|
|
71
|
+
/**
|
|
72
|
+
* EGRESS — reaches out to another network endpoint. The edge is the server,
|
|
73
|
+
* not a fan-out client.
|
|
74
|
+
*/
|
|
75
|
+
export declare const CLOUD_EXCLUDE_EGRESS: ReadonlySet<string>;
|
|
76
|
+
/**
|
|
77
|
+
* DEVICE-LOCAL — bound to THIS machine / process / on-disk session; has no
|
|
78
|
+
* meaning on a stateless Worker.
|
|
79
|
+
*/
|
|
80
|
+
export declare const CLOUD_EXCLUDE_DEVICE_LOCAL: ReadonlySet<string>;
|
|
81
|
+
/** The union of all three exclusion classes (device-local ∪ egress ∪ subprocess). */
|
|
82
|
+
export declare const CLOUD_EXCLUDED_FROM_STANDARD: ReadonlySet<string>;
|
|
83
|
+
/**
|
|
84
|
+
* THE cloud-capable v2 set — STANDARD tier minus the three exclusion classes.
|
|
85
|
+
* Computed (never hand-listed) so the manifest cannot lie about parity.
|
|
86
|
+
*/
|
|
87
|
+
export declare const CLOUD_CAPABLE_V2: ReadonlySet<string>;
|
|
88
|
+
/** Sorted array view (codepoint order) — deterministic iteration / manifests. */
|
|
89
|
+
export declare const CLOUD_CAPABLE_V2_NAMES: readonly string[];
|
|
90
|
+
/** The measured v2 tool count (whatever the derivation yields). */
|
|
91
|
+
export declare const CLOUD_CAPABLE_V2_COUNT: number;
|
|
92
|
+
/**
|
|
93
|
+
* v1 → v2 resolution check (Article VI): every v1 cloud name must still be
|
|
94
|
+
* answered under v2 — either it IS a v2 member, or it is a hidden alias whose
|
|
95
|
+
* routed target is a v2 member. `aliasTargetOf` is injected (the alias spine
|
|
96
|
+
* lives in handlers/aliases.ts; passing it keeps cloud-profile.ts free of a
|
|
97
|
+
* registry import cycle).
|
|
98
|
+
*/
|
|
99
|
+
export declare function cloudV1ResolvesUnderV2(v1Names: readonly string[], aliasTargetOf: (name: string) => string | undefined): {
|
|
100
|
+
resolves: boolean;
|
|
101
|
+
unresolved: string[];
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=cloud-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-profile.d.ts","sourceRoot":"","sources":["../src/cloud-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAIH,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,EAAG,sBAA+B,CAAC;AACjE,eAAO,MAAM,iBAAiB,EAAG,sBAA+B,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,MAAM,CAGvD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAMnD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAazD,CAAC;AAEH,qFAAqF;AACrF,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,MAAM,CAI3D,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAEhD,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAAiC,CAAC;AAEtF,mEAAmE;AACnE,eAAO,MAAM,sBAAsB,QAAwB,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAClD;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAS7C"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v7 F4 (T042) — Cloud parity v2: the cloud-capable subset of the STANDARD tier.
|
|
3
|
+
*
|
|
4
|
+
* Cloud parity v1 (`cloud-tools.json`, contract `wyrm-cloud-memory-v1`) was a
|
|
5
|
+
* HAND-CURATED 9-name list: the memory/search/truth/quest/stats core the
|
|
6
|
+
* mcp.wyrm.ghosts.lk edge first shipped. v2 makes the cloud subset a
|
|
7
|
+
* MEASURABLE PROPERTY of the frozen surface instead of a guess (spec FR-4 /
|
|
8
|
+
* §7 criterion 12, Article V — "per-tool cloudSupported flags generated from
|
|
9
|
+
* the registry, cannot lie; cloud parity is a measurable property").
|
|
10
|
+
*
|
|
11
|
+
* THE v2 RULE (spec.md:334-336):
|
|
12
|
+
*
|
|
13
|
+
* cloud-capable v2 = STANDARD tier
|
|
14
|
+
* − device-local
|
|
15
|
+
* − egress
|
|
16
|
+
* − subprocess
|
|
17
|
+
*
|
|
18
|
+
* The three exclusion classes below are the tools a STATELESS WORKER cannot
|
|
19
|
+
* honestly serve against a remote D1/KV-backed store:
|
|
20
|
+
*
|
|
21
|
+
* - SUBPROCESS — spawns a local OS process / long-running loop / index build
|
|
22
|
+
* on the operator's machine. Meaningless on the edge (no process to spawn,
|
|
23
|
+
* no local Ollama, no daemon). wyrm_run (the agent run loop) +
|
|
24
|
+
* wyrm_maintenance (reindex / vector-backfill).
|
|
25
|
+
*
|
|
26
|
+
* - EGRESS — reaches OUT to another network endpoint (a peer Worker, a third
|
|
27
|
+
* -party MCP server, a federation peer, a companion model). The edge is the
|
|
28
|
+
* server, not a client; it must not fan out. wyrm_call_external + wyrm_mcp
|
|
29
|
+
* (outbound MCP client) + wyrm_replication (peer push/pull) + wyrm_share
|
|
30
|
+
* (federation egress) + buddy (companion external replies).
|
|
31
|
+
*
|
|
32
|
+
* - DEVICE-LOCAL — semantically bound to THIS machine / process / on-disk
|
|
33
|
+
* session, or a multi-action shim with a device-local action that touches
|
|
34
|
+
* the local filesystem. A stateless Worker has no "this device", no local
|
|
35
|
+
* agent presence, no per-process OODA loop, no server-self capability report
|
|
36
|
+
* that matches the edge's surface, no local disk to write SKILL.md to, and no
|
|
37
|
+
* local tree to scan. wyrm_act + wyrm_presence + wyrm_session +
|
|
38
|
+
* wyrm_capabilities + wyrm_skill (create/register write SKILL.md) +
|
|
39
|
+
* wyrm_project (scan walks the tree; sync reads/writes local .wyrm folders).
|
|
40
|
+
*
|
|
41
|
+
* Everything else on the standard tier is a pure local-DB memory op (capture /
|
|
42
|
+
* recall / search / truth / quest / goal / review / entity / reference / audit /
|
|
43
|
+
* causality / design-token / stats / failure / context) — the edge serves these
|
|
44
|
+
* against its remote store with identical semantics. (NOTE: skill and project
|
|
45
|
+
* are NOT in this list — their multi-action surfaces include a device-local FS
|
|
46
|
+
* write/scan, so they are excluded above, not served pure-DB.)
|
|
47
|
+
*
|
|
48
|
+
* The sets are CLOSED over the standard tier: cloud-profile.test.ts asserts
|
|
49
|
+
* every excluded name is a standard-tier member and the three classes are
|
|
50
|
+
* disjoint, so the subtraction can never silently include a legacy/core-only
|
|
51
|
+
* name or double-count. The measured v2 count is whatever this derivation
|
|
52
|
+
* yields — published, never asserted to a magic literal beyond the spec's
|
|
53
|
+
* ~18-22 sanity band.
|
|
54
|
+
*
|
|
55
|
+
* Article V (vendor-neutral): the exclusion is by TOOL CAPABILITY CLASS, never
|
|
56
|
+
* by client/vendor name. Article VI (back-compat): every v1 name still
|
|
57
|
+
* resolves under v2 — the 9 v1 names are either v2 members or aliases whose
|
|
58
|
+
* target is a v2 member (cloudV1ResolvesUnderV2).
|
|
59
|
+
*
|
|
60
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
61
|
+
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
62
|
+
*/
|
|
63
|
+
import { FROZEN_TOOLS } from './tool-profiles.js';
|
|
64
|
+
/** Contract names. v1 stays for back-compat; v2 is the expanded subset. */
|
|
65
|
+
export const CLOUD_CONTRACT_V1 = 'wyrm-cloud-memory-v1';
|
|
66
|
+
export const CLOUD_CONTRACT_V2 = 'wyrm-cloud-memory-v2';
|
|
67
|
+
/**
|
|
68
|
+
* SUBPROCESS — spawns a local process / loop / index build. Cannot run on a
|
|
69
|
+
* stateless edge Worker.
|
|
70
|
+
*/
|
|
71
|
+
export const CLOUD_EXCLUDE_SUBPROCESS = new Set([
|
|
72
|
+
'wyrm_run', // the agent run loop (start|join|status|debrief|end)
|
|
73
|
+
'wyrm_maintenance', // reindex / vector-backfill — local index build
|
|
74
|
+
]);
|
|
75
|
+
/**
|
|
76
|
+
* EGRESS — reaches out to another network endpoint. The edge is the server,
|
|
77
|
+
* not a fan-out client.
|
|
78
|
+
*/
|
|
79
|
+
export const CLOUD_EXCLUDE_EGRESS = new Set([
|
|
80
|
+
'wyrm_call_external', // call a registered external MCP tool
|
|
81
|
+
'wyrm_mcp', // outbound MCP client management (register/list/tools/disable)
|
|
82
|
+
'wyrm_replication', // peer push/pull + the Live-Memory event mesh
|
|
83
|
+
'wyrm_share', // cross-device federation share/unshare
|
|
84
|
+
'buddy', // companion buddy — collects external buddy replies
|
|
85
|
+
]);
|
|
86
|
+
/**
|
|
87
|
+
* DEVICE-LOCAL — bound to THIS machine / process / on-disk session; has no
|
|
88
|
+
* meaning on a stateless Worker.
|
|
89
|
+
*/
|
|
90
|
+
export const CLOUD_EXCLUDE_DEVICE_LOCAL = new Set([
|
|
91
|
+
'wyrm_act', // the per-process OODA-loop dispatcher
|
|
92
|
+
'wyrm_presence', // local agent presence on this device
|
|
93
|
+
'wyrm_session', // on-disk session lifecycle (start/update/rehydrate)
|
|
94
|
+
'wyrm_capabilities', // server-self capability report (matches THIS surface)
|
|
95
|
+
// Multi-action noun shims whose ADVERTISED surface includes a device-local
|
|
96
|
+
// action that writes/scans the operator's local filesystem — meaningless on a
|
|
97
|
+
// stateless edge Worker. Under the COARSE name-level v2 derivation, a tool
|
|
98
|
+
// whose surface includes ANY device-local action must NOT be declared
|
|
99
|
+
// cloudSupported, even though some of its other actions are pure-DB. Declaring
|
|
100
|
+
// them cloud-capable would make the v2 manifest LIE about parity (Article V).
|
|
101
|
+
'wyrm_skill', // action=create/register writes SKILL.md under WYRM_SKILLS_DIR (skill-author.ts:deploySkill)
|
|
102
|
+
'wyrm_project', // action=scan walks the local tree; action=sync reads/writes local .wyrm folders
|
|
103
|
+
]);
|
|
104
|
+
/** The union of all three exclusion classes (device-local ∪ egress ∪ subprocess). */
|
|
105
|
+
export const CLOUD_EXCLUDED_FROM_STANDARD = new Set([
|
|
106
|
+
...CLOUD_EXCLUDE_SUBPROCESS,
|
|
107
|
+
...CLOUD_EXCLUDE_EGRESS,
|
|
108
|
+
...CLOUD_EXCLUDE_DEVICE_LOCAL,
|
|
109
|
+
]);
|
|
110
|
+
/**
|
|
111
|
+
* THE cloud-capable v2 set — STANDARD tier minus the three exclusion classes.
|
|
112
|
+
* Computed (never hand-listed) so the manifest cannot lie about parity.
|
|
113
|
+
*/
|
|
114
|
+
export const CLOUD_CAPABLE_V2 = new Set([...FROZEN_TOOLS].filter((name) => !CLOUD_EXCLUDED_FROM_STANDARD.has(name)));
|
|
115
|
+
/** Sorted array view (codepoint order) — deterministic iteration / manifests. */
|
|
116
|
+
export const CLOUD_CAPABLE_V2_NAMES = [...CLOUD_CAPABLE_V2].sort();
|
|
117
|
+
/** The measured v2 tool count (whatever the derivation yields). */
|
|
118
|
+
export const CLOUD_CAPABLE_V2_COUNT = CLOUD_CAPABLE_V2.size;
|
|
119
|
+
/**
|
|
120
|
+
* v1 → v2 resolution check (Article VI): every v1 cloud name must still be
|
|
121
|
+
* answered under v2 — either it IS a v2 member, or it is a hidden alias whose
|
|
122
|
+
* routed target is a v2 member. `aliasTargetOf` is injected (the alias spine
|
|
123
|
+
* lives in handlers/aliases.ts; passing it keeps cloud-profile.ts free of a
|
|
124
|
+
* registry import cycle).
|
|
125
|
+
*/
|
|
126
|
+
export function cloudV1ResolvesUnderV2(v1Names, aliasTargetOf) {
|
|
127
|
+
const unresolved = [];
|
|
128
|
+
for (const name of v1Names) {
|
|
129
|
+
if (CLOUD_CAPABLE_V2.has(name))
|
|
130
|
+
continue;
|
|
131
|
+
const target = aliasTargetOf(name);
|
|
132
|
+
if (target && CLOUD_CAPABLE_V2.has(target))
|
|
133
|
+
continue;
|
|
134
|
+
unresolved.push(name);
|
|
135
|
+
}
|
|
136
|
+
return { resolves: unresolved.length === 0, unresolved };
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=cloud-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-profile.js","sourceRoot":"","sources":["../src/cloud-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAA+B,CAAC;AACjE,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAA+B,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,UAAU,EAAE,qDAAqD;IACjE,kBAAkB,EAAE,gDAAgD;CACrE,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IAC/D,oBAAoB,EAAE,sCAAsC;IAC5D,UAAU,EAAE,+DAA+D;IAC3E,kBAAkB,EAAE,8CAA8C;IAClE,YAAY,EAAE,wCAAwC;IACtD,OAAO,EAAE,oDAAoD;CAC9D,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAwB,IAAI,GAAG,CAAC;IACrE,UAAU,EAAE,uCAAuC;IACnD,eAAe,EAAE,sCAAsC;IACvD,cAAc,EAAE,qDAAqD;IACrE,mBAAmB,EAAE,uDAAuD;IAC5E,2EAA2E;IAC3E,8EAA8E;IAC9E,2EAA2E;IAC3E,sEAAsE;IACtE,+EAA+E;IAC/E,8EAA8E;IAC9E,YAAY,EAAE,6FAA6F;IAC3G,cAAc,EAAE,iFAAiF;CAClG,CA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
15
15
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
16
16
|
*/
|
|
17
17
|
export {};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* argv[2] = interval_ms
|
|
12
12
|
* argv[3] = keep_count
|
|
13
13
|
*
|
|
14
|
-
* @copyright
|
|
14
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
15
15
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
16
16
|
*/
|
|
17
17
|
import { WyrmCloudBackup } from './cloud-backup.js';
|
package/dist/cloud-sync.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Architecture is documented in docs/CLOUD-SYNC.md.
|
|
10
10
|
*
|
|
11
|
-
* @copyright
|
|
11
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
12
12
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
13
13
|
*/
|
|
14
14
|
import type { WyrmCloudBackup } from './cloud-backup.js';
|
package/dist/cloud-sync.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Architecture is documented in docs/CLOUD-SYNC.md.
|
|
10
10
|
*
|
|
11
|
-
* @copyright
|
|
11
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
12
12
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
13
13
|
*/
|
|
14
14
|
import { spawn } from 'child_process';
|
package/dist/constellation.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* migration 14, default `'within'`). Only artifacts explicitly flagged
|
|
12
12
|
* `'org'` or `'public'` leak across the project boundary.
|
|
13
13
|
*
|
|
14
|
-
* @copyright
|
|
14
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
15
15
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
16
16
|
*/
|
|
17
17
|
import type Database from 'better-sqlite3';
|
package/dist/constellation.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* migration 14, default `'within'`). Only artifacts explicitly flagged
|
|
12
12
|
* `'org'` or `'public'` leak across the project boundary.
|
|
13
13
|
*
|
|
14
|
-
* @copyright
|
|
14
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
15
15
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
16
16
|
*/
|
|
17
17
|
const SAFE_KINDS = new Set(['truth', 'artifact', 'quest', 'decision', 'reference']);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Budgeted wyrm_context_build path (Spec 014; v7 F4 T036 — extracted from the
|
|
3
|
+
* index.ts monolith). Renders a stable preamble (ground truths) + a dynamic
|
|
4
|
+
* body (best scaffold + recalled memory) under a token budget; items below the
|
|
5
|
+
* cutoff elide to one-line stubs the agent can re-`wyrm_recall`. Lifted VERBATIM
|
|
6
|
+
* behind a factory that captures the same index.ts singletons + budgeting
|
|
7
|
+
* helpers it always closed over (deterministic; no LLM, Article III).
|
|
8
|
+
*
|
|
9
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
10
|
+
* @license AGPL-3.0-or-later
|
|
11
|
+
*/
|
|
12
|
+
import type { RankWeights } from "./context-ranking.js";
|
|
13
|
+
import type { MemoryArtifacts } from "./memory-artifacts.js";
|
|
14
|
+
import type { GroundTruths, ReasoningScaffolds } from "./intelligence.js";
|
|
15
|
+
import type { ToolAnalytics } from "./tool-analytics.js";
|
|
16
|
+
import type { SessionSeen } from "./session-seen.js";
|
|
17
|
+
import type { TokenEstimator } from "./token-budget.js";
|
|
18
|
+
export interface BudgetedContextDeps {
|
|
19
|
+
groundTruths: GroundTruths;
|
|
20
|
+
scaffoldLib: ReasoningScaffolds;
|
|
21
|
+
memory: MemoryArtifacts;
|
|
22
|
+
toolAnalytics: ToolAnalytics;
|
|
23
|
+
sessionSeen: () => SessionSeen;
|
|
24
|
+
tokenEstimator: TokenEstimator;
|
|
25
|
+
rankWeights: RankWeights;
|
|
26
|
+
}
|
|
27
|
+
export declare function makeRunBudgetedContextBuild(deps: BudgetedContextDeps): (opts: {
|
|
28
|
+
project: {
|
|
29
|
+
id: number;
|
|
30
|
+
};
|
|
31
|
+
task: string;
|
|
32
|
+
maxTokens: number;
|
|
33
|
+
sessionId?: number;
|
|
34
|
+
strictBudget: boolean;
|
|
35
|
+
kinds?: import("./memory-artifacts.js").ArtifactKind[];
|
|
36
|
+
minConfidence?: number;
|
|
37
|
+
}) => {
|
|
38
|
+
content: {
|
|
39
|
+
type: "text";
|
|
40
|
+
text: string;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=context-build-budgeted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-build-budgeted.d.ts","sourceRoot":"","sources":["../src/context-build-budgeted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,kBAAkB,CAAC;IAChC,MAAM,EAAE,eAAe,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,MAAM,WAAW,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,mBAAmB,IAE3B,MAAM;IAC9C,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,uBAAuB,EAAE,YAAY,EAAE,CAAC;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;;;;;EAgJA"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Budgeted wyrm_context_build path (Spec 014; v7 F4 T036 — extracted from the
|
|
3
|
+
* index.ts monolith). Renders a stable preamble (ground truths) + a dynamic
|
|
4
|
+
* body (best scaffold + recalled memory) under a token budget; items below the
|
|
5
|
+
* cutoff elide to one-line stubs the agent can re-`wyrm_recall`. Lifted VERBATIM
|
|
6
|
+
* behind a factory that captures the same index.ts singletons + budgeting
|
|
7
|
+
* helpers it always closed over (deterministic; no LLM, Article III).
|
|
8
|
+
*
|
|
9
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
10
|
+
* @license AGPL-3.0-or-later
|
|
11
|
+
*/
|
|
12
|
+
import { applyBudget, resolveBudget } from "./token-budget.js";
|
|
13
|
+
import { score as rankScore } from "./context-ranking.js";
|
|
14
|
+
export function makeRunBudgetedContextBuild(deps) {
|
|
15
|
+
const { groundTruths, scaffoldLib, memory, toolAnalytics, sessionSeen, tokenEstimator, rankWeights } = deps;
|
|
16
|
+
return function runBudgetedContextBuild(opts) {
|
|
17
|
+
// Resolve effective budget per spec 014 D1 precedence: call > env > fallback.
|
|
18
|
+
const budget = resolveBudget({
|
|
19
|
+
callArg: opts.maxTokens,
|
|
20
|
+
envValue: process.env.WYRM_CONTEXT_TOKEN_BUDGET,
|
|
21
|
+
clientName: null, // clientInfo wiring is a follow-up; env override is the lever today
|
|
22
|
+
});
|
|
23
|
+
const seen = opts.sessionId ? sessionSeen().getSeen(opts.sessionId) : new Set();
|
|
24
|
+
// --- Stable preamble (ground truths) ---
|
|
25
|
+
const truthsText = groundTruths.formatForContext(opts.project.id);
|
|
26
|
+
const truthsTokens = tokenEstimator.count(truthsText ?? '');
|
|
27
|
+
// Strict budget mode (D3) elides truths if even the preamble overflows;
|
|
28
|
+
// default behavior is to warn-and-overflow per spec 014.
|
|
29
|
+
let preambleText = truthsText ?? '';
|
|
30
|
+
let preambleEmitted = truthsTokens;
|
|
31
|
+
if (truthsTokens > budget * 0.5 && !opts.strictBudget) {
|
|
32
|
+
process.stderr.write(`[wyrm_context_build] ground truths consume ${truthsTokens} of ${budget}-token budget — body will be heavily elided. Pass strict_budget:true to elide truths too.\n`);
|
|
33
|
+
}
|
|
34
|
+
if (opts.strictBudget && truthsTokens > budget * 0.5) {
|
|
35
|
+
// Strict mode: keep truths brief
|
|
36
|
+
preambleText = (truthsText ?? '').slice(0, budget * 2); // 2 chars/token rough cap on chars
|
|
37
|
+
preambleEmitted = tokenEstimator.count(preambleText);
|
|
38
|
+
}
|
|
39
|
+
// --- Build candidate body items: best scaffold + memory artifacts ---
|
|
40
|
+
const items = [];
|
|
41
|
+
// Scaffold (treated as a single candidate)
|
|
42
|
+
const scaffoldMatch = scaffoldLib.findBest(opts.task, opts.project.id);
|
|
43
|
+
if (scaffoldMatch) {
|
|
44
|
+
const sText = scaffoldLib.formatForContext(scaffoldMatch);
|
|
45
|
+
const sId = scaffoldMatch.scaffold.id;
|
|
46
|
+
items.push({
|
|
47
|
+
item: { kind: 'scaffold', id: sId, title: scaffoldMatch.scaffold.problem_type, body: sText },
|
|
48
|
+
key: `scaffold:${sId}`,
|
|
49
|
+
inlineCost: tokenEstimator.count(sText),
|
|
50
|
+
stubCost: 20,
|
|
51
|
+
// Scaffold is high-relevance by definition; assign generous score.
|
|
52
|
+
score: rankScore({ confidence: 0.9, relevance: 0.9, updatedAt: new Date().toISOString() }, rankWeights),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// Memory artifacts via recall (which returns id-level results with relevance scores)
|
|
56
|
+
const recalled = memory.recall(opts.project.id, opts.task, {
|
|
57
|
+
limit: 20,
|
|
58
|
+
minConfidence: opts.minConfidence ?? 0.2,
|
|
59
|
+
});
|
|
60
|
+
for (const r of recalled) {
|
|
61
|
+
const a = r.artifact;
|
|
62
|
+
// Skip kind filter mismatches if caller specified one
|
|
63
|
+
if (opts.kinds && opts.kinds.length > 0 && !opts.kinds.includes(a.kind))
|
|
64
|
+
continue;
|
|
65
|
+
const body = [
|
|
66
|
+
`**${a.kind.toUpperCase()}** · ${a.problem}`,
|
|
67
|
+
a.constraints ? `Constraints: ${a.constraints}` : '',
|
|
68
|
+
a.validated_fix ? `Fix: ${a.validated_fix}` : '',
|
|
69
|
+
a.why_it_worked ? `Why: ${a.why_it_worked}` : '',
|
|
70
|
+
].filter(Boolean).join('\n');
|
|
71
|
+
items.push({
|
|
72
|
+
item: { kind: 'memory', id: a.id, title: a.problem.slice(0, 60), body },
|
|
73
|
+
key: `memory:${a.id}`,
|
|
74
|
+
inlineCost: tokenEstimator.count(body),
|
|
75
|
+
stubCost: 25,
|
|
76
|
+
score: rankScore({
|
|
77
|
+
confidence: a.confidence,
|
|
78
|
+
relevance: r.relevance_score,
|
|
79
|
+
updatedAt: a.updated_at,
|
|
80
|
+
}, rankWeights),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// --- Apply budget ---
|
|
84
|
+
const result = applyBudget(items, {
|
|
85
|
+
budget,
|
|
86
|
+
alreadySeen: seen,
|
|
87
|
+
reserved: opts.strictBudget ? 0 : preambleEmitted,
|
|
88
|
+
});
|
|
89
|
+
// --- Mark inlined items as seen for this session ---
|
|
90
|
+
if (opts.sessionId) {
|
|
91
|
+
sessionSeen().markBulk(opts.sessionId, result.inline.map((it) => ({ id: it.id, kind: it.kind, mode: 'inline' })));
|
|
92
|
+
sessionSeen().markBulk(opts.sessionId, result.elided.map((e) => ({ id: e.item.id, kind: e.item.kind, mode: 'stub' })));
|
|
93
|
+
}
|
|
94
|
+
// --- Render output ---
|
|
95
|
+
const lines = [];
|
|
96
|
+
lines.push(` **Context Brief** — "${opts.task}"`);
|
|
97
|
+
lines.push('');
|
|
98
|
+
lines.push('## Ground truths (stable preamble)');
|
|
99
|
+
lines.push('');
|
|
100
|
+
lines.push(preambleText || '_no ground truths set for this project yet_');
|
|
101
|
+
lines.push('');
|
|
102
|
+
lines.push('## Task-relevant memory');
|
|
103
|
+
lines.push('');
|
|
104
|
+
for (const it of result.inline) {
|
|
105
|
+
lines.push(`### [${it.kind}:${it.id}] ${it.title}`);
|
|
106
|
+
lines.push(it.body);
|
|
107
|
+
lines.push('');
|
|
108
|
+
}
|
|
109
|
+
if (result.elided.length > 0) {
|
|
110
|
+
lines.push('## Elided to stubs');
|
|
111
|
+
lines.push('');
|
|
112
|
+
lines.push('_Below the budget cutoff or already seen this session. Recall with `wyrm_recall(id)`:_');
|
|
113
|
+
lines.push('');
|
|
114
|
+
for (const e of result.elided) {
|
|
115
|
+
const tag = e.reason === 'seen' ? 'shown earlier in session' : `~${e.stubCost} tokens`;
|
|
116
|
+
lines.push(`- [${e.item.kind}:${e.item.id}] ${e.item.title} · ${tag}`);
|
|
117
|
+
}
|
|
118
|
+
lines.push('');
|
|
119
|
+
}
|
|
120
|
+
lines.push('---');
|
|
121
|
+
lines.push(`_Budget: ${result.tokensInline}/${budget} tokens inline · ${result.elided.length} stub${result.elided.length === 1 ? '' : 's'} · estimator: ${tokenEstimator.source}_`);
|
|
122
|
+
const text = lines.join('\n');
|
|
123
|
+
// Telemetry — fire-and-forget via the existing tool_call_log surface.
|
|
124
|
+
try {
|
|
125
|
+
toolAnalytics.log({
|
|
126
|
+
tool_name: 'wyrm_context_build',
|
|
127
|
+
project_id: opts.project.id,
|
|
128
|
+
args: {
|
|
129
|
+
budget,
|
|
130
|
+
items_total: items.length,
|
|
131
|
+
items_inline: result.inline.length,
|
|
132
|
+
items_elided: result.elided.length,
|
|
133
|
+
tokens_inline: result.tokensInline,
|
|
134
|
+
tokens_stubs: result.tokensStubs,
|
|
135
|
+
},
|
|
136
|
+
success: true,
|
|
137
|
+
latency_ms: 0,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch { /* never fail context_build on telemetry */ }
|
|
141
|
+
return { content: [{ type: 'text', text }] };
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=context-build-budgeted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-build-budgeted.js","sourceRoot":"","sources":["../src/context-build-budgeted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAmB1D,MAAM,UAAU,2BAA2B,CAAC,IAAyB;IACnE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC5G,OAAO,SAAS,uBAAuB,CAAC,IAQzC;QACC,8EAA8E;QAC9E,MAAM,MAAM,GAAG,aAAa,CAAC;YAC3B,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB;YAC/C,UAAU,EAAE,IAAI,EAAE,oEAAoE;SACvF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,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Aa,EAAE,MAAM,CAAC,YAAY;oBAClC,YAAY,EAAE,MAAM,CAAC,WAAW;iBACjC;gBACD,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,CAAC;aACd,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC,CAAC,2CAA2C,CAAC,CAAC;QAEvD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACxD,CAAC,CAAC;AACF,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Weights load from WYRM_RANK_WEIGHTS env (JSON) with sane defaults.
|
|
9
9
|
*
|
|
10
|
-
* @copyright
|
|
10
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
11
11
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
12
12
|
*/
|
|
13
13
|
export interface RankWeights {
|
package/dist/context-ranking.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Weights load from WYRM_RANK_WEIGHTS env (JSON) with sane defaults.
|
|
9
9
|
*
|
|
10
|
-
* @copyright
|
|
10
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
11
11
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
12
12
|
*/
|
|
13
13
|
import { logger } from './logger.js';
|
package/dist/crypto.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Wyrm Encryption Module
|
|
3
3
|
* AES-256-GCM encryption for sensitive memory data
|
|
4
4
|
*
|
|
5
|
-
* @copyright
|
|
5
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
6
6
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
7
7
|
* @module crypto
|
|
8
8
|
* @version 3.0.0
|
package/dist/crypto.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Wyrm Encryption Module
|
|
3
3
|
* AES-256-GCM encryption for sensitive memory data
|
|
4
4
|
*
|
|
5
|
-
* @copyright
|
|
5
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
6
6
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
7
7
|
* @module crypto
|
|
8
8
|
* @version 3.0.0
|
package/dist/database.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wyrm Database - SQLite storage for infinite memory with data lake support
|
|
3
3
|
*
|
|
4
|
-
* @copyright
|
|
4
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
5
5
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
6
6
|
*
|
|
7
7
|
* Features:
|
package/dist/database.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wyrm Database - SQLite storage for infinite memory with data lake support
|
|
3
3
|
*
|
|
4
|
-
* @copyright
|
|
4
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
5
5
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
6
6
|
*
|
|
7
7
|
* Features:
|
package/dist/design.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* with tags, so a designer accreting visual references over time has a
|
|
11
11
|
* searchable library.
|
|
12
12
|
*
|
|
13
|
-
* @copyright
|
|
13
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
14
14
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
15
15
|
*/
|
|
16
16
|
import type Database from 'better-sqlite3';
|
package/dist/design.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* with tags, so a designer accreting visual references over time has a
|
|
11
11
|
* searchable library.
|
|
12
12
|
*
|
|
13
|
-
* @copyright
|
|
13
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
14
14
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
15
15
|
*/
|
|
16
16
|
const VALID_CATEGORIES = new Set([
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* The DB dependency is a structural interface (`ReplDb`) and `fetch` is injected,
|
|
16
16
|
* so this whole module is unit-testable with a fake peer and no real sockets.
|
|
17
17
|
*
|
|
18
|
-
* @copyright
|
|
18
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
19
19
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
20
20
|
*/
|
|
21
21
|
import type { WyrmEvent, RemoteEvent, IngestResult } from './events.js';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* The DB dependency is a structural interface (`ReplDb`) and `fetch` is injected,
|
|
16
16
|
* so this whole module is unit-testable with a fake peer and no real sockets.
|
|
17
17
|
*
|
|
18
|
-
* @copyright
|
|
18
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
19
19
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
20
20
|
*/
|
|
21
21
|
import { logger } from './logger.js';
|
package/dist/events-sse.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* load; v7 F2 T012 made that open lazy, but small pure modules remain the
|
|
8
8
|
* right unit-test surface.)
|
|
9
9
|
*
|
|
10
|
-
* @copyright
|
|
10
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
11
11
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
12
12
|
*/
|
|
13
13
|
export interface SseEventLike {
|
package/dist/events-sse.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* load; v7 F2 T012 made that open lazy, but small pure modules remain the
|
|
8
8
|
* right unit-test surface.)
|
|
9
9
|
*
|
|
10
|
-
* @copyright
|
|
10
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
11
11
|
* @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
|
|
12
12
|
*/
|
|
13
13
|
/**
|