@aphrody/yolo-core 0.0.0-stage → 1.0.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.
Files changed (86) hide show
  1. package/README.md +78 -2
  2. package/package.json +55 -4
  3. package/src/compiler/index.ts +14 -0
  4. package/src/compiler/native.ts +2 -0
  5. package/src/compiler/oxc.ts +23 -0
  6. package/src/coord/aphrody.ts +494 -0
  7. package/src/coord/index.ts +1 -0
  8. package/src/curation/awesome.ts +623 -0
  9. package/src/curation/index.ts +2 -0
  10. package/src/curation/rename.ts +482 -0
  11. package/src/distribution/artifact.ts +13 -0
  12. package/src/distribution/index.ts +1 -0
  13. package/src/fleet/index.ts +3 -0
  14. package/src/fleet/parse.ts +1075 -0
  15. package/src/fleet/safety.ts +528 -0
  16. package/src/fleet/space.ts +206 -0
  17. package/src/gemma4/engine.ts +87 -0
  18. package/src/gemma4/index.ts +13 -0
  19. package/src/gemma4/inference.ts +319 -0
  20. package/src/gemma4/models.ts +283 -0
  21. package/src/gemma4/tokenizer.ts +202 -0
  22. package/src/gemma4/transport.ts +156 -0
  23. package/src/host/cli.ts +20 -0
  24. package/src/host/index.ts +106 -0
  25. package/src/index.ts +237 -0
  26. package/src/ledger/index.ts +578 -0
  27. package/src/math/vectors.ts +60 -0
  28. package/src/mcp/errors.ts +3 -0
  29. package/src/mcp/index.ts +1 -0
  30. package/src/mcp/paths.ts +3 -0
  31. package/src/mcp/server.ts +206 -0
  32. package/src/monitor/agent_watcher.ts +283 -0
  33. package/src/monitor/auto_sync.ts +309 -0
  34. package/src/monitor/index.ts +3 -0
  35. package/src/pm/index.ts +236 -0
  36. package/src/python/index.ts +63 -0
  37. package/src/redis/client.ts +182 -0
  38. package/src/redis/index.ts +5 -0
  39. package/src/redis/indexer.ts +208 -0
  40. package/src/redis/records.ts +174 -0
  41. package/src/redis/traindb.ts +223 -0
  42. package/src/redis/vector.ts +296 -0
  43. package/src/runtime/client.ts +57 -0
  44. package/src/runtime/index.ts +1 -0
  45. package/src/scaffold/create.ts +213 -0
  46. package/src/scaffold/index.ts +1 -0
  47. package/src/server/edge-proxy.ts +192 -0
  48. package/src/server/http.ts +245 -0
  49. package/src/server/index.ts +1 -0
  50. package/src/server/openapi.ts +129 -0
  51. package/src/sys/benchmark.ts +85 -0
  52. package/src/sys/doctor.ts +209 -0
  53. package/src/sys/hash.ts +26 -0
  54. package/src/sys/index.ts +5 -0
  55. package/src/sys/limiter.ts +27 -0
  56. package/src/sys/stats.ts +26 -0
  57. package/src/sys/supervisor-benchmark.test.ts +114 -0
  58. package/src/sys/supervisor-benchmark.ts +266 -0
  59. package/src/tools/errors.ts +1 -0
  60. package/src/tools/paths.ts +16 -0
  61. package/src/tools/registry.ts +758 -0
  62. package/src/units/catalog.json +424 -0
  63. package/src/units/cli.ts +28 -0
  64. package/src/units/index.ts +100 -0
  65. package/src/vendor/cargo.ts +42 -0
  66. package/src/vendor/catalog.ts +260 -0
  67. package/src/vendor/import.ts +901 -0
  68. package/src/vendor/index.ts +4 -0
  69. package/src/vendor/status.ts +254 -0
  70. package/src/verify/engine.ts +619 -0
  71. package/src/verify/index.ts +1 -0
  72. package/src/vfs/home.ts +72 -0
  73. package/src/vfs/index.ts +4 -0
  74. package/src/vfs/parse.ts +66 -0
  75. package/src/vfs/portability.ts +187 -0
  76. package/src/vfs/scan.ts +252 -0
  77. package/src/workspace/build-factory-jobs.ts +436 -0
  78. package/src/workspace/build-factory-source.ts +137 -0
  79. package/src/workspace/build-factory.ts +696 -0
  80. package/src/workspace/cli-help.ts +364 -0
  81. package/src/workspace/code-edit.ts +267 -0
  82. package/src/workspace/host-paths.ts +411 -0
  83. package/src/workspace/index.ts +14 -0
  84. package/src/workspace/paths.ts +155 -0
  85. package/src/workspace/process.ts +81 -0
  86. package/src/workspace/runtime-infra.ts +94 -0
