@castlemilk/omega 0.6.21 → 0.6.23

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/server/dist/index.js +3 -0
  2. package/dist/server/dist/index.js.map +1 -1
  3. package/dist/server/dist/seed-skills.d.ts +2 -0
  4. package/dist/server/dist/seed-skills.d.ts.map +1 -0
  5. package/dist/server/dist/seed-skills.js +66 -0
  6. package/dist/server/dist/seed-skills.js.map +1 -0
  7. package/dist/server/node_modules/.package-lock.json +3 -3
  8. package/dist/server/node_modules/@omega/agent/dist/planner.d.ts.map +1 -1
  9. package/dist/server/node_modules/@omega/agent/dist/planner.js +1 -1
  10. package/dist/server/node_modules/@omega/agent/dist/planner.js.map +1 -1
  11. package/dist/server/node_modules/@omega/agent/dist/prompts.d.ts.map +1 -1
  12. package/dist/server/node_modules/@omega/agent/dist/prompts.js +10 -1
  13. package/dist/server/node_modules/@omega/agent/dist/prompts.js.map +1 -1
  14. package/dist/server/node_modules/@omega/skills/dist/generate.d.ts +4 -0
  15. package/dist/server/node_modules/@omega/skills/dist/generate.d.ts.map +1 -0
  16. package/dist/server/node_modules/@omega/skills/dist/generate.js +31 -0
  17. package/dist/server/node_modules/@omega/skills/dist/generate.js.map +1 -0
  18. package/dist/server/node_modules/@omega/skills/dist/index.d.ts +4 -0
  19. package/dist/server/node_modules/@omega/skills/dist/index.d.ts.map +1 -0
  20. package/dist/server/node_modules/@omega/skills/dist/index.js +4 -0
  21. package/dist/server/node_modules/@omega/skills/dist/index.js.map +1 -0
  22. package/dist/server/node_modules/@omega/skills/dist/parse.d.ts +3 -0
  23. package/dist/server/node_modules/@omega/skills/dist/parse.d.ts.map +1 -0
  24. package/dist/server/node_modules/@omega/skills/dist/parse.js +43 -0
  25. package/dist/server/node_modules/@omega/skills/dist/parse.js.map +1 -0
  26. package/dist/server/node_modules/@omega/skills/dist/register.d.ts +3 -0
  27. package/dist/server/node_modules/@omega/skills/dist/register.d.ts.map +1 -0
  28. package/dist/server/node_modules/@omega/skills/dist/register.js +28 -0
  29. package/dist/server/node_modules/@omega/skills/dist/register.js.map +1 -0
  30. package/dist/server/node_modules/@omega/skills/package.json +18 -0
  31. package/dist/server/node_modules/@protobufjs/utf8/CHANGELOG.md +8 -0
  32. package/dist/server/node_modules/@protobufjs/utf8/index.js +29 -18
  33. package/dist/server/node_modules/@protobufjs/utf8/package.json +2 -2
  34. package/dist/server/node_modules/@protobufjs/utf8/tests/index.js +5 -0
  35. package/dist/server/skills/omega/kea-atomic-selectors/SKILL.md +50 -0
  36. package/dist/server/skills/omega-bench/SKILL.md +64 -0
  37. package/dist/server/skills/omega-harness/SKILL.md +129 -0
  38. package/package.json +3 -2
@@ -4,6 +4,7 @@ import path from 'path';
4
4
  import { fileURLToPath } from 'url';
5
5
  import { app } from './app.js';
6
6
  import { prisma, applyMigrations, seedDefaults } from '@omega/db';
7
+ import { seedSkills } from './seed-skills.js';
7
8
  import { startGrpcServer } from './grpc.js';
8
9
  // Load .env before any provider/database config is read.
9
10
  dotenvConfig();
@@ -12,9 +13,11 @@ const __dirname = path.dirname(__filename);
12
13
  const PORT = Number(process.env.PORT ?? 4000);
13
14
  const GRPC_PORT = Number(process.env.GRPC_PORT ?? 50051);
14
15
  const WEB_DIST_DIR = process.env.WEB_DIST_DIR ?? path.resolve(__dirname, '../web');
