@kynver-app/runtime 0.1.123 → 0.1.128

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.
Files changed (38) hide show
  1. package/dist/chat/chat-claim-loop.d.ts +11 -0
  2. package/dist/chat/command-allowlist.d.ts +8 -0
  3. package/dist/chat/command-executor.d.ts +13 -0
  4. package/dist/cli.js +54 -17782
  5. package/dist/cron/cron-cli-bin.d.ts +7 -0
  6. package/dist/cron/cron-readiness.d.ts +35 -0
  7. package/dist/disk-gate.d.ts +7 -0
  8. package/dist/index.js +71 -19281
  9. package/dist/mesh-liveness/mesh-cron-lease-store.d.ts +9 -0
  10. package/dist/server/cleanup.js +16 -4054
  11. package/dist/server/default-repo.js +1 -458
  12. package/dist/server/harness-notice.js +15 -287
  13. package/dist/server/heavy-verification.js +1 -223
  14. package/dist/server/landing.js +1 -44
  15. package/dist/server/memory-cost-enforce.js +2 -480
  16. package/dist/server/memory-cost.js +2 -184
  17. package/dist/server/monitor.js +8 -1805
  18. package/dist/server/orchestration.js +1 -444
  19. package/dist/server/pr-evidence.js +1 -163
  20. package/dist/server/repo-search.js +1 -224
  21. package/dist/server/worker-policy.js +1 -432
  22. package/dist/worker-persona-catalog.js +1 -138
  23. package/package.json +3 -2
  24. package/dist/cli.js.map +0 -7
  25. package/dist/index.js.map +0 -7
  26. package/dist/server/cleanup.js.map +0 -7
  27. package/dist/server/default-repo.js.map +0 -7
  28. package/dist/server/harness-notice.js.map +0 -7
  29. package/dist/server/heavy-verification.js.map +0 -7
  30. package/dist/server/landing.js.map +0 -7
  31. package/dist/server/memory-cost-enforce.js.map +0 -7
  32. package/dist/server/memory-cost.js.map +0 -7
  33. package/dist/server/monitor.js.map +0 -7
  34. package/dist/server/orchestration.js.map +0 -7
  35. package/dist/server/pr-evidence.js.map +0 -7
  36. package/dist/server/repo-search.js.map +0 -7
  37. package/dist/server/worker-policy.js.map +0 -7
  38. package/dist/worker-persona-catalog.js.map +0 -7