package/README.md CHANGED
@@ -1,3 +1,79 @@
1
- # Temporary Holding Version
1
+ # YOLO Core Library (`@aphrody/yolo-core`)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Native Bun owners shared by the Yolo CLI, MCP server and HTTP API. Public subpaths
4
+ cover `sys`, `vfs`, `vendor`, `runtime`, `verify`, `server`, `mcp`, `fleet`,
5
+ `scaffold`, `curation`, `coord`, `distribution`, `host`, `units`, `ledger`,
6
+ `monitor`, `redis`, `gemma4` and `pm`.
7
+
8
+ ## Unified dependency synchronization
9
+
10
+ The `pm` owner implements the first dependency-acquisition tranche of the
11
+ Bun/uv/Cargo manager requested in [GOAL](../../GOAL.md). It detects manifests,
12
+ requires existing locks and installed global binaries, and returns a read-only
13
+ preflight by default. Applying a ready plan runs each manager sequentially under
14
+ the existing native runtime supervisor. Cargo uses Aphrody's serialization wrapper.
15
+
16
+ ```ts
17
+ import { planPackageSync, syncPackages } from "@aphrody/yolo-core/pm";
18
+
19
+ const controller = new AbortController();
20
+ const plan = await planPackageSync({ root: "/path/to/project", offline: true });
21
+ const result = await syncPackages({
22
+ root: plan.root,
23
+ offline: true,
24
+ apply: true,
25
+ signal: controller.signal,
26
+ });
27
+ ```
28
+
29
+ The same operation is available through `yolo mcp` as `yolo_package_sync` and
30
+ through `POST /api/tools/call` on `yolo api`:
31
+
32
+ ```json
33
+ {
34
+ "name": "yolo_package_sync",
35
+ "arguments": { "path": ".", "managers": "bun,uv,cargo", "offline": true, "apply": false }
36
+ }
37
+ ```
38
+
39
+ Bun uses `--frozen-lockfile --ignore-scripts`; uv uses `--locked` and disables
40
+ Python downloads; Cargo uses `fetch --locked`. Authentication and shared caches
41
+ remain with their existing owners. Failed preflight applies nothing; a failed
42
+ manager stops subsequent managers. Native process ownership handles timeout and
43
+ cancellation. Apply needs an installed compatible native runtime. The initial
44
+ qualified platform is Linux x64; Windows descendant ownership remains open.
45
+
46
+ Add/remove/update operations, tool installation, engine selection, builds and
47
+ publication are outside this tranche. Lock creation belongs to the native manager;
48
+ missing or stale locks are reported instead of silently regenerated.
49
+
50
+ ## Transport and persistence contracts
51
+
52
+ MCP and HTTP share tool definitions and argument validation; OpenAPI comes from
53
+ one owner. Each transport retains its Redis stores. HTTP file operations contain
54
+ both resolved paths and symlink targets within the workspace. HTTP mutation
55
+ requests honor configured tokens and reject untrusted browser origins.
56
+
57
+ `RedisVectorStore` persists copied Float32 vectors with validated dimensions,
58
+ metadata and cosine KNN filtering. Its exact search reads candidates in O(N);
59
+ it does not implement a Redis Search ANN index. `RedisTrainDb` persists validated
60
+ instruction/triple records and reports type/split counts. Pending offline writes,
61
+ deletes and clears reconcile on reconnect; the memory overlay is volatile across
62
+ process restarts. `persistenceState` and `sync()` expose that distinction.
63
+
64
+ Gemma profiles and memory estimates are explicitly unverified repository profiles.
65
+ Formatting is a text template, not a numeric tokenizer. `UnifiedInferenceEngine`
66
+ uses configured OpenAI-compatible providers for inference, incremental SSE and
67
+ `/embeddings`; errors propagate without simulated success. Local/OpenAI backends
68
+ require an endpoint, and mock inference requires explicit injection. No model
69
+ weights, tokenizer, native numerical inference or training are qualified here.
70
+ Text vector search requires an injected real embedder; callers can also supply
71
+ `queryVector` directly. The deterministic embedding utility is synthetic.
72
+
73
+ Monitors honor configured intervals, serialize cycles/probes and drain on stop.
74
+ Tests use explicit beacon paths, disposable repositories and isolated Redis/HTTP
75
+ servers. Scan fingerprints cover raw bytes in stable order; ledger fingerprints
76
+ cover file content. Vendor status reads complete refs, including packed refs and
77
+ worktrees; generated catalogs distinguish source and host-runtime revisions.
78
+
79
+ Evidence: [package-manager qualification](../../docs/package-manager-2026-10-04.json).
package/package.json CHANGED
@@ -1,6 +1,57 @@
1
1
  {
2
2
  "name": "@aphrody/yolo-core",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Unified core library for YOLO, modeled directly after Bun's core library architecture",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/aphrody-labs/aphrody.git",
9
+ "directory": "packages/engine/core"
10
+ },
11
+ "files": [
12
+ "src"
13
+ ],
14
+ "type": "module",
15
+ "main": "./src/index.ts",
16
+ "types": "./src/index.ts",
17
+ "exports": {
18
+ ".": "./src/index.ts",
19
+ "./sys": "./src/sys/index.ts",
20
+ "./vfs": "./src/vfs/index.ts",
21
+ "./vendor": "./src/vendor/index.ts",
22
+ "./runtime": "./src/runtime/index.ts",
23
+ "./verify": "./src/verify/index.ts",
24
+ "./server": "./src/server/index.ts",
25
+ "./edge-proxy": "./src/server/edge-proxy.ts",
26
+ "./mcp": "./src/mcp/index.ts",
27
+ "./fleet": "./src/fleet/index.ts",
28
+ "./scaffold": "./src/scaffold/index.ts",
29
+ "./curation": "./src/curation/index.ts",
30
+ "./coord": "./src/coord/index.ts",
31
+ "./distribution": "./src/distribution/index.ts",
32
+ "./units": "./src/units/index.ts",
33
+ "./gemma4": "./src/gemma4/index.ts",
34
+ "./redis": "./src/redis/index.ts",
35
+ "./host": "./src/host/index.ts",
36
+ "./ledger": "./src/ledger/index.ts",
37
+ "./monitor": "./src/monitor/index.ts",
38
+ "./pm": "./src/pm/index.ts",
39
+ "./compiler": "./src/compiler/index.ts",
40
+ "./python": "./src/python/index.ts",
41
+ "./workspace": "./src/workspace/index.ts"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "scripts": {
47
+ "test": "bun test test/core.test.ts test/units.test.ts test/ledger.test.ts test/host-config.test.ts test/redis_monitor.test.ts test/startup.test.ts test/gemma4.test.ts test/gemma4-inference.test.ts test/redis_vector.test.ts test/redis_native.test.ts test/core-transport.test.ts test/vfs-consistency.test.ts test/ledger-content.test.ts test/vendor-status.test.ts test/vendor-catalog.test.ts test/package-manager.test.ts",
48
+ "typecheck": "tsc -p tsconfig.json --noEmit"
49
+ },
50
+ "dependencies": {
51
+ "@aphrody/runtime-sdk": "0.1.0",
52
+ "@oxc-project/types": "0.152.0"
53
+ },
54
+ "engines": {
55
+ "bun": ">=1.4.2"
56
+ }
57
+ }
@@ -0,0 +1,14 @@
1
+ // SPDX-License-Identifier: MIT
2
+ export * from "./oxc.ts";
3
+ export {
4
+ NativeTooling,
5
+ scanNodeProject,
6
+ findNewlinesUtf16,
7
+ probeNativeTooling,
8
+ closeNativeTooling,
9
+ type NativeToolingOptions,
10
+ type NativeToolingProbe,
11
+ type ScanNodeProjectOptions,
12
+ type NodeProjectFinding,
13
+ type NodeProjectReport,
14
+ } from "./native.ts";
@@ -0,0 +1,2 @@
1
+ // SPDX-License-Identifier: MIT
2
+ export * from "@aphrody/runtime-sdk/tooling";
@@ -0,0 +1,23 @@
1
+ // SPDX-License-Identifier: MIT
2
+ import type { Program } from "@oxc-project/types";
3
+ import { parseProgram as nativeParseProgram } from "./native.ts";
4
+
5
+ /** Oxc runs only in the shared native provider. Bun owns ordinary transformation/bundling. */
6
+ export { analyzeModule, formatSource, minifySource, lintSource } from "./native.ts";
7
+ export type { ModuleAnalysis } from "./native.ts";
8
+ export type * from "@oxc-project/types";
9
+
10
+ /** Oxc's official JSON representation leaves runtime BigInt/RegExp values null. */
11
+ export type ESTreeJson<T> = T extends bigint | RegExp
12
+ ? null
13
+ : T extends readonly (infer Item)[]
14
+ ? ESTreeJson<Item>[]
15
+ : T extends object
16
+ ? { [Key in keyof T]: ESTreeJson<T[Key]> }
17
+ : T;
18
+ export type ESTreeProgram = ESTreeJson<Program>;
19
+
20
+ /** Official ESTree JSON, without a second N-API parser instance. */
21
+ export function parseProgram(source: string, filename = "input.js"): ESTreeProgram {
22
+ return nativeParseProgram<ESTreeProgram>(source, filename);
23
+ }