16
+ process.env.SKILLS_DIR = process.env.SKILLS_DIR ?? path.resolve(__dirname, '../skills');
15
17
  async function bootstrap() {
16
18
  await applyMigrations();
17
19
  await seedDefaults();
20
+ await seedSkills();
18
21
  app.use(express.static(WEB_DIST_DIR));
19
22
  app.get('*', (_req, res) => {
20
23
  res.sendFile(path.join(WEB_DIST_DIR, 'index.html'));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,OAA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AY,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACnF,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAExF,KAAK,UAAU,SAAS;IACtB,MAAM,eAAe,EAAE,CAAC;IACxB,MAAM,YAAY,EAAE,CAAC;IACrB,MAAM,UAAU,EAAE,CAAC;IAEnB,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACtC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACzB,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACpB,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACjC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function seedSkills(): Promise<void>;
2
+ //# sourceMappingURL=seed-skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seed-skills.d.ts","sourceRoot":"","sources":["../src/seed-skills.ts"],"names":[],"mappings":"AA6BA,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAkChD"}
@@ -0,0 +1,66 @@
1
+ import { readdir, readFile, stat } from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { parseSkill } from '@omega/skills';
4
+ import { prisma } from '@omega/db';
5
+ async function exists(filePath) {
6
+ try {
7
+ await stat(filePath);
8
+ return true;
9
+ }
10
+ catch {
11
+ return false;
12
+ }
13
+ }
14
+ async function findSkillFiles(dir) {
15
+ const files = [];
16
+ if (!(await exists(dir)))
17
+ return files;
18
+ const entries = await readdir(dir, { withFileTypes: true }).catch(() => []);
19
+ for (const entry of entries) {
20
+ const fullPath = path.join(dir, entry.name);
21
+ if (entry.isDirectory()) {
22
+ files.push(...(await findSkillFiles(fullPath)));
23
+ }
24
+ else if (entry.isFile() && entry.name.toLowerCase() === 'skill.md') {
25
+ files.push(fullPath);
26
+ }
27
+ }
28
+ return files;
29
+ }
30
+ export async function seedSkills() {
31
+ const skillsDir = process.env.SKILLS_DIR ?? path.resolve(process.cwd(), '.agents/skills');
32
+ if (!(await exists(skillsDir))) {
33
+ console.log(`Skills directory not found at ${skillsDir}, skipping skill seed.`);
34
+ return;
35
+ }
36
+ const files = await findSkillFiles(skillsDir);
37
+ let seeded = 0;
38
+ for (const file of files) {
39
+ try {
40
+ const source = await readFile(file, 'utf-8');
41
+ const manifest = parseSkill(source);
42
+ const name = manifest.name;
43
+ await prisma.skillArtifact.upsert({
44
+ where: { name },
45
+ update: {
46
+ sourcePath: file,
47
+ generatedPath: file,
48
+ manifest: JSON.stringify(manifest),
49
+ },
50
+ create: {
51
+ name,
52
+ sourcePath: file,
53
+ generatedPath: file,
54
+ manifest: JSON.stringify(manifest),
55
+ },
56
+ });
57
+ seeded++;
58
+ }
59
+ catch (err) {
60
+ const message = err instanceof Error ? err.message : String(err);
61
+ console.warn(`Failed to seed skill from ${file}:`, message);
62
+ }
63
+ }
64
+ console.log(`Seeded ${seeded.toString()} skills from ${skillsDir}.`);
65
+ }
66
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AG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,6BAA6B,IAAI,GAAG,EAAE,OAAO,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,QAAQ,EAAE,gBAAgB,SAAS,GAAG,CAAC,CAAC;AACvE,CAAC"}
@@ -134,9 +134,9 @@
134
134
  "license": "BSD-3-Clause"
135
135
  },
136
136
  "node_modules/@protobufjs/utf8": {
137
- "version": "1.1.1",
138
- "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz",
139
- "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==",
137
+ "version": "1.1.2",
138
+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.2.tgz",
139
+ "integrity": "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==",
140
140
  "license": "BSD-3-Clause"
141
141
  },
142
142
  "node_modules/@types/node": {
@@ -1 +1 @@
1
- {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../src/planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAGzE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAkBD,eAAO,MAAM,WAAW,QAeoW,CAAC;AAE7X,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAC/B,OAAO,CAAC,aAAa,CAAC,CAmCxB"}
1
+ {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../src/planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAGzE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAkBD,eAAO,MAAM,WAAW,QAeyoB,CAAC;AAElqB,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAC/B,OAAO,CAAC,aAAa,CAAC,CAmCxB"}
@@ -26,7 +26,7 @@ ${toolDescriptions}
26
26
 
27
27
  If a step does not need a tool, omit tool/input. Use edit_file for small file changes. When planning run_command steps, use only simple single commands without pipes (|), &&, ;, redirects, unquoted globs, or $(). Quote literal globs in arguments if needed, e.g., find . -name "*.ts".
28
28
 
29
- When the task involves a test suite or failing tests, the first steps must be: (1) run the focused test command to identify failures, (2) read the failing test files, and only then (3) implement the smallest fix. For Kea/signal/selector tasks, explicitly plan to read the selector tests and verify the selector signature, dependencies, and memoization before editing source code.`;
29
+ When the task involves a test suite or failing tests, the first steps must be: (1) run the focused test command to identify failures, (2) read the failing test files, and only then (3) implement the smallest fix. For Kea / signal / selector tasks, the plan must include explicit steps to: (a) read the relevant selector tests, (b) implement the exact selector signature and memoization, (c) wire the feature into the existing framework by modifying src/kea/build.ts, src/core/selectors.ts, src/kea/context.ts, and src/index.ts as needed, and (d) verify the public API surface with verify_api_surface before finishing. Do not finish until the wiring is complete and tested.`;
30
30
  export async function createPlan(provider, taskTitle, taskDescription, context, onUsage) {
31
31
  const contextBlock = context ? `\n\nProject context:\n${context}` : '';
32
32
  const prompt = `${PLAN_PROMPT}${contextBlock}\n\nTask: ${taskTitle}\n${taskDescription ? `Description: ${taskDescription}\n` : ''}`;
@@ -1 +1 @@
1
- {"version":3,"file":"planner.js","sourceRoot":"","sources":["../src/planner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAapD,MAAM,cAAc,GAAqB;IACvC;QACE,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,4BAA4B;QACzC,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YAC3C,QAAQ,EAAE,CAAC,SAAS,CAAC;SACtB;KACF;CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,CACtC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CACvC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;EAWzB,gBAAgB;;;;4XAI0W,CAAC;AAE7X,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,QAAkB,EAClB,SAAiB,EACjB,eAAwB,EACxB,OAAgB,EAChB,OAAgC;IAEhC,MAAM,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,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,QAwDoI,CAAC;AAErK,eAAO,MAAM,mBAAmB,8UAA8U,CAAC;AAE/W,eAAO,MAAM,wBAAwB,QAkD+H,CAAC;AAErK,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGnE;AA2BD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAW3E;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7C,OAAO,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GAChD,MAAM,CAMR;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7C,YAAY,EAAE,MAAM,GACnB,MAAM,CAWR"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,QAiEoI,CAAC;AAErK,eAAO,MAAM,mBAAmB,8UAA8U,CAAC;AAE/W,eAAO,MAAM,wBAAwB,QAkD+H,CAAC;AAErK,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGnE;AA2BD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAW3E;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7C,OAAO,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GAChD,MAAM,CAMR;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7C,YAAY,EAAE,MAAM,GACnB,MAAM,CAWR"}
@@ -50,8 +50,17 @@ Rules:
50
50
  13. Finish only when the task is done. Always include summary and success.
51
51
  14. VERIFY FIRST: For any task that includes or references a test suite, run the focused test command first, read the failing tests, and base your implementation on the exact expected behaviour. Do not edit source code before observing test failures.
52
52
  15. For Kea / signal / selector tasks, always read the relevant test files first, implement the exact selector signature, dependencies, and memoization semantics, and run the test suite after each change. When a selector depends on another selector, ensure you import and reference the dependency selector directly (not its string name), preserve the exact function signature including argument order and default values, and keep the return value stable (memoized) for identical inputs. Verify that the returned selector object has the expected shape and works as both a standalone function and a Kea dependency. Run the project's test command (e.g. pnpm test) after every source edit, read the first failing test carefully, and fix the implementation before editing unrelated code.
53
+ 16. INTEGRATION RULE: If the task adds a new engine, feature, or public API to an existing framework/library, do not leave it in a standalone file. After implementing the new code, identify and modify the existing entry point, builder/initializer, and any relevant plugin registration files to wire the feature in. For Kea tasks specifically: attach new methods (e.g. logic.selectorHealth) to the BuiltLogic instance in src/kea/build.ts or via the selectors plugin in src/core/selectors.ts, export public helpers from src/index.ts when appropriate, and ensure resetContext options are read in src/kea/context.ts. Then run the framework's tests and verify the public API surface with concrete calls.
54
+ 17. KEA ATOMIC-SELECTOR CHECKLIST: When the task or injected skills mention "atomic selectors", "signal selectors", or "selectorHealth", produce a plan whose first non-exploratory steps include this exact checklist, then execute it in order:
55
+ a. Read the atomic-selector test files and any injected skill docs to learn the expected selector signature, selectorHealth return shape, and dependency paths (e.g. leaf-level paths like user.name, not just user).
56
+ b. Read src/kea/context.ts and add an atomicSelectors option to resetContext (default false). Store it on the context/options object.
57
+ c. Read src/core/selectors.ts and hook the atomic engine into selector creation so dependencies, evaluations, and dependents are recorded only when atomicSelectors is enabled.
58
+ d. Read src/kea/build.ts and attach logic.selectorHealth as a method on BuiltLogic instances that returns health metadata for every selector in this logic.
59
+ e. Read src/index.ts and export any public helpers/types needed by consumers (e.g., AtomicSelectorHealth, AtomicSelectorEngine).
60
+ f. Run the relevant tests and fix failures, then verify the API surface with verify_api_surface using a check that mounts a logic and tests typeof logic.selectorHealth === 'function'. Do not finish until this check passes.
61
+ 18. Before calling finish, the final verification step must use verify_api_surface with a concrete runtime check for each public API named in the task. For instance APIs, the check must construct the object and return typeof instance.theMethod === 'function'. If the task requires logic.selectorHealth, the check must mount a logic and test typeof logic.selectorHealth === 'function'. If verify_api_surface fails, diagnose the root cause and wire the missing API before finishing.
53
62
 
54
- ANTI-LOOP RULES (violation wastes steps and causes failure):
63
+ ANTI-LOOP RULES (violation wastes steps and failure):
55
64
  - You are already in the project root on a dedicated branch in a fresh worktree. Do NOT run git status, git branch, git log, pwd, ls -la, or find more than once total in the entire session. Use list_files for exploration.
56
65
  - Do NOT repeat a command or read the same file that already produced output in this session. If you need the same information, remember it from the previous output.
57
66
  - After your first think step, you have at most 20 exploration steps (read_file, list_files, run_command) combined. Then you MUST make an edit_file or write_file call.
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,SAAS,iBAAiB,CAAC,GAAW;IACpC,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,M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AI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5E,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,OAAO;SAC3D,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;SAC5C,IAAI,CAAC,MAAM,CAAC,mCAAmC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,IAA6C,EAC7C,YAAoB;IAEpB,MAAM,KAAK,GAAG;QACZ,SAAS,IAAI,CAAC,KAAK,EAAE;QACrB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;QAC1D,EAAE;QACF,ijBAAijB;QACjjB,EAAE;QACF,uBAAuB;QACvB,YAAY;KACb,CAAC;IACF,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SkillManifest } from '@omega/core';
2
+ export declare function toClassName(name: string): string;
3
+ export declare function generateAdapter(manifest: SkillManifest): string;
4
+ //# sourceMappingURL=generate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAehD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAgB/D"}
@@ -0,0 +1,31 @@
1
+ export function toClassName(name) {
2
+ const normalized = name
3
+ .replace(/[^a-zA-Z0-9]+/g, ' ')
4
+ .trim()
5
+ .split(' ')
6
+ .filter(Boolean)
7
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
8
+ .join('');
9
+ let className = normalized || 'Skill';
10
+ if (/^[0-9]/.test(className)) {
11
+ className = `_${className}`;
12
+ }
13
+ return className;
14
+ }
15
+ export function generateAdapter(manifest) {
16
+ const className = toClassName(manifest.name);
17
+ const instructionsLiteral = JSON.stringify(manifest.instructions);
18
+ const descriptionLiteral = JSON.stringify(manifest.description);
19
+ return `import type { Provider } from '@omega/core';
20
+
21
+ export class ${className} {
22
+ constructor(private readonly provider: Provider) {}
23
+
24
+ async execute(args: Record<string, unknown>): Promise<string> {
25
+ const prompt = ${instructionsLiteral} + '\\n\\nArgs:\\n' + JSON.stringify(args, null, 2);
26
+ return this.provider.send(prompt, { system: ${descriptionLiteral} });
27
+ }
28
+ }
29
+ `;
30
+ }
31
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,UAAU,GAAG,IAAI;SACpB,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC;SAC9B,IAAI,EAAE;SACN,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,EAAE,CAAC,CAAC;IAEZ,IAAI,SAAS,GAAG,UAAU,IAAI,OAAO,CAAC;IACtC,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAC9B,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAuB;IACrD,MAAM,SAAS,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAClE,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEhE,OAAO;;eAEM,SAAS;;;;qBAIH,mBAAmB;kDACU,kBAAkB;;;CAGnE,CAAC;AACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './parse.js';
2
+ export * from './generate.js';
3
+ export * from './register.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './parse.js';
2
+ export * from './generate.js';
3
+ export * from './register.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { SkillManifest } from '@omega/core';
2
+ export declare function parseSkill(md: string): SkillManifest;
3
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAY,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3D,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,CAgDpD"}
@@ -0,0 +1,43 @@
1
+ import matter from 'gray-matter';
2
+ import YAML from 'yaml';
3
+ export function parseSkill(md) {
4
+ const parsed = matter(md);
5
+ const frontmatter = YAML.parse(parsed.matter || '{}');
6
+ if (typeof frontmatter.name !== 'string' || frontmatter.name.trim() === '') {
7
+ throw new Error('SKILL.md frontmatter must include a non-empty "name" string');
8
+ }
9
+ if (typeof frontmatter.description !== 'string' || frontmatter.description.trim() === '') {
10
+ throw new Error('SKILL.md frontmatter must include a non-empty "description" string');
11
+ }
12
+ let args = [];
13
+ if ('args' in frontmatter) {
14
+ if (!Array.isArray(frontmatter.args)) {
15
+ throw new Error('SKILL.md frontmatter "args" must be an array');
16
+ }
17
+ args = frontmatter.args.map((entry, index) => {
18
+ if (typeof entry !== 'object' || entry === null) {
19
+ throw new Error(`SKILL.md arg at index ${index.toString()} must be an object`);
20
+ }
21
+ const arg = entry;
22
+ if (typeof arg.name !== 'string' || arg.name.trim() === '') {
23
+ throw new Error(`SKILL.md arg at index ${index.toString()} must have a non-empty "name"`);
24
+ }
25
+ if (typeof arg.type !== 'string' || arg.type.trim() === '') {
26
+ throw new Error(`SKILL.md arg at index ${index.toString()} must have a non-empty "type"`);
27
+ }
28
+ return {
29
+ name: arg.name.trim(),
30
+ type: arg.type.trim(),
31
+ required: typeof arg.required === 'boolean' ? arg.required : true,
32
+ description: typeof arg.description === 'string' ? arg.description : undefined,
33
+ };
34
+ });
35
+ }
36
+ return {
37
+ name: frontmatter.name.trim(),
38
+ description: frontmatter.description.trim(),
39
+ args,
40
+ instructions: parsed.content.trim(),
41
+ };
42
+ }
43
+ //# sourceMappingURL=parse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,UAAU,UAAU,CAAC,EAAU;IACnC,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1B,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAA4B,CAAC;IAEjF,IAAI,OAAO,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,CAAC,QAAQ,EAAE,+BAA+B,CAAC,CAAC;YAC5F,CAAC;YAED,OAAO;gBACL,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;gBACrB,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;gBACrB,QAAQ,EAAE,OAAO,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;gBACjE,WAAW,EAAE,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;aAC/E,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE;QAC7B,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE;QAC3C,IAAI;QACJ,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { SkillManifest } from '@omega/core';
2
+ export declare function registerSkill(sourcePath: string, outputDir: string): Promise<SkillManifest>;
3
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,CAAC,CA4BxB"}
@@ -0,0 +1,28 @@
1
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ import { generateAdapter, toClassName } from './generate.js';
4
+ import { parseSkill } from './parse.js';
5
+ export async function registerSkill(sourcePath, outputDir) {
6
+ const source = await readFile(sourcePath, 'utf-8');
7
+ const manifest = parseSkill(source);
8
+ const generatedDir = join(outputDir, 'generated');
9
+ await mkdir(generatedDir, { recursive: true });
10
+ const className = toClassName(manifest.name);
11
+ const fileName = `${className}.ts`;
12
+ const filePath = join(generatedDir, fileName);
13
+ await writeFile(filePath, generateAdapter(manifest), 'utf-8');
14
+ const indexPath = join(generatedDir, 'index.ts');
15
+ const exportLine = `export * from './${className}.js';\n`;
16
+ let indexContent = '';
17
+ try {
18
+ indexContent = await readFile(indexPath, 'utf-8');
19
+ }
20
+ catch {
21
+ // Index file does not exist yet.
22
+ }
23
+ if (!indexContent.includes(exportLine)) {
24
+ await writeFile(indexPath, indexContent + exportLine, 'utf-8');
25
+ }
26
+ return manifest;
27
+ }
28
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,UAAkB,EAClB,SAAiB;IAEjB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAEpC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAClD,MAAM,KAAK,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE/C,MAAM,SAAS,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,GAAG,SAAS,KAAK,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAE9C,MAAM,SAAS,CAAC,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IAE9D,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,oBAAoB,SAAS,SAAS,CAAC;IAE1D,IAAI,YAAY,GAAG,EAAE,CAAC;IACtB,IAAI,CAAC;QACH,YAAY,GAAG,MAAM,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,iCAAiC;IACnC,CAAC;IAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACvC,MAAM,SAAS,CAAC,SAAS,EAAE,YAAY,GAAG,UAAU,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@omega/skills",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "dependencies": {
14
+ "@omega/core": "*",
15
+ "gray-matter": "^4.0.3",
16
+ "yaml": "^2.4.0"
17
+ }
18
+ }
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ ## [1.1.2](https://github.com/protobufjs/protobuf.js/compare/utf8-v1.1.1...utf8-v1.1.2) (2026-07-05)
4
+
5
+
6
+ ### Performance Improvements
7
+
8
+ * Batch String.fromCharCode in @protobufjs/utf8 read ([#2355](https://github.com/protobufjs/protobuf.js/issues/2355)) ([d1ae3ce](https://github.com/protobufjs/protobuf.js/commit/d1ae3ce46370254ada0f3db689506a9139c8d1ee))
@@ -6,7 +6,7 @@
6
6
  * @namespace
7
7
  */
8
8
  var utf8 = exports,
9
- replacementChar = "\ufffd";
9
+ replacementCharCode = 0xFFFD; // U+FFFD REPLACEMENT CHARACTER
10
10
 
11
11
  /**
12
12
  * Calculates the UTF8 byte length of a string.
@@ -39,34 +39,45 @@ utf8.length = function utf8_length(string) {
39
39
  * @returns {string} String read
40
40
  */
41
41
  utf8.read = function utf8_read(buffer, start, end) {
42
- if (end - start < 1) {
42
+ if (end - start < 1)
43
43
  return "";
44
- }
45
-
46
- var str = "";
47
- for (var i = start; i < end;) {
48
- var t = buffer[i++];
44
+ // Batch code units and flush via String.fromCharCode.apply in 8192-unit
45
+ // chunks to avoid the per-character ConsString buildup of `str += ...`.
46
+ var parts = null,
47
+ chunk = [],
48
+ i = 0, // chunk write index
49
+ t, t2, c2, c3;
50
+ while (start < end) {
51
+ t = buffer[start++];
49
52
  if (t <= 0x7F) {
50
- str += String.fromCharCode(t);
53
+ chunk[i++] = t;
51
54
  } else if (t >= 0xC0 && t < 0xE0) {
52
- var c2 = (t & 0x1F) << 6 | buffer[i++] & 0x3F;
53
- str += c2 >= 0x80 ? String.fromCharCode(c2) : replacementChar;
55
+ c2 = (t & 0x1F) << 6 | buffer[start++] & 0x3F;
56
+ chunk[i++] = c2 >= 0x80 ? c2 : replacementCharCode;
54
57
  } else if (t >= 0xE0 && t < 0xF0) {
55
- var c3 = (t & 0xF) << 12 | (buffer[i++] & 0x3F) << 6 | buffer[i++] & 0x3F;
56
- str += c3 >= 0x800 ? String.fromCharCode(c3) : replacementChar;
58
+ c3 = (t & 0xF) << 12 | (buffer[start++] & 0x3F) << 6 | buffer[start++] & 0x3F;
59
+ chunk[i++] = c3 >= 0x800 ? c3 : replacementCharCode;
57
60
  } else if (t >= 0xF0) {
58
- var t2 = (t & 7) << 18 | (buffer[i++] & 0x3F) << 12 | (buffer[i++] & 0x3F) << 6 | buffer[i++] & 0x3F;
61
+ t2 = (t & 7) << 18 | (buffer[start++] & 0x3F) << 12 | (buffer[start++] & 0x3F) << 6 | buffer[start++] & 0x3F;
59
62
  if (t2 < 0x10000 || t2 > 0x10FFFF)
60
- str += replacementChar;
63
+ chunk[i++] = replacementCharCode;
61
64
  else {
62
65
  t2 -= 0x10000;
63
- str += String.fromCharCode(0xD800 + (t2 >> 10));
64
- str += String.fromCharCode(0xDC00 + (t2 & 0x3FF));
66
+ chunk[i++] = 0xD800 + (t2 >> 10);
67
+ chunk[i++] = 0xDC00 + (t2 & 0x3FF);
65
68
  }
66
69
  }
70
+ if (i > 8191) {
71
+ (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk.slice(0, i)));
72
+ i = 0;
73
+ }
67
74
  }
68
-
69
- return str;
75
+ if (parts) {
76
+ if (i)
77
+ parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
78
+ return parts.join("");
79
+ }
80
+ return String.fromCharCode.apply(String, chunk.slice(0, i));
70
81
  };
71
82
 
72
83
  /**
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@protobufjs/utf8",
3
3
  "description": "A minimal UTF8 implementation for number arrays.",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/dcodeIO/protobuf.js.git"
8
+ "url": "https://github.com/protobufjs/protobuf.js.git"
9
9
  },
10
10
  "license": "BSD-3-Clause",
11
11
  "main": "index.js",
@@ -47,6 +47,11 @@ tape.test("utf8", function(test) {
47
47
  test.equal(comp, "\ufffd", "should decode overlong UTF-8 sequences as replacement characters");
48
48
  });
49
49
 
50
+ var longMultibyteStr = "\u20ac\u00df\u7a7a\u03bb\ud835\udd4f".repeat(20000); // 3-byte, 2-byte and surrogate-pair code points
51
+ var longMultibyte = Buffer.from(longMultibyteStr, "utf8");
52
+ comp = utf8.read(longMultibyte, 0, longMultibyte.length);
53
+ test.equal(comp, longMultibyteStr, "should decode a large multibyte string spanning many flush boundaries");
54
+
50
55
  test.end();
51
56
  });
52
57
 
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: kea-atomic-selectors
3
+ description: TypeScript Kea framework - adding atomic signal selectors and logic.selectorHealth
4
+ args: []
5
+ ---
6
+
7
+ # Kea Atomic Selector Integration Guide
8
+
9
+ When a task asks you to add atomic/signal selectors to Kea, the implementation is not complete until you modify the existing Kea source files to wire the feature in. Do not leave the code in standalone files.
10
+
11
+ ## Files you MUST modify
12
+
13
+ 1. `src/kea/build.ts`
14
+ - The `BuiltLogic` object is constructed in `getBuiltLogic()` around lines 88-119.
15
+ - After the basic methods (`mount`, `unmount`, `isMounted`) are attached, attach `selectorHealth`.
16
+ - `selectorHealth` must be a method on the logic instance that returns health metadata for every selector in this logic.
17
+
18
+ 2. `src/core/selectors.ts`
19
+ - This is where Kea selectors are registered and built.
20
+ - If implementing atomic tracking, hook into selector creation so that dependencies, evaluations, and dependents are recorded.
21
+ - Import and use your atomic engine here or in `src/kea/build.ts`.
22
+
23
+ 3. `src/kea/context.ts`
24
+ - Read the `atomicSelectors` option from `resetContext({ atomicSelectors: true })`.
25
+ - Store it on the context/options so that `src/kea/build.ts` and `src/core/selectors.ts` can decide whether to enable atomic tracking.
26
+
27
+ 4. `src/index.ts`
28
+ - Export any public helpers/types needed by consumers (e.g., `AtomicSelectorHealth`, `AtomicSelectorEngine`).
29
+
30
+ ## Wiring checklist
31
+
32
+ - [ ] `logic.selectorHealth()` exists on mounted BuiltLogic instances.
33
+ - [ ] `logic.selectorHealth()` returns `{ selectors: Record<name, { dependencies, dependents, evaluations, dirtyCause }>, topologicalOrder: string[] }`.
34
+ - [ ] Dependencies are leaf-level paths like `user.name`, not just `user`.
35
+ - [ ] The engine is only active when `resetContext({ atomicSelectors: true })` was used.
36
+ - [ ] Existing Kea tests still pass.
37
+ - [ ] New atomic selector tests pass.
38
+
39
+ ## Verification
40
+
41
+ Before finishing, run the test command and also run a quick runtime check:
42
+
43
+ ```js
44
+ const { kea } = require('./src/index.ts') // or built output
45
+ const logic = kea({ selectors: { userName: [(s) => s.user, (u) => u.name]] } })
46
+ logic.mount()
47
+ console.log(typeof logic.selectorHealth) // must be 'function'
48
+ ```
49
+
50
+ If `logic.selectorHealth` is `undefined`, you have not wired it into `src/kea/build.ts`. Fix that before finishing.
@@ -0,0 +1,64 @@
1
+ # omega-bench
2
+
3
+ Run Omega harness benchmarks, process reports, and drive self-improvement loops.
4
+
5
+ ## When to use
6
+
7
+ Use this skill when the user asks to:
8
+ - Run the Omega e2e test suite or harness
9
+ - Run a benchmark (synthetic, DeepSWE, or custom)
10
+ - Process a benchmark report, traces, or metrics
11
+ - Create a self-improve task from a failed benchmark
12
+ - Iterate on prompts using benchmark results
13
+
14
+ ## Workflow
15
+
16
+ 1. Ensure the harness server is running on the configured port (default 4000).
17
+ - If not, start it with no timeout so long benchmarks don't kill it:
18
+ `PORT=4000 GRPC_PORT=50051 DATABASE_URL=postgresql://localhost:5432/omega DATABASE_DIR=./pglite-data node apps/server/dist/index.js`
19
+ - When launching as a background task, pass `disable_timeout=true`.
20
+ 2. Run the requested benchmark with a timeout long enough for the agent to finish and commit:
21
+ - Synthetic 30-task suite: `npx @castlemilk/omega bench run --suite synthetic`
22
+ - DeepSWE single task (Kea): `pnpm bench:deepswe`
23
+ - DeepSWE 30-task suite: `pnpm bench:deepswe:30`
24
+ - DeepSWE subset: `npx @castlemilk/omega bench run --suite deep-swe --path ./deep-swe/tasks --n-tasks 10 --timeout 1800000 --provider kimi --model kimi-for-coding --docker`
25
+ - Self-improve loop: `npx @castlemilk/omega bench loop --suite synthetic --iterations 3`
26
+ 3. Wait for completion and collect the report from `.omega/reports/`.
27
+ 4. Inspect failures by reading the report JSON and, if needed, the trace flow via the web UI or API `/tasks/:id/trace-flow`.
28
+ 5. For each failure, identify whether it is a prompt issue, an executor bug, or a benchmark task issue.
29
+ 6. Create a targeted fix, run `pnpm lint` and `pnpm test`, then rebuild and publish the bundle.
30
+ 7. Re-run the failing task or full suite to verify the fix.
31
+ 8. Summarize the pass rate, duration, and any changes made.
32
+
33
+ ## Commands reference
34
+
35
+ - `pnpm test` — unit and e2e tests
36
+ - `pnpm lint` — ESLint 9
37
+ - `pnpm --filter @omega/agent build && pnpm --filter @omega/cli build` — rebuild changed packages
38
+ - `cd packages/bundle && pnpm build && npm publish --access public` — publish update
39
+ - `npx @castlemilk/omega --version` — verify published installable version
40
+ - `npx @castlemilk/omega bench run --suite synthetic` — full synthetic benchmark
41
+ - `npx @castlemilk/omega bench loop --suite synthetic --iterations 3` — self-improve loop
42
+ - `npx @castlemilk/omega bench optimise` — create self-improve task from latest report
43
+
44
+ ## Report analysis
45
+
46
+ A benchmark report is JSON with:
47
+ - `total`, `passed`, `failed`, `timeouts`
48
+ - `totalDurationMs`
49
+ - `results`: array of `{ task, harnessTaskId, durationMs, status, evaluation, agentRun, spanCount }`
50
+
51
+ For each failed result:
52
+ - Read `agentRun.validationSummary` to see which validation step failed.
53
+ - Read `agentRun.resultStatus` and task traces to see the agent reasoning.
54
+ - For DeepSWE tasks, read `evaluation.metrics` for `f2p_passed`, `p2p_passed`, `partial`, and `verifier_logs`.
55
+ - Look for common failure classes: wrong file path, wrong export name, missing edge-case guard, premature finish, validation not retried.
56
+
57
+ ## Publishing updates
58
+
59
+ Before publishing:
60
+ 1. Bump `packages/bundle/package.json` version.
61
+ 2. Ensure `~/.npmrc` has the npm auth token for `@castlemilk`.
62
+ 3. Run `pnpm lint` and `pnpm test`.
63
+ 4. Publish from `packages/bundle`.
64
+ 5. Verify with `npx @castlemilk/omega --version`.
@@ -0,0 +1,129 @@
1
+ # Omega Harness Skill
2
+
3
+ This skill defines the process for running, validating, tracing and continuously improving the Omega harness.
4
+
5
+ ## What it is
6
+
7
+ Omega is a multi-project task harness. It can:
8
+
9
+ - Register projects (directories/repos).
10
+ - Schedule work across them.
11
+ - Route tasks to LLM providers based on capability (simple/medium/complex).
12
+ - Track tasks, steps, traces and diffs in an embedded PGlite database.
13
+ - Expose a web UI, a TUI console and a gRPC task-ingestion API.
14
+
15
+ ## Install / run
16
+
17
+ ```bash
18
+ # Run the published package from anywhere (current release: 0.6.9)
19
+ npx @castlemilk/omega ui
20
+
21
+ # Or run from source
22
+ pnpm install
23
+ pnpm dev
24
+ ```
25
+
26
+ In the TUI:
27
+
28
+ - `q` / `esc` quit
29
+ - `t` collapse/expand the task list
30
+ - `s` toggle sidebar layout
31
+
32
+ ## Run the E2E suite and generate a report
33
+
34
+ ```bash
35
+ node scripts/run-e2e-report.mjs
36
+ ```
37
+
38
+ This runs `pnpm --filter @omega/e2e test`, writes raw Vitest JSON to `.omega/reports/e2e-raw-<ts>.json` and a Markdown summary to `.omega/reports/e2e-report-<ts>.md`.
39
+
40
+ ## Run performance benchmarks
41
+
42
+ ```bash
43
+ node scripts/run-benchmarks.mjs
44
+ ```
45
+
46
+ This starts a temporary harness server + mock Kimi LLM, measures HTTP task creation, gRPC task submission and end-to-end task-run latency, then writes `.omega/reports/benchmark-<ts>.json`.
47
+
48
+ ## Process traces
49
+
50
+ Each task records:
51
+
52
+ - **Steps** — `GET /tasks/:id/steps`
53
+ - **Traces** — `GET /tasks/:id/traces` (model inputs/outputs/reasoning)
54
+ - **Diffs** — `GET /tasks/:id/diffs` (code changes made by the agent)
55
+ - **Agent run** — `GET /tasks/:id/agent-run`
56
+
57
+ When reviewing an agent task, always fetch these four endpoints and summarise:
58
+
59
+ 1. What was the plan?
60
+ 2. What files changed?
61
+ 3. What validation was run?
62
+ 4. Did it pass or fail, and why?
63
+
64
+ ## Self-improvement loop
65
+
66
+ The loop submits tasks back into the harness, lets the agent improve the codebase, captures traces/diffs, and validates with E2E + benchmarks.
67
+
68
+ ### Start the harness server first
69
+
70
+ ```bash
71
+ # Uses the Kimi provider from .env if KIMI_API_KEY is set
72
+ npx @castlemilk/omega ui --no-tui
73
+ ```
74
+
75
+ ### Run one controlled iteration
76
+
77
+ ```bash
78
+ OMEGA_LOOP_MAX_ITERATIONS=1 OMEGA_LOOP_AUTO_PUBLISH=false node scripts/omega-loop.mjs
79
+ ```
80
+
81
+ ### Run continuously (default)
82
+
83
+ ```bash
84
+ # Review the config defaults first
85
+ OMEGA_LOOP_MAX_ITERATIONS=5 \
86
+ OMEGA_LOOP_INTERVAL_MS=120000 \
87
+ OMEGA_LOOP_AUTO_PUBLISH=false \
88
+ node scripts/omega-loop.mjs
89
+ ```
90
+
91
+ ### Loop configuration
92
+
93
+ | Variable | Default | Purpose |
94
+ |---|---|---|
95
+ | `OMEGA_LOOP_API_URL` | `http://localhost:4000` | Harness API endpoint |
96
+ | `OMEGA_LOOP_PROJECT_ID` | (created automatically) | Project to attach tasks to |
97
+ | `OMEGA_LOOP_PROMPT` | Review codebase, run lint/e2e, implement best improvement | Task description sent to the agent |
98
+ | `OMEGA_LOOP_MAX_ITERATIONS` | `3` | Hard stop after N iterations |
99
+ | `OMEGA_LOOP_INTERVAL_MS` | `60000` | Wait time between iterations |
100
+ | `OMEGA_LOOP_AUTO_PUBLISH` | `false` | Allow the agent to publish a new npm version |
101
+ | `OMEGA_LOOP_VALIDATE` | `true` | Run E2E report + benchmarks after each task |
102
+ | `OMEGA_LOOP_MAX_CONSECUTIVE_FAILURES` | `2` | Stop if this many iterations fail in a row |
103
+
104
+ ### Outputs
105
+
106
+ - Iteration reports: `.omega/iterations/iteration-<n>-<ts>.md`
107
+ - E2E reports: `.omega/reports/e2e-report-<ts>.md`
108
+ - Benchmark reports: `.omega/reports/benchmark-<ts>.json`
109
+
110
+ ### Safety guardrails
111
+
112
+ - The loop only publishes when `OMEGA_LOOP_AUTO_PUBLISH=true` AND the task is tagged with `publish` (the loop adds the tag automatically when enabled).
113
+ - The loop stops after `OMEGA_LOOP_MAX_ITERATIONS`.
114
+ - The loop stops after `OMEGA_LOOP_MAX_CONSECUTIVE_FAILURES` consecutive failures.
115
+ - The agent commits changes to a branch named `agent/<task-id>`, not directly to the current branch.
116
+ - Always review `.omega/iterations/` before enabling auto-publish or merging a branch.
117
+
118
+ ## How the agent improves the harness
119
+
120
+ Tasks tagged with `self-improve` are routed to `packages/agent/src/executor.ts`, which:
121
+
122
+ 1. Selects a provider using `packages/router`.
123
+ 2. Creates a plan.
124
+ 3. Uses tools (`read_file`, `write_file`, `edit_file`, `run_command`, `think`, `finish`, optionally `publish`).
125
+ 4. Records every turn in `taskTrace`.
126
+ 5. Captures the diff in `taskDiff`.
127
+ 6. Commits to `agent/<task-id>`.
128
+
129
+ When processing a self-improvement result, follow the trace → diff → validation order from the audit rubric.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@castlemilk/omega",
3
- "version": "0.6.21",
3
+ "version": "0.6.23",
4
4
  "description": "Omega Harness CLI - installable via npx",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",
@@ -15,10 +15,11 @@
15
15
  "build:cli": "esbuild ../../apps/cli/src/index.ts --bundle --platform=node --format=esm --outfile=dist/cli.js --external:commander --external:open --external:gray-matter --external:yaml --external:ink --external:react --external:@grpc/grpc-js --external:@grpc/proto-loader --alias:@omega/core=../../packages/core/src/index.ts --alias:@omega/skills=../../packages/skills/src/index.ts",
16
16
  "copy:web": "rm -rf dist/web && cp -R ../../apps/web/dist dist/web",
17
17
  "copy:web:server": "rm -rf dist/server/web && cp -R ../../apps/web/dist dist/server/web",
18
+ "copy:skills": "rm -rf dist/server/skills && cp -R ../../.agents/skills dist/server/skills",
18
19
  "copy:proto": "mkdir -p dist/proto && cp ../../proto/tasks.proto dist/proto/tasks.proto",
19
20
  "clean:server:data": "rm -rf dist/server/pglite-data",
20
21
  "build:server:real": "pnpm --filter @omega/server build && rm -rf dist/server && pnpm --filter @omega/server deploy --prod dist/server && node scripts/materialize-server.mjs && pnpm clean:server:data",
21
- "build": "pnpm build:cli && pnpm build:server:real && pnpm copy:web && pnpm copy:web:server && pnpm copy:proto",
22
+ "build": "pnpm build:cli && pnpm build:server:real && pnpm copy:web && pnpm copy:web:server && pnpm copy:skills && pnpm copy:proto",
22
23
  "prepublishOnly": "pnpm build"
23
24
  },
24
25
  "dependencies": {