@@ -1,184 +1,2 @@
1
- // src/worker-env.ts
2
- var FORBIDDEN_WORKER_ENV_KEYS = [
3
- "ANTHROPIC_API_KEY",
4
- "ANALYST_API_KEY",
5
- "RECRUITER_API_KEY",
6
- "AUTH_SECRET",
7
- "NEXTAUTH_SECRET",
8
- "DATABASE_URL",
9
- "PRODUCTION_DATABASE_URL",
10
- "KYNVER_PRODUCTION_DATABASE_URL",
11
- "REDIS_URL",
12
- "GOOGLE_CLIENT_SECRET",
13
- "GITHUB_CLIENT_SECRET",
14
- "KYNVER_API_KEY",
15
- "KYNVER_SERVICE_SECRET",
16
- "KYNVER_RUNTIME_SECRET",
17
- "KYNVER_CRON_SECRET",
18
- "OPENCLAW_CRON_SECRET",
19
- "QSTASH_TOKEN",
20
- "QSTASH_CURRENT_SIGNING_KEY",
21
- "QSTASH_NEXT_SIGNING_KEY",
22
- "TOOL_SECRETS_KEK",
23
- "TOOL_EXECUTOR_DISPATCH_SECRET",
24
- "CLOUDFLARE_API_TOKEN",
25
- "STRIPE_SECRET_KEY",
26
- "STRIPE_WEBHOOK_SECRET",
27
- "STRIPE_IDENTITY_WEBHOOK_SECRET",
28
- "VOYAGE_API_KEY",
29
- "PERPLEXITY_API_KEY",
30
- "FRED_API_KEY",
31
- "FMP_API_KEY",
32
- "CURSOR_API_KEY"
33
- ];
34
- var FORBIDDEN_KEY_SET = new Set(FORBIDDEN_WORKER_ENV_KEYS);
35
-
36
- // src/memory-cost-package-version-guard.ts
37
- var MEMORY_COST_PACKAGE_MIN_VERSIONS = {
38
- "@kynver-app/runtime": "0.1.83",
39
- "@kynver-app/openclaw-agent-os": "0.1.43",
40
- "@kynver-app/mcp-agent-os": "0.3.34"
41
- };
42
- var MEMORY_COST_MANAGED_PACKAGES = Object.keys(
43
- MEMORY_COST_PACKAGE_MIN_VERSIONS
44
- );
45
- var DISPLAY_NAMES = {
46
- "@kynver-app/runtime": "Kynver runtime",
47
- "@kynver-app/openclaw-agent-os": "OpenClaw AgentOS plugin",
48
- "@kynver-app/mcp-agent-os": "AgentOS MCP server"
49
- };
50
- function parseSemverParts(version) {
51
- const core = version.trim().split("-")[0]?.split("+")[0];
52
- if (!core) return null;
53
- const parts = core.split(".");
54
- if (parts.length < 1 || parts.length > 3) return null;
55
- const nums = parts.map((p) => Number.parseInt(p, 10));
56
- if (nums.some((n) => !Number.isFinite(n) || n < 0)) return null;
57
- while (nums.length < 3) nums.push(0);
58
- return [nums[0], nums[1], nums[2]];
59
- }
60
- function compareSemver(a, b) {
61
- const pa = parseSemverParts(a);
62
- const pb = parseSemverParts(b);
63
- if (!pa || !pb) return 0;
64
- for (let i = 0; i < 3; i += 1) {
65
- if (pa[i] > pb[i]) return 1;
66
- if (pa[i] < pb[i]) return -1;
67
- }
68
- return 0;
69
- }
70
- function semverAtLeast(version, minimum) {
71
- return compareSemver(version, minimum) >= 0;
72
- }
73
- function maxSemver(versions) {
74
- let best = null;
75
- for (const version of versions) {
76
- if (!best || compareSemver(version, best) > 0) best = version;
77
- }
78
- return best;
79
- }
80
- function repoSourceCommands(packageName) {
81
- if (packageName === "@kynver-app/runtime") {
82
- return ["npm run kynver:build", "npm run kynver"];
83
- }
84
- return [`npm run build -w ${packageName}`];
85
- }
86
- function buildRemediation(input) {
87
- const { packageName, minimumVersion, effectiveVersion, effectiveSource, repoVersion } = input;
88
- const lines = [];
89
- if (repoVersion && semverAtLeast(repoVersion, minimumVersion)) {
90
- lines.push(
91
- `Use the monorepo checkout (${repoVersion}) instead of a stale npm install: ${repoSourceCommands(packageName).join("; ")}.`
92
- );
93
- lines.push("Do not publish npm packages or wait on an operator release.");
94
- return lines;
95
- }
96
- if (effectiveVersion) {
97
- lines.push(
98
- `Upgrade ${packageName} from ${effectiveVersion} to >= ${minimumVersion} (npm install -g ${packageName}@latest or align OpenClaw npm prefix).`
99
- );
100
- } else {
101
- lines.push(`Install ${packageName} >= ${minimumVersion} before running memory-heavy AgentOS paths.`);
102
- }
103
- if (packageName === "@kynver-app/runtime") {
104
- lines.push("Repo-source alternative: npm run kynver:build && npm run kynver");
105
- }
106
- if (effectiveSource === "installed" && repoVersion) {
107
- lines.push(`Repo checkout reports ${repoVersion}; rebuild/link repo source if you develop from the monorepo.`);
108
- }
109
- return lines;
110
- }
111
- function pickEffectiveCandidate(candidates) {
112
- if (candidates.length === 0) return { version: null, source: "unknown" };
113
- const best = maxSemver(candidates.map((candidate) => candidate.version));
114
- if (!best) return { version: null, source: "unknown" };
115
- const winner = candidates.find((candidate) => candidate.version === best) ?? candidates[0];
116
- return { version: winner.version, source: winner.source };
117
- }
118
- function evaluateMemoryCostPackageVersionGuard(input = {}) {
119
- const normalize = (value, fallbackSource) => {
120
- if (!value) return null;
121
- if (typeof value === "string") return { version: value, source: fallbackSource };
122
- return value;
123
- };
124
- const packages = MEMORY_COST_MANAGED_PACKAGES.map((packageName) => {
125
- const minimumVersion = MEMORY_COST_PACKAGE_MIN_VERSIONS[packageName];
126
- const candidates = [];
127
- const installed = normalize(input.installed?.[packageName], "installed");
128
- const repo = normalize(input.repo?.[packageName], "repo");
129
- const self = normalize(input.self?.[packageName], "self");
130
- if (installed) candidates.push(installed);
131
- if (repo) candidates.push(repo);
132
- if (self) candidates.push(self);
133
- const { version: effectiveVersion, source: effectiveSource } = pickEffectiveCandidate(candidates);
134
- const repoVersion = repo?.version ?? null;
135
- const ok2 = effectiveVersion ? semverAtLeast(effectiveVersion, minimumVersion) : false;
136
- const remediation = ok2 ? [] : buildRemediation({
137
- packageName,
138
- minimumVersion,
139
- effectiveVersion,
140
- effectiveSource,
141
- repoVersion
142
- });
143
- const summary2 = ok2 ? `${DISPLAY_NAMES[packageName]} ${effectiveVersion} meets memory-cost minimum ${minimumVersion} (${effectiveSource}).` : `${DISPLAY_NAMES[packageName]} is below memory-cost minimum ${minimumVersion}` + (effectiveVersion ? ` (effective ${effectiveVersion} via ${effectiveSource})` : " (no version detected)") + ".";
144
- return {
145
- packageName,
146
- displayName: DISPLAY_NAMES[packageName],
147
- minimumVersion,
148
- effectiveVersion,
149
- effectiveSource,
150
- ok: ok2,
151
- summary: summary2,
152
- remediation
153
- };
154
- });
155
- const violations = packages.filter((row) => !row.ok);
156
- const ok = violations.length === 0;
157
- const summary = ok ? "All managed AgentOS packages meet memory-cost minimum versions." : `Memory-cost package guard blocked ${violations.length} stale package(s): ${violations.map((row) => `${row.packageName} < ${row.minimumVersion}`).join("; ")}.`;
158
- return { ok, summary, packages };
159
- }
160
- var MemoryCostPackageVersionGuardError = class extends Error {
161
- result;
162
- constructor(result) {
163
- const lines = [
164
- result.summary,
165
- ...result.packages.filter((row) => !row.ok).flatMap((row) => [`- ${row.summary}`, ...row.remediation.map((line) => ` \u2192 ${line}`)])
166
- ];
167
- super(lines.join("\n"));
168
- this.name = "MemoryCostPackageVersionGuardError";
169
- this.result = result;
170
- }
171
- };
172
- function assertMemoryCostPackageVersionGuard(input = {}) {
173
- const result = evaluateMemoryCostPackageVersionGuard(input);
174
- if (!result.ok) throw new MemoryCostPackageVersionGuardError(result);
175
- return result;
176
- }
177
- export {
178
- MEMORY_COST_PACKAGE_MIN_VERSIONS,
179
- MemoryCostPackageVersionGuardError,
180
- assertMemoryCostPackageVersionGuard,
181
- compareSemver,
182
- evaluateMemoryCostPackageVersionGuard
183
- };
184
- //# sourceMappingURL=memory-cost.js.map
1
+ var _=["ANTHROPIC_API_KEY","ANALYST_API_KEY","RECRUITER_API_KEY","AUTH_SECRET","NEXTAUTH_SECRET","DATABASE_URL","PRODUCTION_DATABASE_URL","KYNVER_PRODUCTION_DATABASE_URL","REDIS_URL","GOOGLE_CLIENT_SECRET","GITHUB_CLIENT_SECRET","KYNVER_API_KEY","KYNVER_SERVICE_SECRET","KYNVER_RUNTIME_SECRET","KYNVER_CRON_SECRET","OPENCLAW_CRON_SECRET","QSTASH_TOKEN","QSTASH_CURRENT_SIGNING_KEY","QSTASH_NEXT_SIGNING_KEY","TOOL_SECRETS_KEK","TOOL_EXECUTOR_DISPATCH_SECRET","CLOUDFLARE_API_TOKEN","STRIPE_SECRET_KEY","STRIPE_WEBHOOK_SECRET","STRIPE_IDENTITY_WEBHOOK_SECRET","VOYAGE_API_KEY","PERPLEXITY_API_KEY","FRED_API_KEY","FMP_API_KEY","CURSOR_API_KEY"],w=new Set(_);var f={"@kynver-app/runtime":"0.1.83","@kynver-app/openclaw-agent-os":"0.1.43","@kynver-app/mcp-agent-os":"0.3.34"},P=Object.keys(f),g={"@kynver-app/runtime":"Kynver runtime","@kynver-app/openclaw-agent-os":"OpenClaw AgentOS plugin","@kynver-app/mcp-agent-os":"AgentOS MCP server"};function v(n){let e=n.trim().split("-")[0]?.split("+")[0];if(!e)return null;let o=e.split(".");if(o.length<1||o.length>3)return null;let t=o.map(s=>Number.parseInt(s,10));if(t.some(s=>!Number.isFinite(s)||s<0))return null;for(;t.length<3;)t.push(0);return[t[0],t[1],t[2]]}function y(n,e){let o=v(n),t=v(e);if(!o||!t)return 0;for(let s=0;s<3;s+=1){if(o[s]>t[s])return 1;if(o[s]<t[s])return-1}return 0}function S(n,e){return y(n,e)>=0}function M(n){let e=null;for(let o of n)(!e||y(o,e)>0)&&(e=o);return e}function b(n){return n==="@kynver-app/runtime"?["npm run kynver:build","npm run kynver"]:[`npm run build -w ${n}`]}function x(n){let{packageName:e,minimumVersion:o,effectiveVersion:t,effectiveSource:s,repoVersion:i}=n,r=[];return i&&S(i,o)?(r.push(`Use the monorepo checkout (${i}) instead of a stale npm install: ${b(e).join("; ")}.`),r.push("Do not publish npm packages or wait on an operator release."),r):(t?r.push(`Upgrade ${e} from ${t} to >= ${o} (npm install -g ${e}@latest or align OpenClaw npm prefix).`):r.push(`Install ${e} >= ${o} before running memory-heavy AgentOS paths.`),e==="@kynver-app/runtime"&&r.push("Repo-source alternative: npm run kynver:build && npm run kynver"),s==="installed"&&i&&r.push(`Repo checkout reports ${i}; rebuild/link repo source if you develop from the monorepo.`),r)}function O(n){if(n.length===0)return{version:null,source:"unknown"};let e=M(n.map(t=>t.version));if(!e)return{version:null,source:"unknown"};let o=n.find(t=>t.version===e)??n[0];return{version:o.version,source:o.source}}function R(n={}){let e=(r,a)=>r?typeof r=="string"?{version:r,source:a}:r:null,o=P.map(r=>{let a=f[r],c=[],k=e(n.installed?.[r],"installed"),m=e(n.repo?.[r],"repo"),E=e(n.self?.[r],"self");k&&c.push(k),m&&c.push(m),E&&c.push(E);let{version:u,source:l}=O(c),C=m?.version??null,d=u?S(u,a):!1,h=d?[]:x({packageName:r,minimumVersion:a,effectiveVersion:u,effectiveSource:l,repoVersion:C}),A=d?`${g[r]} ${u} meets memory-cost minimum ${a} (${l}).`:`${g[r]} is below memory-cost minimum ${a}`+(u?` (effective ${u} via ${l})`:" (no version detected)")+".";return{packageName:r,displayName:g[r],minimumVersion:a,effectiveVersion:u,effectiveSource:l,ok:d,summary:A,remediation:h}}),t=o.filter(r=>!r.ok),s=t.length===0,i=s?"All managed AgentOS packages meet memory-cost minimum versions.":`Memory-cost package guard blocked ${t.length} stale package(s): ${t.map(r=>`${r.packageName} < ${r.minimumVersion}`).join("; ")}.`;return{ok:s,summary:i,packages:o}}var p=class extends Error{result;constructor(e){let o=[e.summary,...e.packages.filter(t=>!t.ok).flatMap(t=>[`- ${t.summary}`,...t.remediation.map(s=>` \u2192 ${s}`)])];super(o.join(`
2
+ `)),this.name="MemoryCostPackageVersionGuardError",this.result=e}};function N(n={}){let e=R(n);if(!e.ok)throw new p(e);return e}export{f as MEMORY_COST_PACKAGE_MIN_VERSIONS,p as MemoryCostPackageVersionGuardError,N as assertMemoryCostPackageVersionGuard,y as compareSemver,R as evaluateMemoryCostPackageVersionGuard};