@aui.io/apollo 0.1.4
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/bin/apollo.js +13 -0
- package/node_modules/@aui.io/apollo-cli/bin/apollo.js +79 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.d.ts +4 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.js +99 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +234 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.js +34 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js +175 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/mockdb.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/mockdb.js +251 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/mockdb.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/operate.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/operate.js +138 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/operate.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/profile.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/profile.js +51 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/profile.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.d.ts +6 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.js +20 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime.d.ts +6 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime.js +2 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/shell.d.ts +10 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/shell.js +36 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/shell.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.js +57 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.js +35 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/workspace.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/workspace.js +170 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/workspace.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/index.d.ts +10 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js +107 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/meta.d.ts +4 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/meta.js +65 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/meta.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/output/welcome.d.ts +13 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/output/welcome.js +53 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/output/welcome.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/package.json +47 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.d.ts +6 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +23 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/client-types.d.ts +23 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/client-types.js +2 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/client-types.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/identity.d.ts +48 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/identity.js +131 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/identity.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.d.ts +92 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.js +126 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/mock-db.d.ts +65 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/mock-db.js +183 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/mock-db.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.d.ts +98 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js +70 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.d.ts +40 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +205 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/argv.d.ts +5 -0
- package/node_modules/@aui.io/apollo-core/dist/src/argv.js +43 -0
- package/node_modules/@aui.io/apollo-core/dist/src/argv.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.d.ts +17 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js +48 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/files.d.ts +7 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/files.js +69 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/files.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.d.ts +14 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.js +196 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.d.ts +30 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.js +36 -0
- package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.d.ts +11 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js +193 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/mockdb-keys.d.ts +14 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/mockdb-keys.js +54 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/mockdb-keys.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/store.d.ts +18 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/store.js +99 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/store.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/types.d.ts +62 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/types.js +2 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/types.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/errors/index.d.ts +42 -0
- package/node_modules/@aui.io/apollo-core/dist/src/errors/index.js +74 -0
- package/node_modules/@aui.io/apollo-core/dist/src/errors/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +32 -0
- package/node_modules/@aui.io/apollo-core/dist/src/index.js +32 -0
- package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/output/index.d.ts +29 -0
- package/node_modules/@aui.io/apollo-core/dist/src/output/index.js +49 -0
- package/node_modules/@aui.io/apollo-core/dist/src/output/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/auth.d.ts +10 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/auth.js +83 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/auth.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.d.ts +37 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js +161 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.d.ts +15 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +95 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.d.ts +11 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.js +19 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.d.ts +29 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js +117 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.d.ts +17 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js +99 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/mockdb.d.ts +71 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/mockdb.js +274 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/mockdb.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/profile.service.d.ts +16 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/profile.service.js +29 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/profile.service.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.d.ts +26 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js +109 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.d.ts +23 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.js +74 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/workspace.service.d.ts +44 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/workspace.service.js +148 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/workspace.service.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/skills/install.d.ts +6 -0
- package/node_modules/@aui.io/apollo-core/dist/src/skills/install.js +48 -0
- package/node_modules/@aui.io/apollo-core/dist/src/skills/install.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/workspace/store.d.ts +33 -0
- package/node_modules/@aui.io/apollo-core/dist/src/workspace/store.js +246 -0
- package/node_modules/@aui.io/apollo-core/dist/src/workspace/store.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/package.json +48 -0
- package/node_modules/@aui.io/apollo-tui/bin/apollo-tui.js +5 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/components/glyph.d.ts +19 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/components/glyph.js +41 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/components/glyph.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/index.d.ts +5 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/index.js +46 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/attractor.d.ts +82 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/attractor.js +231 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/attractor.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.d.ts +34 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +100 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.d.ts +14 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js +25 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.d.ts +25 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.js +99 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.d.ts +10 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.js +19 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.d.ts +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +449 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/bundle.d.ts +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/bundle.js +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/bundle.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/chat.d.ts +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/chat.js +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/chat.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/index.d.ts +5 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/index.js +6 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/mockdb.d.ts +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/mockdb.js +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/mockdb.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/overview.d.ts +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/overview.js +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/overview.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/scope.d.ts +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/scope.js +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/tabs/scope.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/package.json +53 -0
- package/package.json +42 -0
- package/scripts/setup-shell.mjs +68 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
export { GlyphController } from "./components/glyph.js";
|
|
4
|
+
export { GlyphSimulator, IDLE_CONFIG, WORKING_CONFIG, renderGlyphFrame, seedFromString, stepAttractor, } from "./lib/attractor.js";
|
|
5
|
+
export { SLASH_COMMANDS, filterCommands, resolveCommand } from "./lib/commands.js";
|
|
6
|
+
export { TABS } from "./lib/tabs.js";
|
|
7
|
+
export async function main(argv = []) {
|
|
8
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
9
|
+
process.stderr.write("apollo TUI requires a TTY. Use apollo <command> for scripting.\n");
|
|
10
|
+
return 1;
|
|
11
|
+
}
|
|
12
|
+
// OpenTUI's native renderer needs an FFI-capable runtime. Bun is the primary
|
|
13
|
+
// target; when launched from Node we re-exec the same entry under Bun.
|
|
14
|
+
if (typeof process.versions.bun !== "string") {
|
|
15
|
+
return respawnUnderBun(argv);
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const { runOpenTui } = await import("./opentui-app.js");
|
|
19
|
+
return await runOpenTui();
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
process.stderr.write(`apollo TUI engine failed to load (${error instanceof Error ? error.message : String(error)}).\n` +
|
|
23
|
+
"Your platform may not have OpenTUI native support. Use apollo <command> instead.\n");
|
|
24
|
+
return 1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function respawnUnderBun(argv) {
|
|
28
|
+
const entry = fileURLToPath(new URL("../../bin/apollo-tui.js", import.meta.url));
|
|
29
|
+
return new Promise((resolve) => {
|
|
30
|
+
const child = spawn("bun", [entry, ...argv], { stdio: "inherit" });
|
|
31
|
+
child.on("error", (error) => {
|
|
32
|
+
if (error.code === "ENOENT") {
|
|
33
|
+
process.stderr.write("apollo TUI runs on Bun and it was not found on your PATH.\n" +
|
|
34
|
+
"Install it (https://bun.sh) or keep using apollo <command> directly.\n");
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
process.stderr.write(`apollo TUI failed to start: ${error.message}\n`);
|
|
38
|
+
}
|
|
39
|
+
resolve(1);
|
|
40
|
+
});
|
|
41
|
+
child.on("exit", (code, signal) => {
|
|
42
|
+
resolve(signal ? 1 : (code ?? 0));
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;A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AC;IACjF,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACnE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAA4B,EAAE,EAAE;YACjD,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,6DAA6D;oBAC3D,wEAAwE,CAC3E,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;YACzE,CAAC;YACD,OAAO,CAAC,CAAC,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YAChC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strange-attractor dynamics for the Apollo brand glyph — a thought-orb.
|
|
3
|
+
*
|
|
4
|
+
* Motion model: the orb is a rigid dotted sphere (Fibonacci lattice); the
|
|
5
|
+
* attractor never displaces its points. It acts as the orb's nervous system —
|
|
6
|
+
* - spin: yaw rate modulated by the attractor's x component
|
|
7
|
+
* - tilt: nodding precession driven by the y component
|
|
8
|
+
* - saccade: a critically damped rotation kick on lobe transitions
|
|
9
|
+
* - breath: sub-pixel scale oscillation from the z component
|
|
10
|
+
* The geometry is invariant (always the sphere); chaos only modulates the
|
|
11
|
+
* parameters of controlled motion. Rendering uses Braille sub-pixels; only
|
|
12
|
+
* the front hemisphere is drawn so it reads as a solid orb, not a dot cloud.
|
|
13
|
+
*/
|
|
14
|
+
export interface Vec3 {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
z: number;
|
|
18
|
+
}
|
|
19
|
+
export interface AttractorConfig {
|
|
20
|
+
/** Integration step; larger = more energetic ("working" state). */
|
|
21
|
+
dt: number;
|
|
22
|
+
/** Overall glyph size multiplier. */
|
|
23
|
+
scale: number;
|
|
24
|
+
/** Which attractor family to integrate. */
|
|
25
|
+
kind: "thomas" | "lorenz";
|
|
26
|
+
/** Base spin rate (rad/s) — the "control" component. */
|
|
27
|
+
spin: number;
|
|
28
|
+
/** How strongly the attractor's x modulates spin — the "chaos" component. */
|
|
29
|
+
drive: number;
|
|
30
|
+
/** Saccade amplitude (rad) kicked on attractor lobe flips. */
|
|
31
|
+
saccadeKick: number;
|
|
32
|
+
/** Breathing depth (relative scale amplitude). */
|
|
33
|
+
breath: number;
|
|
34
|
+
/** Tilt precession rate (rad/s) for the pseudo-3D tumble. */
|
|
35
|
+
tilt: number;
|
|
36
|
+
}
|
|
37
|
+
export declare const IDLE_CONFIG: AttractorConfig;
|
|
38
|
+
export declare const WORKING_CONFIG: AttractorConfig;
|
|
39
|
+
/** Thomas' cyclically symmetric attractor — calm meanders, good for idle. */
|
|
40
|
+
export declare function thomasStep(state: Vec3, dt: number, b?: number): Vec3;
|
|
41
|
+
/** Classic Lorenz butterfly — more dramatic lobe flips. */
|
|
42
|
+
export declare function lorenzStep(state: Vec3, dt: number, sigma?: number, rho?: number, beta?: number): Vec3;
|
|
43
|
+
export declare function stepAttractor(state: Vec3, config: AttractorConfig): Vec3;
|
|
44
|
+
/** Deterministic seed from an agent id (or any string). */
|
|
45
|
+
export declare function seedFromString(input: string): Vec3;
|
|
46
|
+
export interface GlyphNode {
|
|
47
|
+
homeX: number;
|
|
48
|
+
homeY: number;
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
}
|
|
52
|
+
export declare class GlyphSimulator {
|
|
53
|
+
private state;
|
|
54
|
+
private config;
|
|
55
|
+
private theta;
|
|
56
|
+
private phi;
|
|
57
|
+
private saccade;
|
|
58
|
+
private saccadeVel;
|
|
59
|
+
private saccadeTarget;
|
|
60
|
+
private lastLobe;
|
|
61
|
+
constructor(seed?: string, config?: AttractorConfig);
|
|
62
|
+
setConfig(config: AttractorConfig): void;
|
|
63
|
+
tick(): GlyphNode[];
|
|
64
|
+
}
|
|
65
|
+
export interface GlyphFrameOptions {
|
|
66
|
+
/** Frame width in character cells. */
|
|
67
|
+
width?: number;
|
|
68
|
+
/** Frame height in character cells. */
|
|
69
|
+
height?: number;
|
|
70
|
+
/** Render the resting orb (reduced motion). */
|
|
71
|
+
staticMode?: boolean;
|
|
72
|
+
/** Ghost dots from previous frames for motion-blur texture. */
|
|
73
|
+
trails?: readonly {
|
|
74
|
+
x: number;
|
|
75
|
+
y: number;
|
|
76
|
+
}[];
|
|
77
|
+
/** Kept for API compatibility; orb dots are always single-dot. */
|
|
78
|
+
compact?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/** Render orb dots (unit space) onto a Braille sub-pixel character grid. */
|
|
81
|
+
export declare function renderGlyphFrame(nodes: GlyphNode[], options?: GlyphFrameOptions): string[];
|
|
82
|
+
export declare function prefersReducedMotion(): boolean;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strange-attractor dynamics for the Apollo brand glyph — a thought-orb.
|
|
3
|
+
*
|
|
4
|
+
* Motion model: the orb is a rigid dotted sphere (Fibonacci lattice); the
|
|
5
|
+
* attractor never displaces its points. It acts as the orb's nervous system —
|
|
6
|
+
* - spin: yaw rate modulated by the attractor's x component
|
|
7
|
+
* - tilt: nodding precession driven by the y component
|
|
8
|
+
* - saccade: a critically damped rotation kick on lobe transitions
|
|
9
|
+
* - breath: sub-pixel scale oscillation from the z component
|
|
10
|
+
* The geometry is invariant (always the sphere); chaos only modulates the
|
|
11
|
+
* parameters of controlled motion. Rendering uses Braille sub-pixels; only
|
|
12
|
+
* the front hemisphere is drawn so it reads as a solid orb, not a dot cloud.
|
|
13
|
+
*/
|
|
14
|
+
export const IDLE_CONFIG = {
|
|
15
|
+
dt: 0.03,
|
|
16
|
+
scale: 1,
|
|
17
|
+
kind: "thomas",
|
|
18
|
+
spin: 0.55,
|
|
19
|
+
drive: 0.45,
|
|
20
|
+
saccadeKick: 0.85,
|
|
21
|
+
breath: 0.05,
|
|
22
|
+
tilt: 0.65,
|
|
23
|
+
};
|
|
24
|
+
export const WORKING_CONFIG = {
|
|
25
|
+
dt: 0.055,
|
|
26
|
+
scale: 1,
|
|
27
|
+
kind: "thomas",
|
|
28
|
+
spin: 1.7,
|
|
29
|
+
drive: 0.9,
|
|
30
|
+
saccadeKick: 1.25,
|
|
31
|
+
breath: 0.09,
|
|
32
|
+
tilt: 1.5,
|
|
33
|
+
};
|
|
34
|
+
/** Thomas' cyclically symmetric attractor — calm meanders, good for idle. */
|
|
35
|
+
export function thomasStep(state, dt, b = 0.208186) {
|
|
36
|
+
const { x, y, z } = state;
|
|
37
|
+
return {
|
|
38
|
+
x: x + dt * (Math.sin(y) - b * x),
|
|
39
|
+
y: y + dt * (Math.sin(z) - b * y),
|
|
40
|
+
z: z + dt * (Math.sin(x) - b * z),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** Classic Lorenz butterfly — more dramatic lobe flips. */
|
|
44
|
+
export function lorenzStep(state, dt, sigma = 10, rho = 28, beta = 8 / 3) {
|
|
45
|
+
const { x, y, z } = state;
|
|
46
|
+
return {
|
|
47
|
+
x: x + dt * (sigma * (y - x)),
|
|
48
|
+
y: y + dt * (x * (rho - z) - y),
|
|
49
|
+
z: z + dt * (x * y - beta * z),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function stepAttractor(state, config) {
|
|
53
|
+
return config.kind === "lorenz"
|
|
54
|
+
? lorenzStep(state, config.dt)
|
|
55
|
+
: thomasStep(state, config.dt);
|
|
56
|
+
}
|
|
57
|
+
/** Deterministic seed from an agent id (or any string). */
|
|
58
|
+
export function seedFromString(input) {
|
|
59
|
+
let h = 2166136261;
|
|
60
|
+
for (let i = 0; i < input.length; i++) {
|
|
61
|
+
h ^= input.charCodeAt(i);
|
|
62
|
+
h = Math.imul(h, 16777619);
|
|
63
|
+
}
|
|
64
|
+
const a = (h >>> 0) / 0xffffffff;
|
|
65
|
+
const b = ((h * 2654435761) >>> 0) / 0xffffffff;
|
|
66
|
+
const c = ((h * 2246822519) >>> 0) / 0xffffffff;
|
|
67
|
+
return {
|
|
68
|
+
x: 0.1 + a * 0.4,
|
|
69
|
+
y: 0.1 + b * 0.4,
|
|
70
|
+
z: 0.1 + c * 0.4,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** Fibonacci-lattice points on the unit sphere — the orb's surface dots. */
|
|
74
|
+
const ORB_POINT_COUNT = 92;
|
|
75
|
+
const ORB_POINTS = (() => {
|
|
76
|
+
const points = [];
|
|
77
|
+
const golden = Math.PI * (3 - Math.sqrt(5));
|
|
78
|
+
for (let i = 0; i < ORB_POINT_COUNT; i++) {
|
|
79
|
+
const y = 1 - (2 * (i + 0.5)) / ORB_POINT_COUNT;
|
|
80
|
+
const r = Math.sqrt(1 - y * y);
|
|
81
|
+
const a = golden * i;
|
|
82
|
+
points.push({ x: Math.cos(a) * r, y, z: Math.sin(a) * r });
|
|
83
|
+
}
|
|
84
|
+
return points;
|
|
85
|
+
})();
|
|
86
|
+
/** Hide dots beyond this depth so the orb reads as a surface, not a cloud. */
|
|
87
|
+
const ORB_HORIZON = -0.08;
|
|
88
|
+
function projectOrb(yaw, pitch, scale) {
|
|
89
|
+
const cy = Math.cos(yaw);
|
|
90
|
+
const sy = Math.sin(yaw);
|
|
91
|
+
const cp = Math.cos(pitch);
|
|
92
|
+
const sp = Math.sin(pitch);
|
|
93
|
+
const nodes = [];
|
|
94
|
+
for (const p of ORB_POINTS) {
|
|
95
|
+
// Yaw about the vertical axis, then pitch (nod) about the horizontal.
|
|
96
|
+
const x1 = p.x * cy + p.z * sy;
|
|
97
|
+
const z1 = -p.x * sy + p.z * cy;
|
|
98
|
+
const y2 = p.y * cp - z1 * sp;
|
|
99
|
+
const z2 = p.y * sp + z1 * cp;
|
|
100
|
+
if (z2 < ORB_HORIZON)
|
|
101
|
+
continue; // back hemisphere
|
|
102
|
+
nodes.push({ homeX: p.x, homeY: p.y, x: x1 * scale, y: y2 * scale });
|
|
103
|
+
}
|
|
104
|
+
return nodes;
|
|
105
|
+
}
|
|
106
|
+
const FRAME_DT = 1 / 30;
|
|
107
|
+
const SPRING_K = 60;
|
|
108
|
+
const SPRING_DAMP = 2 * Math.sqrt(SPRING_K); // critically damped — no overshoot
|
|
109
|
+
const TWO_PI = Math.PI * 2;
|
|
110
|
+
export class GlyphSimulator {
|
|
111
|
+
state;
|
|
112
|
+
config;
|
|
113
|
+
theta = 0;
|
|
114
|
+
phi = 0;
|
|
115
|
+
saccade = 0;
|
|
116
|
+
saccadeVel = 0;
|
|
117
|
+
saccadeTarget = 0;
|
|
118
|
+
lastLobe;
|
|
119
|
+
constructor(seed = "apollo", config = IDLE_CONFIG) {
|
|
120
|
+
this.state = seedFromString(seed);
|
|
121
|
+
this.config = config;
|
|
122
|
+
this.lastLobe = Math.sign(this.state.x) || 1;
|
|
123
|
+
// Desynchronize the initial pose per seed.
|
|
124
|
+
this.theta = (this.state.y + this.state.z) * 7;
|
|
125
|
+
this.phi = this.state.x * 5;
|
|
126
|
+
}
|
|
127
|
+
setConfig(config) {
|
|
128
|
+
this.config = config;
|
|
129
|
+
}
|
|
130
|
+
tick() {
|
|
131
|
+
const c = this.config;
|
|
132
|
+
// Two attractor substeps per frame keep the modulation smooth at 30fps.
|
|
133
|
+
this.state = stepAttractor(this.state, c);
|
|
134
|
+
this.state = stepAttractor(this.state, c);
|
|
135
|
+
// Saccade: a lobe transition in the dynamics is the "decision" moment —
|
|
136
|
+
// kick a spring-damped rotation that darts and lands cleanly.
|
|
137
|
+
const lobe = Math.sign(this.state.x) || 1;
|
|
138
|
+
if (lobe !== this.lastLobe) {
|
|
139
|
+
this.lastLobe = lobe;
|
|
140
|
+
this.saccadeTarget +=
|
|
141
|
+
lobe * c.saccadeKick * (0.8 + 0.4 * Math.min(1, Math.abs(this.state.y)));
|
|
142
|
+
}
|
|
143
|
+
const accel = SPRING_K * (this.saccadeTarget - this.saccade) - SPRING_DAMP * this.saccadeVel;
|
|
144
|
+
this.saccadeVel += accel * FRAME_DT;
|
|
145
|
+
this.saccade += this.saccadeVel * FRAME_DT;
|
|
146
|
+
// Spin: controlled base rate, chaotically modulated (may hesitate/reverse).
|
|
147
|
+
this.theta += (c.spin + c.drive * this.state.x) * FRAME_DT;
|
|
148
|
+
// Tilt precession for the pseudo-3D tumble.
|
|
149
|
+
this.phi += (c.tilt + 0.5 * Math.tanh(this.state.y)) * FRAME_DT;
|
|
150
|
+
// Keep angles bounded over long sessions without visible discontinuity.
|
|
151
|
+
if (Math.abs(this.theta) > 1e4)
|
|
152
|
+
this.theta %= TWO_PI;
|
|
153
|
+
if (Math.abs(this.phi) > 1e4)
|
|
154
|
+
this.phi %= TWO_PI;
|
|
155
|
+
if (Math.abs(this.saccadeTarget) > 1e4) {
|
|
156
|
+
const wrap = Math.floor(this.saccadeTarget / TWO_PI) * TWO_PI;
|
|
157
|
+
this.saccadeTarget -= wrap;
|
|
158
|
+
this.saccade -= wrap;
|
|
159
|
+
}
|
|
160
|
+
// Breathing: shallow, slow scale oscillation — "alive at rest".
|
|
161
|
+
const breathScale = 1 + c.breath * Math.tanh(this.state.z * 0.5);
|
|
162
|
+
const yaw = this.theta + this.saccade;
|
|
163
|
+
// Gentle nodding tilt so the dot bands sweep in 3D instead of flat lines.
|
|
164
|
+
const pitch = 0.4 + 0.3 * Math.sin(this.phi);
|
|
165
|
+
return projectOrb(yaw, pitch, breathScale * c.scale);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Braille cell bit layout: BRAILLE_BITS[rowInCell][colInCell]
|
|
169
|
+
const BRAILLE_BITS = [
|
|
170
|
+
[0x01, 0x08],
|
|
171
|
+
[0x02, 0x10],
|
|
172
|
+
[0x04, 0x20],
|
|
173
|
+
[0x40, 0x80],
|
|
174
|
+
];
|
|
175
|
+
class BrailleCanvas {
|
|
176
|
+
width;
|
|
177
|
+
height;
|
|
178
|
+
dotsW;
|
|
179
|
+
dotsH;
|
|
180
|
+
cells;
|
|
181
|
+
constructor(width, height) {
|
|
182
|
+
this.width = width;
|
|
183
|
+
this.height = height;
|
|
184
|
+
this.dotsW = width * 2;
|
|
185
|
+
this.dotsH = height * 4;
|
|
186
|
+
this.cells = new Array(width * height).fill(0);
|
|
187
|
+
}
|
|
188
|
+
set(x, y) {
|
|
189
|
+
const dx = Math.round(x);
|
|
190
|
+
const dy = Math.round(y);
|
|
191
|
+
if (dx < 0 || dy < 0 || dx >= this.dotsW || dy >= this.dotsH)
|
|
192
|
+
return;
|
|
193
|
+
const cell = Math.floor(dy / 4) * this.width + Math.floor(dx / 2);
|
|
194
|
+
this.cells[cell] = (this.cells[cell] ?? 0) | BRAILLE_BITS[dy % 4][dx % 2];
|
|
195
|
+
}
|
|
196
|
+
render() {
|
|
197
|
+
const rows = [];
|
|
198
|
+
for (let r = 0; r < this.height; r++) {
|
|
199
|
+
let row = "";
|
|
200
|
+
for (let col = 0; col < this.width; col++) {
|
|
201
|
+
const mask = this.cells[r * this.width + col];
|
|
202
|
+
row += mask === 0 ? " " : String.fromCharCode(0x2800 + mask);
|
|
203
|
+
}
|
|
204
|
+
rows.push(row);
|
|
205
|
+
}
|
|
206
|
+
return rows;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/** Render orb dots (unit space) onto a Braille sub-pixel character grid. */
|
|
210
|
+
export function renderGlyphFrame(nodes, options = {}) {
|
|
211
|
+
const width = options.width ?? 14;
|
|
212
|
+
const height = options.height ?? 7;
|
|
213
|
+
const canvas = new BrailleCanvas(width, height);
|
|
214
|
+
const cx = canvas.dotsW / 2 - 0.5;
|
|
215
|
+
const cy = canvas.dotsH / 2 - 0.5;
|
|
216
|
+
const radius = Math.min(canvas.dotsW, canvas.dotsH) / 2 - 1;
|
|
217
|
+
const px = (u) => cx + u * radius;
|
|
218
|
+
const py = (u) => cy + u * radius;
|
|
219
|
+
const points = options.staticMode ? projectOrb(0.6, 0.4, 0.96) : nodes;
|
|
220
|
+
for (const t of options.trails ?? []) {
|
|
221
|
+
canvas.set(px(t.x), py(t.y));
|
|
222
|
+
}
|
|
223
|
+
for (const p of points) {
|
|
224
|
+
canvas.set(px(p.x), py(p.y));
|
|
225
|
+
}
|
|
226
|
+
return canvas.render();
|
|
227
|
+
}
|
|
228
|
+
export function prefersReducedMotion() {
|
|
229
|
+
return process.env.APOLLO_REDUCED_MOTION === "1";
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=attractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attractor.js","sourceRoot":"","sources":["../../../src/lib/attractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA2BH,MAAM,CAAC,MAAM,WAAW,GAAoB;IAC1C,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC7C,EAAE,EAAE,KAAK;IACT,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;IACV,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,GAAG;CACV,CAAC;AAEF,6EAA6E;AAC7E,MAA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AG,CAAC,CAAS,EAAU,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IAClD,MAAM,EAAE,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IAElD,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAEvE,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,GAAG,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Command registry + sheet field vocabulary for the TUI palette. */
|
|
2
|
+
export type FieldControl = "picker" | "text" | "path" | "toggle" | "chips" | "json" | "number" | "confirm" | "advanced";
|
|
3
|
+
export interface CommandField {
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
control: FieldControl;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
advanced?: boolean;
|
|
9
|
+
defaultValue?: string | boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SlashCommand {
|
|
12
|
+
name: string;
|
|
13
|
+
summary: string;
|
|
14
|
+
tab?: "overview" | "chat" | "bundle" | "mockdb" | "scope";
|
|
15
|
+
/** Jump to tab instead of running a service. */
|
|
16
|
+
jumpTab?: "overview" | "chat" | "bundle" | "mockdb" | "scope";
|
|
17
|
+
fields?: CommandField[];
|
|
18
|
+
/** Destructive — opens typed-confirm modal. */
|
|
19
|
+
destructive?: boolean;
|
|
20
|
+
/** Requires auth; opens login modal when unauthenticated. */
|
|
21
|
+
requiresAuth?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const SLASH_COMMANDS: SlashCommand[];
|
|
24
|
+
export declare function filterCommands(query: string): SlashCommand[];
|
|
25
|
+
export declare function resolveCommand(line: string): {
|
|
26
|
+
command?: SlashCommand;
|
|
27
|
+
args: string;
|
|
28
|
+
};
|
|
29
|
+
export interface SheetState {
|
|
30
|
+
command: SlashCommand;
|
|
31
|
+
values: Record<string, string | boolean>;
|
|
32
|
+
advancedOpen: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function openSheet(command: SlashCommand): SheetState | undefined;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** Command registry + sheet field vocabulary for the TUI palette. */
|
|
2
|
+
export const SLASH_COMMANDS = [
|
|
3
|
+
{ name: "help", summary: "show available commands" },
|
|
4
|
+
{ name: "quit", summary: "exit the TUI" },
|
|
5
|
+
{ name: "status", summary: "inspect context and service health", requiresAuth: true },
|
|
6
|
+
{
|
|
7
|
+
name: "login",
|
|
8
|
+
summary: "authenticate with Apollo",
|
|
9
|
+
tab: "scope",
|
|
10
|
+
fields: [
|
|
11
|
+
{ name: "env", label: "Environment", control: "picker", required: true },
|
|
12
|
+
{ name: "method", label: "Method", control: "picker", defaultValue: "browser" },
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
{ name: "logout", summary: "clear credentials", destructive: true, requiresAuth: true },
|
|
16
|
+
{ name: "chat", summary: "open Chat tab", jumpTab: "chat" },
|
|
17
|
+
{ name: "bundle", summary: "open Bundle tab", jumpTab: "bundle" },
|
|
18
|
+
{ name: "mockdb", summary: "open Mock DB tab", jumpTab: "mockdb" },
|
|
19
|
+
{ name: "scope", summary: "open Scope tab", jumpTab: "scope" },
|
|
20
|
+
{
|
|
21
|
+
name: "push",
|
|
22
|
+
summary: "push local bundle",
|
|
23
|
+
tab: "bundle",
|
|
24
|
+
requiresAuth: true,
|
|
25
|
+
fields: [
|
|
26
|
+
{ name: "message", label: "Commit message", control: "text", required: true },
|
|
27
|
+
{ name: "dryRun", label: "Dry run", control: "toggle", defaultValue: false },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "pull",
|
|
32
|
+
summary: "pull remote version",
|
|
33
|
+
tab: "bundle",
|
|
34
|
+
requiresAuth: true,
|
|
35
|
+
fields: [
|
|
36
|
+
{ name: "tag", label: "Version tag", control: "picker", defaultValue: "latest" },
|
|
37
|
+
{ name: "dir", label: "Directory", control: "path", advanced: true },
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{ name: "validate", summary: "validate local program", tab: "bundle", requiresAuth: true },
|
|
41
|
+
{ name: "diff", summary: "diff vs baseline or remote", tab: "bundle", requiresAuth: true },
|
|
42
|
+
{
|
|
43
|
+
name: "thread",
|
|
44
|
+
summary: "pick or create a chat thread",
|
|
45
|
+
tab: "chat",
|
|
46
|
+
requiresAuth: true,
|
|
47
|
+
fields: [{ name: "thread", label: "Thread", control: "picker" }],
|
|
48
|
+
},
|
|
49
|
+
{ name: "new", summary: "start a new chat thread", tab: "chat", requiresAuth: true },
|
|
50
|
+
{ name: "trace", summary: "toggle reply traces", tab: "chat" },
|
|
51
|
+
{ name: "local", summary: "toggle local bundle mode", tab: "chat" },
|
|
52
|
+
{
|
|
53
|
+
name: "var",
|
|
54
|
+
summary: "add agent variable chip",
|
|
55
|
+
tab: "chat",
|
|
56
|
+
fields: [{ name: "pair", label: "key=value", control: "chips", required: true }],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "provision",
|
|
60
|
+
summary: "provision mock database",
|
|
61
|
+
tab: "mockdb",
|
|
62
|
+
requiresAuth: true,
|
|
63
|
+
fields: [
|
|
64
|
+
{ name: "wire", label: "Wire connections.yaml", control: "toggle", defaultValue: true },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{ name: "upgrade", summary: "upgrade Apollo packages", requiresAuth: false },
|
|
68
|
+
];
|
|
69
|
+
export function filterCommands(query) {
|
|
70
|
+
const q = query.replace(/^\//, "").trim().toLowerCase();
|
|
71
|
+
if (!q)
|
|
72
|
+
return SLASH_COMMANDS;
|
|
73
|
+
return SLASH_COMMANDS.filter((cmd) => cmd.name.includes(q) || cmd.summary.toLowerCase().includes(q));
|
|
74
|
+
}
|
|
75
|
+
export function resolveCommand(line) {
|
|
76
|
+
const trimmed = line.trim();
|
|
77
|
+
if (!trimmed.startsWith("/"))
|
|
78
|
+
return { args: trimmed };
|
|
79
|
+
const body = trimmed.slice(1);
|
|
80
|
+
const space = body.search(/\s/);
|
|
81
|
+
const name = (space === -1 ? body : body.slice(0, space)).toLowerCase();
|
|
82
|
+
const args = space === -1 ? "" : body.slice(space + 1).trim();
|
|
83
|
+
const command = SLASH_COMMANDS.find((cmd) => cmd.name === name);
|
|
84
|
+
return { command, args };
|
|
85
|
+
}
|
|
86
|
+
export function openSheet(command) {
|
|
87
|
+
if (!command.fields?.length && !command.destructive)
|
|
88
|
+
return undefined;
|
|
89
|
+
const values = {};
|
|
90
|
+
for (const field of command.fields ?? []) {
|
|
91
|
+
if (field.defaultValue !== undefined)
|
|
92
|
+
values[field.name] = field.defaultValue;
|
|
93
|
+
else if (field.control === "toggle")
|
|
94
|
+
values[field.name] = false;
|
|
95
|
+
else
|
|
96
|
+
values[field.name] = "";
|
|
97
|
+
}
|
|
98
|
+
return { command, values, advancedOpen: false };
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../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AAY,EAAE,KAAK,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Context } from "@aui.io/apollo-core/config/types.js";
|
|
2
|
+
export interface ScopeStrip {
|
|
3
|
+
env: string;
|
|
4
|
+
agent: string;
|
|
5
|
+
version: string;
|
|
6
|
+
loggedIn: boolean;
|
|
7
|
+
agentPath?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function scopeFromContext(context: Context): ScopeStrip;
|
|
10
|
+
export declare function formatFooter(scope: ScopeStrip): string;
|
|
11
|
+
export declare function formatTabBar(active: string, tabs: {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}[]): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function scopeFromContext(context) {
|
|
2
|
+
const agent = context.agentId?.slice(0, 12) ??
|
|
3
|
+
(context.agentRoot ? context.agentRoot.split("/").pop() : undefined) ??
|
|
4
|
+
"—";
|
|
5
|
+
return {
|
|
6
|
+
env: context.environment,
|
|
7
|
+
agent,
|
|
8
|
+
version: context.versionTag ?? "—",
|
|
9
|
+
loggedIn: Boolean(context.token),
|
|
10
|
+
...(context.agentRoot ? { agentPath: context.agentRoot } : {}),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function formatFooter(scope) {
|
|
14
|
+
const left = "? shortcuts · ⌘1–5 tabs";
|
|
15
|
+
const right = `${scope.env} · ${scope.agent} · ${scope.version}`;
|
|
16
|
+
const width = process.stdout.columns && process.stdout.columns > 40 ? process.stdout.columns : 80;
|
|
17
|
+
const gap = Math.max(1, width - left.length - right.length - 4);
|
|
18
|
+
return `─ ${left}${" ".repeat(gap)}${right} ─`;
|
|
19
|
+
}
|
|
20
|
+
export function formatTabBar(active, tabs) {
|
|
21
|
+
return tabs
|
|
22
|
+
.map((tab) => (tab.id === active ? `[${tab.label}]` : ` ${tab.label} `))
|
|
23
|
+
.join(" ");
|
|
24
|
+
}
|
|
25
|
+
//# source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AAK,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,IAAI,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,IAAqC;IAChF,OAAO,IAAI;SACR,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;SACvE,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type FieldControl = "picker" | "text" | "path" | "toggle" | "chips" | "json" | "number" | "confirm" | "advanced";
|
|
2
|
+
export interface CommandField {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
control: FieldControl;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
advanced?: boolean;
|
|
8
|
+
defaultValue?: string | boolean;
|
|
9
|
+
}
|
|
10
|
+
export type SheetValues = Record<string, string | boolean>;
|
|
11
|
+
export interface CommandSheetModel {
|
|
12
|
+
title: string;
|
|
13
|
+
fields: CommandField[];
|
|
14
|
+
values: SheetValues;
|
|
15
|
+
advancedOpen: boolean;
|
|
16
|
+
focused: number;
|
|
17
|
+
error?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function createSheet(title: string, fields: CommandField[]): CommandSheetModel;
|
|
20
|
+
export declare function visibleFields(sheet: CommandSheetModel): CommandField[];
|
|
21
|
+
export declare function toggleFocused(sheet: CommandSheetModel): CommandSheetModel;
|
|
22
|
+
export declare function setFocusedValue(sheet: CommandSheetModel, value: string): CommandSheetModel;
|
|
23
|
+
export declare function moveFocus(sheet: CommandSheetModel, delta: number): CommandSheetModel;
|
|
24
|
+
export declare function validateSheet(sheet: CommandSheetModel): string | undefined;
|
|
25
|
+
export declare function renderSheet(sheet: CommandSheetModel): string[];
|