@ambitresearch/genie 1.3.1
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/README.md +15 -0
- package/dist/auth/bearer.d.ts +49 -0
- package/dist/auth/bearer.d.ts.map +1 -0
- package/dist/auth/bearer.js +159 -0
- package/dist/auth/bearer.js.map +1 -0
- package/dist/auth/oauth/authorize.d.ts +19 -0
- package/dist/auth/oauth/authorize.d.ts.map +1 -0
- package/dist/auth/oauth/authorize.js +111 -0
- package/dist/auth/oauth/authorize.js.map +1 -0
- package/dist/auth/oauth/config.d.ts +10 -0
- package/dist/auth/oauth/config.d.ts.map +1 -0
- package/dist/auth/oauth/config.js +16 -0
- package/dist/auth/oauth/config.js.map +1 -0
- package/dist/auth/oauth/dcr.d.ts +15 -0
- package/dist/auth/oauth/dcr.d.ts.map +1 -0
- package/dist/auth/oauth/dcr.js +38 -0
- package/dist/auth/oauth/dcr.js.map +1 -0
- package/dist/auth/oauth/jwt.d.ts +13 -0
- package/dist/auth/oauth/jwt.d.ts.map +1 -0
- package/dist/auth/oauth/jwt.js +46 -0
- package/dist/auth/oauth/jwt.js.map +1 -0
- package/dist/auth/oauth/metadata.d.ts +9 -0
- package/dist/auth/oauth/metadata.d.ts.map +1 -0
- package/dist/auth/oauth/metadata.js +19 -0
- package/dist/auth/oauth/metadata.js.map +1 -0
- package/dist/auth/oauth/router.d.ts +32 -0
- package/dist/auth/oauth/router.d.ts.map +1 -0
- package/dist/auth/oauth/router.js +159 -0
- package/dist/auth/oauth/router.js.map +1 -0
- package/dist/auth/oauth/store.d.ts +55 -0
- package/dist/auth/oauth/store.d.ts.map +1 -0
- package/dist/auth/oauth/store.js +63 -0
- package/dist/auth/oauth/store.js.map +1 -0
- package/dist/auth/oauth/token.d.ts +21 -0
- package/dist/auth/oauth/token.d.ts.map +1 -0
- package/dist/auth/oauth/token.js +77 -0
- package/dist/auth/oauth/token.js.map +1 -0
- package/dist/auth/oidc/group-policy.d.ts +43 -0
- package/dist/auth/oidc/group-policy.d.ts.map +1 -0
- package/dist/auth/oidc/group-policy.js +54 -0
- package/dist/auth/oidc/group-policy.js.map +1 -0
- package/dist/auth/oidc/verifier.d.ts +42 -0
- package/dist/auth/oidc/verifier.d.ts.map +1 -0
- package/dist/auth/oidc/verifier.js +145 -0
- package/dist/auth/oidc/verifier.js.map +1 -0
- package/dist/auth/token-cli.d.ts +9 -0
- package/dist/auth/token-cli.d.ts.map +1 -0
- package/dist/auth/token-cli.js +98 -0
- package/dist/auth/token-cli.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +149 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/redact.d.ts +20 -0
- package/dist/config/redact.d.ts.map +1 -0
- package/dist/config/redact.js +77 -0
- package/dist/config/redact.js.map +1 -0
- package/dist/config/secrets.d.ts +100 -0
- package/dist/config/secrets.d.ts.map +1 -0
- package/dist/config/secrets.js +130 -0
- package/dist/config/secrets.js.map +1 -0
- package/dist/framework/html.d.ts +103 -0
- package/dist/framework/html.d.ts.map +1 -0
- package/dist/framework/html.js +271 -0
- package/dist/framework/html.js.map +1 -0
- package/dist/framework/interface.d.ts +130 -0
- package/dist/framework/interface.d.ts.map +1 -0
- package/dist/framework/interface.js +112 -0
- package/dist/framework/interface.js.map +1 -0
- package/dist/framework/react.d.ts +133 -0
- package/dist/framework/react.d.ts.map +1 -0
- package/dist/framework/react.js +243 -0
- package/dist/framework/react.js.map +1 -0
- package/dist/framework/vue.d.ts +99 -0
- package/dist/framework/vue.d.ts.map +1 -0
- package/dist/framework/vue.js +375 -0
- package/dist/framework/vue.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/client.d.ts +81 -0
- package/dist/llm/client.d.ts.map +1 -0
- package/dist/llm/client.js +141 -0
- package/dist/llm/client.js.map +1 -0
- package/dist/llm/component-response.d.ts +111 -0
- package/dist/llm/component-response.d.ts.map +1 -0
- package/dist/llm/component-response.js +167 -0
- package/dist/llm/component-response.js.map +1 -0
- package/dist/llm/generated-files.d.ts +10 -0
- package/dist/llm/generated-files.d.ts.map +1 -0
- package/dist/llm/generated-files.js +26 -0
- package/dist/llm/generated-files.js.map +1 -0
- package/dist/llm/prompts/CHANGELOG.md +70 -0
- package/dist/llm/prompts/generate-component.system.md +99 -0
- package/dist/llm/prompts/refine-component.system.md +112 -0
- package/dist/llm/prompts.d.ts +66 -0
- package/dist/llm/prompts.d.ts.map +1 -0
- package/dist/llm/prompts.js +78 -0
- package/dist/llm/prompts.js.map +1 -0
- package/dist/llm/retry.d.ts +183 -0
- package/dist/llm/retry.d.ts.map +1 -0
- package/dist/llm/retry.js +475 -0
- package/dist/llm/retry.js.map +1 -0
- package/dist/llm/schema.d.ts +129 -0
- package/dist/llm/schema.d.ts.map +1 -0
- package/dist/llm/schema.js +147 -0
- package/dist/llm/schema.js.map +1 -0
- package/dist/llm/validate.d.ts +107 -0
- package/dist/llm/validate.d.ts.map +1 -0
- package/dist/llm/validate.js +174 -0
- package/dist/llm/validate.js.map +1 -0
- package/dist/manifest/compiler.d.ts +112 -0
- package/dist/manifest/compiler.d.ts.map +1 -0
- package/dist/manifest/compiler.js +306 -0
- package/dist/manifest/compiler.js.map +1 -0
- package/dist/manifest/ensure.d.ts +46 -0
- package/dist/manifest/ensure.d.ts.map +1 -0
- package/dist/manifest/ensure.js +49 -0
- package/dist/manifest/ensure.js.map +1 -0
- package/dist/manifest/index.d.ts +13 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +13 -0
- package/dist/manifest/index.js.map +1 -0
- package/dist/middleware/plan-guard.d.ts +167 -0
- package/dist/middleware/plan-guard.d.ts.map +1 -0
- package/dist/middleware/plan-guard.js +190 -0
- package/dist/middleware/plan-guard.js.map +1 -0
- package/dist/plans/index.d.ts +71 -0
- package/dist/plans/index.d.ts.map +1 -0
- package/dist/plans/index.js +252 -0
- package/dist/plans/index.js.map +1 -0
- package/dist/schemas/component.schema.json +114 -0
- package/dist/server.d.ts +96 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +258 -0
- package/dist/server.js.map +1 -0
- package/dist/store/empty-manifest.d.ts +58 -0
- package/dist/store/empty-manifest.d.ts.map +1 -0
- package/dist/store/empty-manifest.js +59 -0
- package/dist/store/empty-manifest.js.map +1 -0
- package/dist/store/git-host.d.ts +120 -0
- package/dist/store/git-host.d.ts.map +1 -0
- package/dist/store/git-host.js +796 -0
- package/dist/store/git-host.js.map +1 -0
- package/dist/store/index.d.ts +5 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +4 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/interface.d.ts +322 -0
- package/dist/store/interface.d.ts.map +1 -0
- package/dist/store/interface.js +100 -0
- package/dist/store/interface.js.map +1 -0
- package/dist/store/kit-files.d.ts +88 -0
- package/dist/store/kit-files.d.ts.map +1 -0
- package/dist/store/kit-files.js +199 -0
- package/dist/store/kit-files.js.map +1 -0
- package/dist/store/local.d.ts +70 -0
- package/dist/store/local.d.ts.map +1 -0
- package/dist/store/local.js +651 -0
- package/dist/store/local.js.map +1 -0
- package/dist/store/manifest.d.ts +44 -0
- package/dist/store/manifest.d.ts.map +1 -0
- package/dist/store/manifest.js +116 -0
- package/dist/store/manifest.js.map +1 -0
- package/dist/store/viewer-assets.d.ts +20 -0
- package/dist/store/viewer-assets.d.ts.map +1 -0
- package/dist/store/viewer-assets.js +118 -0
- package/dist/store/viewer-assets.js.map +1 -0
- package/dist/sync/anchor.d.ts +125 -0
- package/dist/sync/anchor.d.ts.map +1 -0
- package/dist/sync/anchor.js +210 -0
- package/dist/sync/anchor.js.map +1 -0
- package/dist/sync/index.d.ts +15 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +15 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/orchestrator.d.ts +160 -0
- package/dist/sync/orchestrator.d.ts.map +1 -0
- package/dist/sync/orchestrator.js +288 -0
- package/dist/sync/orchestrator.js.map +1 -0
- package/dist/tools/bind_kit.d.ts +29 -0
- package/dist/tools/bind_kit.d.ts.map +1 -0
- package/dist/tools/bind_kit.js +70 -0
- package/dist/tools/bind_kit.js.map +1 -0
- package/dist/tools/conjure.d.ts +141 -0
- package/dist/tools/conjure.d.ts.map +1 -0
- package/dist/tools/conjure.js +655 -0
- package/dist/tools/conjure.js.map +1 -0
- package/dist/tools/conjure_screen.d.ts +174 -0
- package/dist/tools/conjure_screen.d.ts.map +1 -0
- package/dist/tools/conjure_screen.js +458 -0
- package/dist/tools/conjure_screen.js.map +1 -0
- package/dist/tools/create_kit.d.ts +32 -0
- package/dist/tools/create_kit.d.ts.map +1 -0
- package/dist/tools/create_kit.js +131 -0
- package/dist/tools/create_kit.js.map +1 -0
- package/dist/tools/create_project.d.ts +267 -0
- package/dist/tools/create_project.d.ts.map +1 -0
- package/dist/tools/create_project.js +546 -0
- package/dist/tools/create_project.js.map +1 -0
- package/dist/tools/delete_files.d.ts +93 -0
- package/dist/tools/delete_files.d.ts.map +1 -0
- package/dist/tools/delete_files.js +276 -0
- package/dist/tools/delete_files.js.map +1 -0
- package/dist/tools/delete_project.d.ts +43 -0
- package/dist/tools/delete_project.d.ts.map +1 -0
- package/dist/tools/delete_project.js +118 -0
- package/dist/tools/delete_project.js.map +1 -0
- package/dist/tools/get_kit.d.ts +28 -0
- package/dist/tools/get_kit.d.ts.map +1 -0
- package/dist/tools/get_kit.js +95 -0
- package/dist/tools/get_kit.js.map +1 -0
- package/dist/tools/get_project.d.ts +37 -0
- package/dist/tools/get_project.d.ts.map +1 -0
- package/dist/tools/get_project.js +71 -0
- package/dist/tools/get_project.js.map +1 -0
- package/dist/tools/list_components.d.ts +42 -0
- package/dist/tools/list_components.d.ts.map +1 -0
- package/dist/tools/list_components.js +125 -0
- package/dist/tools/list_components.js.map +1 -0
- package/dist/tools/list_files.d.ts +32 -0
- package/dist/tools/list_files.d.ts.map +1 -0
- package/dist/tools/list_files.js +109 -0
- package/dist/tools/list_files.js.map +1 -0
- package/dist/tools/list_kits.d.ts +14 -0
- package/dist/tools/list_kits.d.ts.map +1 -0
- package/dist/tools/list_kits.js +41 -0
- package/dist/tools/list_kits.js.map +1 -0
- package/dist/tools/list_projects.d.ts +23 -0
- package/dist/tools/list_projects.d.ts.map +1 -0
- package/dist/tools/list_projects.js +66 -0
- package/dist/tools/list_projects.js.map +1 -0
- package/dist/tools/plan.d.ts +16 -0
- package/dist/tools/plan.d.ts.map +1 -0
- package/dist/tools/plan.js +146 -0
- package/dist/tools/plan.js.map +1 -0
- package/dist/tools/preview.d.ts +289 -0
- package/dist/tools/preview.d.ts.map +1 -0
- package/dist/tools/preview.js +672 -0
- package/dist/tools/preview.js.map +1 -0
- package/dist/tools/read_file.d.ts +40 -0
- package/dist/tools/read_file.d.ts.map +1 -0
- package/dist/tools/read_file.js +114 -0
- package/dist/tools/read_file.js.map +1 -0
- package/dist/tools/refine.d.ts +220 -0
- package/dist/tools/refine.d.ts.map +1 -0
- package/dist/tools/refine.js +501 -0
- package/dist/tools/refine.js.map +1 -0
- package/dist/tools/validate.d.ts +74 -0
- package/dist/tools/validate.d.ts.map +1 -0
- package/dist/tools/validate.js +224 -0
- package/dist/tools/validate.js.map +1 -0
- package/dist/tools/write_files.d.ts +158 -0
- package/dist/tools/write_files.d.ts.map +1 -0
- package/dist/tools/write_files.js +541 -0
- package/dist/tools/write_files.js.map +1 -0
- package/dist/transport.d.ts +77 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +448 -0
- package/dist/transport.js.map +1 -0
- package/dist/ui/card-asset-broker.d.ts +42 -0
- package/dist/ui/card-asset-broker.d.ts.map +1 -0
- package/dist/ui/card-asset-broker.js +479 -0
- package/dist/ui/card-asset-broker.js.map +1 -0
- package/dist/ui/grid-resource.d.ts +252 -0
- package/dist/ui/grid-resource.d.ts.map +1 -0
- package/dist/ui/grid-resource.js +680 -0
- package/dist/ui/grid-resource.js.map +1 -0
- package/dist/ui/viewer-static/index.html +95 -0
- package/dist/ui/viewer-static/viewer.css +451 -0
- package/dist/ui/viewer-static/viewer.js +1405 -0
- package/dist/validate/full-scan.d.ts +87 -0
- package/dist/validate/full-scan.d.ts.map +1 -0
- package/dist/validate/full-scan.js +299 -0
- package/dist/validate/full-scan.js.map +1 -0
- package/dist/validate/index.d.ts +15 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +18 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/marker.d.ts +89 -0
- package/dist/validate/marker.d.ts.map +1 -0
- package/dist/validate/marker.js +87 -0
- package/dist/validate/marker.js.map +1 -0
- package/dist/validate/phash.d.ts +135 -0
- package/dist/validate/phash.d.ts.map +1 -0
- package/dist/validate/phash.js +307 -0
- package/dist/validate/phash.js.map +1 -0
- package/dist/validate/render.d.ts +38 -0
- package/dist/validate/render.d.ts.map +1 -0
- package/dist/validate/render.js +155 -0
- package/dist/validate/render.js.map +1 -0
- package/dist/watch/index.d.ts +12 -0
- package/dist/watch/index.d.ts.map +1 -0
- package/dist/watch/index.js +12 -0
- package/dist/watch/index.js.map +1 -0
- package/dist/watch/watcher.d.ts +65 -0
- package/dist/watch/watcher.d.ts.map +1 -0
- package/dist/watch/watcher.js +238 -0
- package/dist/watch/watcher.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public re-export barrel for the M3-02 chokidar watcher (DRO-258 / AC-parity
|
|
3
|
+
* with M3-01's own barrel convention).
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the existing `store/index.ts` / `plans/index.ts` / `validate/
|
|
6
|
+
* index.ts` barrel pattern: downstream consumers (the M3-03 manifest
|
|
7
|
+
* compiler, the future M4-04 HMR bridge) import from `../watch/index.js`
|
|
8
|
+
* rather than reaching into `./watcher.js` directly, so this module's
|
|
9
|
+
* internal file layout can change without breaking callers.
|
|
10
|
+
*/
|
|
11
|
+
export { startWatcher, type StartWatcherOptions, type WatcherChange, type WatcherChangeType, type WatcherHandle, } from "./watcher.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/watch/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public re-export barrel for the M3-02 chokidar watcher (DRO-258 / AC-parity
|
|
3
|
+
* with M3-01's own barrel convention).
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the existing `store/index.ts` / `plans/index.ts` / `validate/
|
|
6
|
+
* index.ts` barrel pattern: downstream consumers (the M3-03 manifest
|
|
7
|
+
* compiler, the future M4-04 HMR bridge) import from `../watch/index.js`
|
|
8
|
+
* rather than reaching into `./watcher.js` directly, so this module's
|
|
9
|
+
* internal file layout can change without breaking callers.
|
|
10
|
+
*/
|
|
11
|
+
export { startWatcher, } from "./watcher.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/watch/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,YAAY,GAKb,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M3-02 (DRO-258) — chokidar watcher for a project/kit's component tree.
|
|
3
|
+
*
|
|
4
|
+
* Watches the four glob groups a kit's on-disk layout defines: component
|
|
5
|
+
* preview/source files, token files,
|
|
6
|
+
* the import-closure root stylesheet, and the per-kit `meta.json`. On any
|
|
7
|
+
* change it classifies the touched paths by which group they belong to,
|
|
8
|
+
* debounces a 100 ms window PER classification (AC3), and hands the caller
|
|
9
|
+
* one `{ type, paths }` batch per group per settled cycle (AC4).
|
|
10
|
+
*
|
|
11
|
+
* Deliberately a "dumb" event source: it does not itself invoke the M3-01
|
|
12
|
+
* `@genie` marker validator or the M3-03 manifest compiler — those are
|
|
13
|
+
* `onChange` callback concerns for whoever wires this up (M3-03 is the
|
|
14
|
+
* planned first consumer). Keeping this module free of that dependency is
|
|
15
|
+
* what lets `startWatcher`'s signature stay exactly `(projectRoot, onChange)`
|
|
16
|
+
* (AC1) and keeps the watcher unit-testable in isolation.
|
|
17
|
+
*/
|
|
18
|
+
/** The three change classifications AC4 requires `onChange` to report. */
|
|
19
|
+
export type WatcherChangeType = "preview" | "tokens" | "manifest";
|
|
20
|
+
/** One debounced batch of same-type changes, handed to `onChange` (AC4). */
|
|
21
|
+
export interface WatcherChange {
|
|
22
|
+
type: WatcherChangeType;
|
|
23
|
+
paths: string[];
|
|
24
|
+
}
|
|
25
|
+
/** Optional tuning knobs beyond the AC3 default 100 ms debounce window. */
|
|
26
|
+
export interface StartWatcherOptions {
|
|
27
|
+
/**
|
|
28
|
+
* AC5 — force chokidar's polling backend on, the documented fallback for
|
|
29
|
+
* filesystems (Docker bind/volume mounts, some network shares) where
|
|
30
|
+
* native `inotify`/`FSEvents` events don't reliably propagate. When
|
|
31
|
+
* omitted, defaults to `true` if the `GENIE_WATCH_USE_POLLING` env var is
|
|
32
|
+
* set to a truthy value (`"1"`/`"true"`), else `false`. An explicit
|
|
33
|
+
* `usePolling` here always wins over the env var, so callers/tests don't
|
|
34
|
+
* need to mutate `process.env` to exercise the fallback path.
|
|
35
|
+
*/
|
|
36
|
+
usePolling?: boolean;
|
|
37
|
+
/** Polling interval in ms when `usePolling` is on. Defaults to 100. */
|
|
38
|
+
pollInterval?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Debounce window in ms (AC3 default 100). Exposed for tests that want a
|
|
41
|
+
* tighter/looser window than the shipped default; production callers
|
|
42
|
+
* should leave this at the default so the AC3 contract holds.
|
|
43
|
+
*/
|
|
44
|
+
debounceMs?: number;
|
|
45
|
+
}
|
|
46
|
+
/** Handle returned by {@link startWatcher}. */
|
|
47
|
+
export interface WatcherHandle {
|
|
48
|
+
/**
|
|
49
|
+
* AC6 — stop the watcher: closes the underlying chokidar instance and
|
|
50
|
+
* clears any pending (not-yet-flushed) debounce timers, so no further
|
|
51
|
+
* `onChange` call can fire after this resolves. Idempotent — calling it
|
|
52
|
+
* more than once is a harmless no-op (mirrors chokidar's own `close()`
|
|
53
|
+
* idempotency).
|
|
54
|
+
*/
|
|
55
|
+
stop: () => Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* AC1/AC2/AC3/AC4/AC5/AC6/AC7 — watch a kit/project root's component tree.
|
|
59
|
+
*
|
|
60
|
+
* `onChange` fires once per {@link WatcherChangeType} per settled debounce
|
|
61
|
+
* window (AC3's 100 ms default), never combining two types into one call
|
|
62
|
+
* and never firing for a window that saw zero net paths.
|
|
63
|
+
*/
|
|
64
|
+
export declare function startWatcher(projectRoot: string, onChange: (change: WatcherChange) => void, options?: StartWatcherOptions): WatcherHandle;
|
|
65
|
+
//# sourceMappingURL=watcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/watch/watcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAeH,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElE,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,+CAA+C;AAC/C,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAwID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,EACzC,OAAO,GAAE,mBAAwB,GAChC,aAAa,CA0Gf"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M3-02 (DRO-258) — chokidar watcher for a project/kit's component tree.
|
|
3
|
+
*
|
|
4
|
+
* Watches the four glob groups a kit's on-disk layout defines: component
|
|
5
|
+
* preview/source files, token files,
|
|
6
|
+
* the import-closure root stylesheet, and the per-kit `meta.json`. On any
|
|
7
|
+
* change it classifies the touched paths by which group they belong to,
|
|
8
|
+
* debounces a 100 ms window PER classification (AC3), and hands the caller
|
|
9
|
+
* one `{ type, paths }` batch per group per settled cycle (AC4).
|
|
10
|
+
*
|
|
11
|
+
* Deliberately a "dumb" event source: it does not itself invoke the M3-01
|
|
12
|
+
* `@genie` marker validator or the M3-03 manifest compiler — those are
|
|
13
|
+
* `onChange` callback concerns for whoever wires this up (M3-03 is the
|
|
14
|
+
* planned first consumer). Keeping this module free of that dependency is
|
|
15
|
+
* what lets `startWatcher`'s signature stay exactly `(projectRoot, onChange)`
|
|
16
|
+
* (AC1) and keeps the watcher unit-testable in isolation.
|
|
17
|
+
*/
|
|
18
|
+
import { mkdirSync } from "node:fs";
|
|
19
|
+
import { join } from "node:path";
|
|
20
|
+
import chokidar from "chokidar";
|
|
21
|
+
// micromatch is CJS-only and assigns its named helpers as properties on the
|
|
22
|
+
// exported function itself rather than separate `module.exports.foo = ...`
|
|
23
|
+
// assignments, so Node's cjs-module-lexer can't statically see them — a
|
|
24
|
+
// default import is the one shape that works both under esbuild (vitest)
|
|
25
|
+
// and real Node ESM. Same workaround, same reasoning, as `../plans/index.ts`.
|
|
26
|
+
import micromatch from "micromatch";
|
|
27
|
+
// ─── Env-driven polling default (AC5) ────────────────────────────────────────
|
|
28
|
+
const USE_POLLING_ENV = "GENIE_WATCH_USE_POLLING";
|
|
29
|
+
/** `true` for "1"/"true" (case-insensitive), `false` for anything else/unset. */
|
|
30
|
+
function envUsePolling(env) {
|
|
31
|
+
const raw = env[USE_POLLING_ENV];
|
|
32
|
+
if (raw === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
const normalized = raw.trim().toLowerCase();
|
|
35
|
+
return normalized === "1" || normalized === "true";
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build the AC2 glob patterns for a given kit/project root, each tagged with
|
|
39
|
+
* the {@link WatcherChangeType} it classifies as. `styles.css` and
|
|
40
|
+
* `meta.json` are combined into ONE brace-expansion pattern rather than two
|
|
41
|
+
* separate exact-file literals — see {@link ensureWatchTargetsExist} for why
|
|
42
|
+
* this alone isn't sufficient and what the other half of the fix is.
|
|
43
|
+
*
|
|
44
|
+
* Both `styles.css` and `meta.json` remain exact root-level files, not a
|
|
45
|
+
* `**` pattern — a same-named file nested under `components/` still must
|
|
46
|
+
* NOT match, and the brace form preserves that (verified:
|
|
47
|
+
* `{root}/components/meta.json` does not match `{root}/{styles.css,meta.json}`).
|
|
48
|
+
*/
|
|
49
|
+
function globGroups(projectRoot) {
|
|
50
|
+
return [
|
|
51
|
+
{ type: "preview", pattern: `${projectRoot}/components/**/*.{html,tsx,d.ts,md}` },
|
|
52
|
+
{ type: "tokens", pattern: `${projectRoot}/tokens/**` },
|
|
53
|
+
{ type: "manifest", pattern: `${projectRoot}/{styles.css,meta.json}` },
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Defensively `mkdir -p` the two directory targets a fresh kit/project may
|
|
58
|
+
* not have created yet (`components/`, `tokens/`) before handing patterns to
|
|
59
|
+
* `chokidar.watch()`.
|
|
60
|
+
*
|
|
61
|
+
* This closes a real chokidar v3 gap a spike confirmed: when TWO OR MORE of
|
|
62
|
+
* a single `watch()` call's targets are simultaneously missing from disk at
|
|
63
|
+
* call time, only the FIRST one ever gets armed — any sibling target that
|
|
64
|
+
* was ALSO missing at that instant can go permanently deaf, even after it's
|
|
65
|
+
* created later, even under `usePolling`. (A single missing target, or a
|
|
66
|
+
* missing target watched alongside only already-existing ones, recovers
|
|
67
|
+
* fine — it's specifically the "≥2 simultaneously missing" combination that
|
|
68
|
+
* breaks.) The brace-expansion fix in {@link globGroups} (one pattern
|
|
69
|
+
* instead of two literals for `styles.css`/`meta.json`) only fixes that
|
|
70
|
+
* ONE pair; `components/` and `tokens/` are still two independent
|
|
71
|
+
* directory-rooted patterns, so the same failure mode applies to them.
|
|
72
|
+
*
|
|
73
|
+
* A brand-new kit is not a theoretical case: `LocalFsKitStore.createKit`
|
|
74
|
+
* (`../store/local.ts`) only scaffolds the kit directory + `.kit.json` —
|
|
75
|
+
* `components/`, `tokens/`, `styles.css`, and `meta.json` don't exist until
|
|
76
|
+
* the first `write_files`/`conjure` call lands. A watcher started right
|
|
77
|
+
* after `create_kit` (a realistic startup ordering) would otherwise go
|
|
78
|
+
* deaf on every group but whichever pattern chokidar happens to arm first.
|
|
79
|
+
*
|
|
80
|
+
* `mkdirSync(..., { recursive: true })` is idempotent (a no-op if the
|
|
81
|
+
* directory already exists) and, being recursive, also creates
|
|
82
|
+
* `projectRoot` itself if that doesn't exist yet either — so this one call
|
|
83
|
+
* covers the "entire root is missing" case too, not just its children.
|
|
84
|
+
* Synchronous and best-effort: if `projectRoot`'s parent is unwritable or a
|
|
85
|
+
* path segment collides with a non-directory file, this throws the
|
|
86
|
+
* underlying `fs` error (e.g. `EACCES`/`ENOTDIR`) synchronously out of
|
|
87
|
+
* `startWatcher` itself, before any chokidar instance is created — a clear,
|
|
88
|
+
* immediate failure rather than a watcher that silently never sees half its
|
|
89
|
+
* target groups.
|
|
90
|
+
*/
|
|
91
|
+
function ensureWatchTargetsExist(projectRoot) {
|
|
92
|
+
mkdirSync(join(projectRoot, "components"), { recursive: true });
|
|
93
|
+
mkdirSync(join(projectRoot, "tokens"), { recursive: true });
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Classify an absolute path emitted by chokidar against the AC2 glob groups,
|
|
97
|
+
* via the same `micromatch` matcher `../plans/index.ts`'s `pathMatchesGlobs`
|
|
98
|
+
* already relies on elsewhere in this server, so a path's classification
|
|
99
|
+
* here is consistent with how the rest of the codebase interprets these
|
|
100
|
+
* patterns. Returns `undefined` for a path that matches none of the 4
|
|
101
|
+
* groups (e.g. chokidar reporting a directory-add for `tokens/` itself is
|
|
102
|
+
* still a legitimate `tokens` match — `tokens/**` covers the dir entry
|
|
103
|
+
* too — but an unrelated sibling file is not).
|
|
104
|
+
*/
|
|
105
|
+
function classifyPath(path, groups) {
|
|
106
|
+
for (const group of groups) {
|
|
107
|
+
if (micromatch.isMatch(path, group.pattern, { dot: true }))
|
|
108
|
+
return group.type;
|
|
109
|
+
}
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
// ─── stderr logging (AC7) ────────────────────────────────────────────────────
|
|
113
|
+
/**
|
|
114
|
+
* AC7 — one JSON line per flushed debounce cycle. MUST go to stderr, never
|
|
115
|
+
* stdout: on the stdio transport (the default when a harness pipes
|
|
116
|
+
* JSON-RPC — see `../transport.ts`), stdout *is* the protocol stream, and a
|
|
117
|
+
* stray log line there corrupts every client's message framing (the same
|
|
118
|
+
* rule `../tools/plan.ts`'s `plan.created` audit line and `../llm/retry.ts`'s
|
|
119
|
+
* `logRetry` already follow).
|
|
120
|
+
*/
|
|
121
|
+
function logCycle(counts, type) {
|
|
122
|
+
process.stderr.write(JSON.stringify({
|
|
123
|
+
event: "watcher.cycle",
|
|
124
|
+
added: counts.added,
|
|
125
|
+
changed: counts.changed,
|
|
126
|
+
deleted: counts.deleted,
|
|
127
|
+
debouncedTo: type,
|
|
128
|
+
}) + "\n");
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* AC1/AC2/AC3/AC4/AC5/AC6/AC7 — watch a kit/project root's component tree.
|
|
132
|
+
*
|
|
133
|
+
* `onChange` fires once per {@link WatcherChangeType} per settled debounce
|
|
134
|
+
* window (AC3's 100 ms default), never combining two types into one call
|
|
135
|
+
* and never firing for a window that saw zero net paths.
|
|
136
|
+
*/
|
|
137
|
+
export function startWatcher(projectRoot, onChange, options = {}) {
|
|
138
|
+
const debounceMs = options.debounceMs ?? 100;
|
|
139
|
+
const usePolling = options.usePolling ?? envUsePolling(process.env);
|
|
140
|
+
const pollInterval = options.pollInterval ?? 100;
|
|
141
|
+
ensureWatchTargetsExist(projectRoot);
|
|
142
|
+
const groups = globGroups(projectRoot);
|
|
143
|
+
const patterns = groups.map((g) => g.pattern);
|
|
144
|
+
const watcher = chokidar.watch(patterns, {
|
|
145
|
+
// Spec: "ignoreInitial: false so subscribers get current state on startup".
|
|
146
|
+
ignoreInitial: false,
|
|
147
|
+
usePolling,
|
|
148
|
+
interval: pollInterval,
|
|
149
|
+
// AC3 names ONE debounce authority: this module's own `debounceMs`
|
|
150
|
+
// window. Chokidar's `atomic` option (on by default for native fs
|
|
151
|
+
// events) runs its OWN independent ~100 ms delay before emitting an
|
|
152
|
+
// `unlink` — to detect editor atomic-save patterns (temp-write +
|
|
153
|
+
// rename-over) and fold them into a single `change`. Left on, that
|
|
154
|
+
// timer races our own 100 ms debounce timer (confirmed by spike: with
|
|
155
|
+
// both defaulting to 100 ms and starting at nearly the same instant, a
|
|
156
|
+
// delete's `unlink` can land either just inside or just outside our
|
|
157
|
+
// window, nondeterministically). Disabling it here removes the second,
|
|
158
|
+
// competing debounce mechanism so AC3's window is the only one in
|
|
159
|
+
// play — an atomic editor save still nets out fine: our own
|
|
160
|
+
// last-event-wins accumulator (see `schedule` below) coalesces the
|
|
161
|
+
// resulting unlink+add pair on the same path within one window anyway.
|
|
162
|
+
atomic: false,
|
|
163
|
+
});
|
|
164
|
+
const pending = new Map();
|
|
165
|
+
let stopped = false;
|
|
166
|
+
function flush(type) {
|
|
167
|
+
const batch = pending.get(type);
|
|
168
|
+
if (!batch)
|
|
169
|
+
return;
|
|
170
|
+
pending.delete(type);
|
|
171
|
+
let added = 0;
|
|
172
|
+
let changed = 0;
|
|
173
|
+
let deleted = 0;
|
|
174
|
+
const paths = [];
|
|
175
|
+
for (const [path, kind] of batch.kinds) {
|
|
176
|
+
paths.push(path);
|
|
177
|
+
if (kind === "add")
|
|
178
|
+
added++;
|
|
179
|
+
else if (kind === "change")
|
|
180
|
+
changed++;
|
|
181
|
+
else
|
|
182
|
+
deleted++;
|
|
183
|
+
}
|
|
184
|
+
// AC7 logs every settled cycle, even a degenerate one; AC4's onChange
|
|
185
|
+
// only fires when there is something to report.
|
|
186
|
+
logCycle({ added, changed, deleted }, type);
|
|
187
|
+
if (paths.length > 0) {
|
|
188
|
+
onChange({ type, paths });
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function schedule(type, path, kind) {
|
|
192
|
+
if (stopped)
|
|
193
|
+
return;
|
|
194
|
+
const existing = pending.get(type);
|
|
195
|
+
const batch = existing ?? {
|
|
196
|
+
timer: undefined,
|
|
197
|
+
kinds: new Map(),
|
|
198
|
+
};
|
|
199
|
+
// Net-kind resolution when the same path gets more than one raw event
|
|
200
|
+
// inside a still-open window: last-event-wins. AC4's `onChange` payload
|
|
201
|
+
// doesn't carry a per-path kind at all (just `paths: string[]`) — the
|
|
202
|
+
// classification here only feeds AC7's aggregate added/changed/deleted
|
|
203
|
+
// log counts, so "what actually happened most recently to this path" is
|
|
204
|
+
// both the simplest rule and the one a human reading the log would
|
|
205
|
+
// expect. (An earlier "sticky add" draft — keep it `add` through a
|
|
206
|
+
// same-window `change`, but let a same-window `unlink` win outright —
|
|
207
|
+
// had a real bug: `previous ?? kind` only falls through on
|
|
208
|
+
// `null`/`undefined`, never on the truthy string `"unlink"`, so a path
|
|
209
|
+
// unlinked then re-added inside one window would have stayed stuck
|
|
210
|
+
// reporting `"unlink"` forever. Last-event-wins has no such asymmetry.)
|
|
211
|
+
batch.kinds.set(path, kind);
|
|
212
|
+
if (existing)
|
|
213
|
+
clearTimeout(existing.timer);
|
|
214
|
+
batch.timer = setTimeout(() => flush(type), debounceMs);
|
|
215
|
+
pending.set(type, batch);
|
|
216
|
+
}
|
|
217
|
+
function dispatch(path, kind) {
|
|
218
|
+
const type = classifyPath(path, groups);
|
|
219
|
+
if (type === undefined)
|
|
220
|
+
return;
|
|
221
|
+
schedule(type, path, kind);
|
|
222
|
+
}
|
|
223
|
+
watcher.on("add", (path) => dispatch(path, "add"));
|
|
224
|
+
watcher.on("change", (path) => dispatch(path, "change"));
|
|
225
|
+
watcher.on("unlink", (path) => dispatch(path, "unlink"));
|
|
226
|
+
async function stop() {
|
|
227
|
+
if (stopped)
|
|
228
|
+
return;
|
|
229
|
+
stopped = true;
|
|
230
|
+
for (const batch of pending.values()) {
|
|
231
|
+
clearTimeout(batch.timer);
|
|
232
|
+
}
|
|
233
|
+
pending.clear();
|
|
234
|
+
await watcher.close();
|
|
235
|
+
}
|
|
236
|
+
return { stop };
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=watcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watcher.js","sourceRoot":"","sources":["../../src/watch/watcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,4EAA4E;AAC5E,2EAA2E;AAC3E,wEAAwE;AACxE,yEAAyE;AACzE,8EAA8E;AAC9E,OAAO,UAAU,MAAM,YAAY,CAAC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,CAAC,MAAM,EAAE,EAAE,CAAC;YACrC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ambitresearch/genie",
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "genie MCP server — harness-agnostic AI UI-component generation.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ambitresearch/genie.git",
|
|
9
|
+
"directory": "packages/server"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public",
|
|
13
|
+
"provenance": true
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"genie": "dist/cli.js"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "tsx watch src/cli.ts",
|
|
25
|
+
"start": "node dist/cli.js",
|
|
26
|
+
"build": "tsc -p tsconfig.json && node scripts/emit-component-schema.mjs && node scripts/copy-prompts.mjs && node scripts/copy-viewer-assets.mjs && node scripts/verify-packaged-viewer.mjs",
|
|
27
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
31
|
+
"@vue/compiler-sfc": "^3.5.0",
|
|
32
|
+
"ajv": "^8.20.0",
|
|
33
|
+
"blockhash-core": "^0.1.0",
|
|
34
|
+
"chokidar": "^3.6.0",
|
|
35
|
+
"diff": "^8.0.2",
|
|
36
|
+
"esbuild": "^0.28.1",
|
|
37
|
+
"ipaddr.js": "^2.4.0",
|
|
38
|
+
"jose": "^6.2.3",
|
|
39
|
+
"micromatch": "^4.0.8",
|
|
40
|
+
"mime-types": "^3.0.2",
|
|
41
|
+
"openai": "^6.45.0",
|
|
42
|
+
"parse5": "^7.3.0",
|
|
43
|
+
"pino": "^10.3.1",
|
|
44
|
+
"pngjs": "^7.0.0",
|
|
45
|
+
"prom-client": "^15.1.3",
|
|
46
|
+
"ts-morph": "^28.0.0",
|
|
47
|
+
"undici": "^7.28.0",
|
|
48
|
+
"zod": "^4.4.3"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=22"
|
|
52
|
+
},
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"author": "Roshan Gautam",
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@ambitresearch/genie-viewer": "workspace:*",
|
|
57
|
+
"@types/jsdom": "^21.1.7",
|
|
58
|
+
"@types/json-schema": "^7.0.15",
|
|
59
|
+
"@types/micromatch": "^4.0.10",
|
|
60
|
+
"@types/mime-types": "^3.0.1",
|
|
61
|
+
"@types/pngjs": "^6.0.5",
|
|
62
|
+
"jsdom": "^25.0.1",
|
|
63
|
+
"json-schema-to-ts": "^3.1.1",
|
|
64
|
+
"playwright": "^1.58.2",
|
|
65
|
+
"react": "^18.3.1",
|
|
66
|
+
"react-dom": "^18.3.1",
|
|
67
|
+
"vue": "^3.5.39",
|
|
68
|
+
"yaml": "^2.9.0"
|
|
69
|
+
}
|
|
70
|
+
}
|