@nuucognition/flint-cli 0.7.0-dev.4 → 0.7.0-dev.5
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 +1 -0
- package/bin/flint-prod.js +7 -0
- package/bin/launch-flint.js +8 -0
- package/bin/nuu.js +36 -14
- package/dist/.build-stamp.json +4 -4
- package/dist/_flint/prompts/agentic/sweep-0.7.0.md +4 -10
- package/dist/completion.js +669 -481
- package/dist/foundation.js +4875 -0
- package/dist/index.js +43618 -29230
- package/dist/nuu.js +195781 -0
- package/package.json +10 -7
package/README.md
CHANGED
|
@@ -204,6 +204,7 @@ flint shard install --from-git NUU-Cognition/shard-plan#v0.4.0
|
|
|
204
204
|
flint shard install --from-path ../shards/sketchpad
|
|
205
205
|
flint shard install @nuucognition/tasks#demo-maker # from a Flint on this machine
|
|
206
206
|
flint shard update # move the lock inside the range of each spec
|
|
207
|
+
flint shard broadcast tasks --dry-run # after a change to a source here: the Flints that install it from here
|
|
207
208
|
flint shard versions notepad
|
|
208
209
|
flint shard uninstall notepad
|
|
209
210
|
```
|
package/bin/flint-prod.js
CHANGED
|
@@ -22,6 +22,13 @@ import { shouldEnableOpenTuiFfi } from '../dist/open-tui-invocation.js';
|
|
|
22
22
|
const args = process.argv.slice(2);
|
|
23
23
|
const completionRequested = args[0] === '__complete';
|
|
24
24
|
|
|
25
|
+
// `flint foundation` (Task 1080): the small Foundation entry runs before the host bundle and the stamp check, and exits.
|
|
26
|
+
// A build with no such entry falls through to dist/index.js, which routes the command too.
|
|
27
|
+
if (args[0] === 'foundation') {
|
|
28
|
+
const foundation = await import('../dist/foundation.js').catch(() => null);
|
|
29
|
+
if (foundation) await foundation.exitWithFoundation(args.slice(1));
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
if (!completionRequested) {
|
|
26
33
|
const openTuiRequested = shouldEnableOpenTuiFfi({
|
|
27
34
|
cli: 'flint',
|
package/bin/launch-flint.js
CHANGED
|
@@ -53,6 +53,14 @@ export async function launchFlint({ launcherPath }) {
|
|
|
53
53
|
const srcEntry = join(packageRoot, 'src', `${entryName}.ts`);
|
|
54
54
|
const distEntry = join(packageRoot, 'dist-dev', `${entryName}.js`);
|
|
55
55
|
|
|
56
|
+
// `flint foundation` (Task 1080): the small Foundation entry runs before the host bundle and the stamp check, and exits.
|
|
57
|
+
// A source run goes through src/index.ts, which routes the command too.
|
|
58
|
+
const foundationEntry = join(packageRoot, 'dist-dev', 'foundation.js');
|
|
59
|
+
if (args[0] === 'foundation' && !forceSource && existsSync(foundationEntry)) {
|
|
60
|
+
const { exitWithFoundation } = await import(foundationEntry);
|
|
61
|
+
await exitWithFoundation(args.slice(1));
|
|
62
|
+
}
|
|
63
|
+
|
|
56
64
|
// NO SOURCE RUN FOR A DAEMON (incident of 2026-09-21). nclient sets
|
|
57
65
|
// FLINT_REQUIRE_BUNDLE=1 for every one-shot. A source run is two processes,
|
|
58
66
|
// about 300 MB, and tens of seconds; thirty of them at one time took three
|
package/bin/nuu.js
CHANGED
|
@@ -1,19 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// The `nuu` command of one flint install (Task 1048, UX1; ruling 31).
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
import { readFileSync } from 'node:fs';
|
|
7
|
-
import { createRequire } from 'node:module';
|
|
2
|
+
// The `nuu` command of one flint install (Task 1048, UX1; ruling 31). The nuu
|
|
3
|
+
// CLI is inside the flint bundle, as Blacksmith is (Task 1058): this launcher
|
|
4
|
+
// runs dist/nuu.js, and no package @nuucognition/nuu-cli is installed.
|
|
5
|
+
import { existsSync } from 'node:fs';
|
|
8
6
|
import { dirname, join } from 'node:path';
|
|
9
|
-
import { pathToFileURL } from 'node:url';
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
10
8
|
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const entrypoint = join(__dirname, '..', 'dist', 'nuu.js');
|
|
11
|
+
|
|
12
|
+
// `nuu foundation` (Task 1080): the Foundation entry of `flint foundation` runs before the nuu bundle and the stamp
|
|
13
|
+
// check, and exits. A build with no such entry falls through to dist/nuu.js.
|
|
14
|
+
const foundationEntry = join(__dirname, '..', 'dist', 'foundation.js');
|
|
15
|
+
if (process.argv[2] === 'foundation' && existsSync(foundationEntry)) {
|
|
16
|
+
const { exitWithFoundation } = await import(pathToFileURL(foundationEntry).href);
|
|
17
|
+
await exitWithFoundation(process.argv.slice(3), 'nuu foundation');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (!existsSync(entrypoint)) {
|
|
21
|
+
process.stderr.write(`✘ This flint install has no nuu bundle at ${entrypoint}.\n Next: npm install -g @nuucognition/flint-cli\n`);
|
|
17
22
|
process.exit(1);
|
|
18
23
|
}
|
|
19
|
-
|
|
24
|
+
|
|
25
|
+
// In a checkout the stamp check applies as for flint-prod.js; in an installed
|
|
26
|
+
// npm package cli-core is absent and the check is skipped.
|
|
27
|
+
const { warnIfBuildStale } = await import('@nuucognition/cli-core/launch').catch(() => ({ warnIfBuildStale() {} }));
|
|
28
|
+
warnIfBuildStale({ cli: 'nuu', distEntry: entrypoint, rebuildHint: 'Run: ndv build flint prod' });
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const { enableCompileCache } = await import('node:module');
|
|
32
|
+
enableCompileCache?.();
|
|
33
|
+
} catch {
|
|
34
|
+
/* uncached */
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// This process is this launcher: the nclient daemon starts with it
|
|
38
|
+
// (`nuu client start`), and every printed command names `nuu`.
|
|
39
|
+
process.env.NUU_CLI_LAUNCHER = fileURLToPath(import.meta.url);
|
|
40
|
+
process.env.NUU_CLI_ENTRYPOINT = entrypoint;
|
|
41
|
+
await import(pathToFileURL(entrypoint).href);
|
package/dist/.build-stamp.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sha": "
|
|
3
|
-
"tree": "
|
|
4
|
-
"dirty":
|
|
5
|
-
"builtAt": "2026-09-
|
|
2
|
+
"sha": "4ac20c5428b62e1f2de74b6544fde152a2ab247c",
|
|
3
|
+
"tree": "4292f2915b1ceba3e73bbd8436575da2520d49a1",
|
|
4
|
+
"dirty": false,
|
|
5
|
+
"builtAt": "2026-09-29T23:40:46.440Z",
|
|
6
6
|
"mode": "prod"
|
|
7
7
|
}
|
|
@@ -165,13 +165,7 @@ Obey these rules for the whole session. Only the operator can make an exception.
|
|
|
165
165
|
- `(H)`, `(S)`, or `(P)` (headless): `flint orbh resume <id> "The Flint {{targetVersion}} sweep parked this session. Continue your work." -p "<Flint path>"`
|
|
166
166
|
- For the `machine` scope, use `--at machine` in place of `-p "<Flint path>"`.
|
|
167
167
|
5. Run `flint orbh list --all-scopes --print` again. Park each live session that woke.
|
|
168
|
-
6. **Obsidian.** Ask
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
flint migrate machine --json | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{for(const r of JSON.parse(s).flints)if(r.obsidian.vault==="open")console.log(r.label)})'
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
When a vault is still open, record it, and continue: the conversion of that Flint waits until a later `flint sync`.
|
|
168
|
+
6. **Obsidian.** Ask nothing about Obsidian. Obsidian can stay open, also the vault of the Computer Flint, where this session runs. When the vault of a Flint is open and its NUU Flint plugin answers, step l5 and `flint sync` convert the legacy payload and then reload that vault. The reload stops each terminal tab of that vault that runs a process, and the step names each such tab. When no plugin answers, or when the command runs in a terminal tab of that vault, the conversion waits for a later `flint sync` (section 7).
|
|
175
169
|
|
|
176
170
|
## 4. Phase 3 — copy every Flint first
|
|
177
171
|
|
|
@@ -253,10 +247,10 @@ It has these sections, and nothing about other machines:
|
|
|
253
247
|
- Synced: `yes`, `no: <reason>`, `-`
|
|
254
248
|
- Committed: `yes <short id>` (add the checkpoint id when there is one), `no change`, `box: not committed`, `no repository`, `-`
|
|
255
249
|
- Pushed: `yes`, `held (remote did not answer)`, `not pushed: <reason>`, `no upstream`, `-`
|
|
256
|
-
- Note: the `summary` line of a stop, the count of `shard-record/0.3` records, the next commands that the sync named,
|
|
250
|
+
- Note: the `summary` line of a stop, the count of `shard-record/0.3` records, the next commands that the sync named, a reload of Obsidian and the tabs that it stopped, a conversion that waits, the embedded repositories, the changed shard sources, the people whose commits the integration brought in (for information only), and each other fact.
|
|
257
251
|
3. **Parked sessions.** One table with the columns Session, Flint, Title, and Resume (the command of phase 2, step 4). Also each session that was not parked, with the reason.
|
|
258
252
|
4. **The backup folder.** The path, and how to put a copy back. To put the copy of one Flint back:
|
|
259
|
-
1.
|
|
253
|
+
1. Close the vault of that Flint in Obsidian, and park the sessions of that Flint.
|
|
260
254
|
2. Move the migrated folder into the backup folder, outside every box: `mv "<Flint path>" "{{backupFolder}}/<Copy> (migrated)"`.
|
|
261
255
|
3. Copy the backup back: `{{copyCommand}} "{{backupFolder}}/<Copy>" "<Flint path>"`.
|
|
262
256
|
4. A push stays on origin. The next `flint git sync` of the restored Flint brings the migration back from origin.
|
|
@@ -276,7 +270,7 @@ At the end, tell the operator the summary in the terminal: the count of Flints t
|
|
|
276
270
|
| More than one unfinished run | The run refuses. Record it. Never run `flint migrate rollback` (rule 4). |
|
|
277
271
|
| A shard gets a local address `@/shard/<slug>` | The run learns the owner of each repository from the registry. Record each local address in the note. |
|
|
278
272
|
| `Exports/` keeps entries | Normal. Step s7 removes only proved bundles, and prints one line with the size of each kept entry. |
|
|
279
|
-
| A vault is open | Step l5
|
|
273
|
+
| A vault is open | Step l5 converts the payload, and then reloads the vault through its NUU Flint plugin. The step names each terminal tab that the reload stopped. Record "Obsidian reloaded" and the tabs. With no live plugin, or with this session in a terminal tab of that vault, the conversion waits for a later `flint sync`: record "Obsidian waits". |
|
|
280
274
|
| A changed Flint-owned file of the Obsidian payload | Normal. Step l5 saves it in the Obsidian backup store and replaces it. |
|
|
281
275
|
| A changed personal file of the Obsidian payload (for example a snippet) | Step l5 stops, and names `flint obsidian repair --replace --dry-run`. The shared steps are complete: continue with the sync, the commit, and the push (phase 4, step 5). Record the file and the command for the operator. |
|
|
282
276
|
| Git tracks files under `.orb` or `.orbh` | Step s2 warns, and step l3 copies the tracked session spools into the local space. Untrack nothing (rule 6). |
|