@floless/app 0.155.2 → 0.157.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.
- package/cli-actions.mjs +392 -0
- package/dist/floless-server.cjs +182734 -141519
- package/dist/schemas/drawing-check.profile.v1.schema.json +15 -2
- package/dist/schemas/steel.model.v2.schema.json +25 -1
- package/dist/skills/floless-app-actions/SKILL.md +199 -0
- package/dist/skills/floless-app-approval/SKILL.md +8 -5
- package/dist/skills/floless-app-bridge/SKILL.md +12 -9
- package/dist/skills/floless-app-knowledge/SKILL.md +50 -14
- package/dist/skills/floless-app-new-workflow/SKILL.md +26 -10
- package/dist/skills/floless-app-onboarding/SKILL.md +31 -1
- package/dist/skills/floless-app-onboarding/references/aware-runtime.md +4 -4
- package/dist/skills/floless-app-queue/SKILL.md +10 -6
- package/dist/skills/floless-app-report-issue/SKILL.md +15 -12
- package/dist/skills/floless-app-rfi/SKILL.md +98 -73
- package/dist/skills/floless-app-routines/SKILL.md +27 -15
- package/dist/skills/floless-app-routines/references/routines-api.md +8 -2
- package/dist/skills/floless-app-steel-model/SKILL.md +1 -1
- package/dist/skills/floless-app-steel-model/references/detail-from-a-screenshot.md +4 -2
- package/dist/skills/floless-app-tweak-contract/SKILL.md +25 -5
- package/dist/skills/floless-app-workflows/SKILL.md +50 -13
- package/dist/skills/floless-app-workflows/references/agent-steps.md +119 -0
- package/dist/web/agent-steps.js +1750 -0
- package/dist/web/agents.js +33 -8
- package/dist/web/app.css +681 -4
- package/dist/web/app.js +111 -11
- package/dist/web/aware-update-client.js +1 -0
- package/dist/web/aware.js +1257 -202
- package/dist/web/chat-landing-scene.js +372 -0
- package/dist/web/chat.css +254 -1
- package/dist/web/chat.js +2657 -87
- package/dist/web/commands-drawing-check.js +17 -0
- package/dist/web/commands-shell.js +1108 -4
- package/dist/web/commands-steel.js +6 -0
- package/dist/web/connections.js +1 -0
- package/dist/web/drawing-check-editor.html +33 -5
- package/dist/web/drawing-check-editor.js +538 -22
- package/dist/web/drawing-check-overlay.js +13 -0
- package/dist/web/flo-avatar.js +28 -3
- package/dist/web/guide.js +7 -2
- package/dist/web/index.html +171 -7
- package/dist/web/instructor.js +6 -4
- package/dist/web/leave-guard.js +4 -2
- package/dist/web/left-pane.js +8 -3
- package/dist/web/model-revit-module.js +15 -0
- package/dist/web/model-view-query.js +12 -2
- package/dist/web/model-viewport-revit-adapter.js +3 -1
- package/dist/web/pages.js +891 -36
- package/dist/web/panels.js +8 -5
- package/dist/web/parser-setup-recovery.js +12 -4
- package/dist/web/project-access.js +549 -0
- package/dist/web/project-reconciliation.js +357 -0
- package/dist/web/report-files.js +50 -0
- package/dist/web/revit-editor.js +116 -27
- package/dist/web/startup-admission.js +132 -0
- package/dist/web/steel-3d-core.js +9 -0
- package/dist/web/steel-editor.html +642 -22
- package/dist/web/steel-model-v2-commands.js +63 -5
- package/dist/web/step-rename.js +287 -0
- package/dist/web/terminal-requests.js +590 -0
- package/dist/web/tool-updates.js +148 -13
- package/dist/web/workspace-root-management.js +39 -0
- package/dist/web/workspaces.js +1879 -74
- package/launch.mjs +82 -2
- package/package.json +3 -1
package/launch.mjs
CHANGED
|
@@ -12,13 +12,14 @@ import { spawn, execSync, execFileSync } from 'node:child_process';
|
|
|
12
12
|
import { dirname, join, basename } from 'node:path';
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
14
|
import { distributionProfile } from './distribution-profile-active.mjs';
|
|
15
|
-
import { existsSync } from 'node:fs';
|
|
15
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
16
16
|
import http from 'node:http';
|
|
17
17
|
import { createInterface } from 'node:readline';
|
|
18
18
|
import { rotateLog, openLogFd } from './log.mjs';
|
|
19
19
|
import { supervisorPidsToKill, teardownDecision, awareIsPresent, RUN_KEY, RUN_VALUE, PROTOCOL_KEY } from './teardown.mjs';
|
|
20
20
|
import { resolveRealInstallExe } from './install-path.mjs';
|
|
21
21
|
import { consumePostUpdateMarker } from './post-update-marker.mjs';
|
|
22
|
+
import { ACTIONS_CLI_COMMANDS, runActionsCli } from './cli-actions.mjs';
|
|
22
23
|
|
|
23
24
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
24
25
|
const PORT = Number(process.env.PORT ?? 4317);
|
|
@@ -530,6 +531,12 @@ export function parseAction(arg) {
|
|
|
530
531
|
return cmd;
|
|
531
532
|
}
|
|
532
533
|
|
|
534
|
+
// Is this argv[0] one of the actions verbs, typed as a bare word? A floless:// URI is never one: parseAction maps
|
|
535
|
+
// `floless://do` to "do", so this checks the raw word itself, never the parsed action.
|
|
536
|
+
export function isActionsCliCommand(arg) {
|
|
537
|
+
return typeof arg === 'string' && ACTIONS_CLI_COMMANDS.includes(arg);
|
|
538
|
+
}
|
|
539
|
+
|
|
533
540
|
// `floless update` via the npm bin lands here (bin/floless.mjs → launch.mjs).
|
|
534
541
|
// The npm install has no Velopack package to self-update — npm owns versions — so
|
|
535
542
|
// this is a deliberate no-op with the right instruction. The packaged exe never
|
|
@@ -633,6 +640,71 @@ export async function cmdUninstall(flags = {}) {
|
|
|
633
640
|
log('done. Finally, remove floless.app itself with: npm uninstall -g @floless/app');
|
|
634
641
|
}
|
|
635
642
|
|
|
643
|
+
const API_SNIPPET_CHARS = 300;
|
|
644
|
+
|
|
645
|
+
// One JSON request to the local server for the actions CLI: { status, body } (body parsed, or null), plus the start of
|
|
646
|
+
// the raw answer as `text` when it was not JSON (#2320: a 5xx HTML page is then reported, not just "not understood").
|
|
647
|
+
// Throws only when the server cannot be reached at all. A generous timeout: a read action runs the UI's own route in full.
|
|
648
|
+
export function apiRequest(method, path, body, { base = `http://127.0.0.1:${PORT}` } = {}) {
|
|
649
|
+
return new Promise((resolve, reject) => {
|
|
650
|
+
const payload = body === undefined ? undefined : JSON.stringify(body);
|
|
651
|
+
const req = http.request(`${base}${path}`, {
|
|
652
|
+
method, timeout: 120000,
|
|
653
|
+
headers: payload === undefined ? {} : { 'content-type': 'application/json', 'content-length': Buffer.byteLength(payload) },
|
|
654
|
+
}, (res) => {
|
|
655
|
+
let text = '';
|
|
656
|
+
res.setEncoding('utf8');
|
|
657
|
+
res.on('data', (c) => (text += c));
|
|
658
|
+
res.on('end', () => {
|
|
659
|
+
try { resolve({ status: res.statusCode ?? 0, body: text ? JSON.parse(text) : null }); }
|
|
660
|
+
catch { resolve({ status: res.statusCode ?? 0, body: null, text: text.slice(0, API_SNIPPET_CHARS) }); }
|
|
661
|
+
});
|
|
662
|
+
});
|
|
663
|
+
req.on('error', reject);
|
|
664
|
+
req.on('timeout', () => { req.destroy(new Error('FloLess took too long to answer')); });
|
|
665
|
+
if (payload !== undefined) req.write(payload);
|
|
666
|
+
req.end();
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
// `floless-app actions …` / `floless-app do …` (#2248). The launcher only wires the real world in: the server on
|
|
671
|
+
// PORT (started if it is not running, as `login` does — its progress goes to stderr so --json stays one envelope),
|
|
672
|
+
// the terminal, and Ctrl+C. Everything else is cli-actions.mjs, which is tested without any of it.
|
|
673
|
+
export async function cmdActionsCli(argv) {
|
|
674
|
+
const write = (stream, line) => { try { stream.write(`${line}\n`); } catch { /* no console */ } };
|
|
675
|
+
const say = (line) => write(process.stderr, line);
|
|
676
|
+
// Ctrl+C is taken over only while a `--wait` is listening for it (to stop waiting, or the run it waits on).
|
|
677
|
+
// Everywhere else — a slow read, a server that is starting — it ends the command as it always does.
|
|
678
|
+
const listeners = new Set();
|
|
679
|
+
// A second Ctrl+C always ends the command: the first only asks it to stop waiting, which a hung request could delay.
|
|
680
|
+
let sigints = 0;
|
|
681
|
+
const onSigint = () => { if (++sigints > 1) process.exit(130); for (const fn of listeners) fn(); };
|
|
682
|
+
try {
|
|
683
|
+
return await runActionsCli(argv, {
|
|
684
|
+
request: apiRequest,
|
|
685
|
+
ensureServer: async () => {
|
|
686
|
+
if (await ping()) return true;
|
|
687
|
+
say('Starting FloLess…');
|
|
688
|
+
startServerDetached();
|
|
689
|
+
return waitHealthy();
|
|
690
|
+
},
|
|
691
|
+
out: (text) => write(process.stdout, text),
|
|
692
|
+
err: say,
|
|
693
|
+
readFile: (file) => readFileSync(file, 'utf8'),
|
|
694
|
+
sleep: (ms) => new Promise((r) => setTimeout(r, ms)),
|
|
695
|
+
now: () => Date.now(),
|
|
696
|
+
onInterrupt: (fn) => {
|
|
697
|
+
if (!listeners.size) process.on('SIGINT', onSigint);
|
|
698
|
+
listeners.add(fn);
|
|
699
|
+
return () => { listeners.delete(fn); if (!listeners.size) process.off('SIGINT', onSigint); };
|
|
700
|
+
},
|
|
701
|
+
});
|
|
702
|
+
} finally {
|
|
703
|
+
listeners.clear();
|
|
704
|
+
process.off('SIGINT', onSigint);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
636
708
|
const ACTIONS = { open: cmdOpen, start: cmdStart, supervise: cmdSupervise, stop: cmdStop, restart: cmdRestart, login: cmdLogin, update: cmdUpdate, uninstall: cmdUninstall };
|
|
637
709
|
|
|
638
710
|
// Run one launcher action by name/URI. Shared by the npm bin (CLI shim below) and
|
|
@@ -642,9 +714,17 @@ const ACTIONS = { open: cmdOpen, start: cmdStart, supervise: cmdSupervise, stop:
|
|
|
642
714
|
export async function runAction(arg, flagArgv = [], selfVersion = null, selfChannel = null) {
|
|
643
715
|
_selfVersion = selfVersion;
|
|
644
716
|
_selfChannel = selfChannel;
|
|
717
|
+
// The actions verbs take their own arguments and set the exit code. Only ever from a typed command: a
|
|
718
|
+
// floless:// link (which any web page can open) never reaches them, so it cannot make FloLess do anything.
|
|
719
|
+
if (isActionsCliCommand(arg)) { process.exitCode = await cmdActionsCli([arg, ...flagArgv]); return; }
|
|
645
720
|
const cmd = parseAction(arg);
|
|
646
721
|
const action = ACTIONS[cmd];
|
|
647
|
-
if (!action
|
|
722
|
+
if (!action && ACTIONS_CLI_COMMANDS.includes(cmd)) {
|
|
723
|
+
// A floless:// link (which any web page can open) named an actions verb: refused, and said why.
|
|
724
|
+
log(`a link cannot make FloLess do anything — type "floless-app ${cmd} …" in a terminal instead`);
|
|
725
|
+
process.exit(2);
|
|
726
|
+
}
|
|
727
|
+
if (!action) { log(`unknown command "${cmd}" — use: open | start | supervise | stop | restart | login | update | uninstall | actions | do`); process.exit(2); }
|
|
648
728
|
await action(parseTeardownFlags(flagArgv));
|
|
649
729
|
}
|
|
650
730
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floless/app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.157.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
|
|
6
6
|
"bin": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"test:drawing-check": "tsx --test drawing-check.required.ts",
|
|
28
28
|
"test:project-import-pdf": "node build/run-required-tests.mjs projects-store.test.ts rfi-import.test.ts",
|
|
29
29
|
"test:platform": "node build/run-tests.mjs --platform-only",
|
|
30
|
+
"test:clock-skew": "node build/run-clock-skew-tests.mjs",
|
|
30
31
|
"build": "node build/bundle.mjs",
|
|
31
32
|
"build:exe": "node build/build-production.mjs",
|
|
32
33
|
"build:exe:app": "node build/bundle.mjs && node build/make-sea.mjs",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"verify:flo-naming": "node build/verify-flo-naming.mjs",
|
|
43
44
|
"verify:forward-merge": "node build/verify-forward-merge.mjs",
|
|
44
45
|
"verify:no-title": "node build/verify-no-title.mjs",
|
|
46
|
+
"verify:no-wallclock-asserts": "node build/verify-no-wallclock-asserts.mjs",
|
|
45
47
|
"verify:windows-hide": "node build/verify-windows-hide.mjs",
|
|
46
48
|
"verify:css-vars": "node build/verify-css-vars.mjs",
|
|
47
49
|
"verify:runtime-pins": "node build/verify-runtime-pins.mjs",
|