@everywheredev/cli 0.0.5 → 0.0.7
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 -1
- package/dist/index.js +274 -59
- package/package.json +3 -2
- package/scripts/build.mjs +68 -0
- package/dist/agent/agent-loop.d.ts +0 -40
- package/dist/agent/agent-loop.d.ts.map +0 -1
- package/dist/agent/agent-loop.js +0 -162
- package/dist/agent/agent-loop.js.map +0 -1
- package/dist/agent/approval.d.ts +0 -38
- package/dist/agent/approval.d.ts.map +0 -1
- package/dist/agent/approval.js +0 -55
- package/dist/agent/approval.js.map +0 -1
- package/dist/agent/run-tracker.d.ts +0 -26
- package/dist/agent/run-tracker.d.ts.map +0 -1
- package/dist/agent/run-tracker.js +0 -43
- package/dist/agent/run-tracker.js.map +0 -1
- package/dist/auth/device-flow.d.ts +0 -61
- package/dist/auth/device-flow.d.ts.map +0 -1
- package/dist/auth/device-flow.js +0 -141
- package/dist/auth/device-flow.js.map +0 -1
- package/dist/auth/hydra-oauth-auth-provider.d.ts +0 -35
- package/dist/auth/hydra-oauth-auth-provider.d.ts.map +0 -1
- package/dist/auth/hydra-oauth-auth-provider.js +0 -153
- package/dist/auth/hydra-oauth-auth-provider.js.map +0 -1
- package/dist/auth/keychain.d.ts +0 -42
- package/dist/auth/keychain.d.ts.map +0 -1
- package/dist/auth/keychain.js +0 -138
- package/dist/auth/keychain.js.map +0 -1
- package/dist/auth/pkce.d.ts +0 -20
- package/dist/auth/pkce.d.ts.map +0 -1
- package/dist/auth/pkce.js +0 -44
- package/dist/auth/pkce.js.map +0 -1
- package/dist/auth/ports.d.ts +0 -25
- package/dist/auth/ports.d.ts.map +0 -1
- package/dist/auth/ports.js +0 -8
- package/dist/auth/ports.js.map +0 -1
- package/dist/commands/activity.d.ts +0 -17
- package/dist/commands/activity.d.ts.map +0 -1
- package/dist/commands/activity.js +0 -54
- package/dist/commands/activity.js.map +0 -1
- package/dist/commands/agent.d.ts +0 -25
- package/dist/commands/agent.d.ts.map +0 -1
- package/dist/commands/agent.js +0 -80
- package/dist/commands/agent.js.map +0 -1
- package/dist/commands/agents.d.ts +0 -9
- package/dist/commands/agents.d.ts.map +0 -1
- package/dist/commands/agents.js +0 -28
- package/dist/commands/agents.js.map +0 -1
- package/dist/commands/commits.d.ts +0 -16
- package/dist/commands/commits.d.ts.map +0 -1
- package/dist/commands/commits.js +0 -39
- package/dist/commands/commits.js.map +0 -1
- package/dist/commands/diff.d.ts +0 -15
- package/dist/commands/diff.d.ts.map +0 -1
- package/dist/commands/diff.js +0 -27
- package/dist/commands/diff.js.map +0 -1
- package/dist/commands/expose.d.ts +0 -15
- package/dist/commands/expose.d.ts.map +0 -1
- package/dist/commands/expose.js +0 -39
- package/dist/commands/expose.js.map +0 -1
- package/dist/commands/index.d.ts +0 -7
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -12
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/login.d.ts +0 -9
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -27
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -9
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/logout.js +0 -24
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/me.d.ts +0 -10
- package/dist/commands/me.d.ts.map +0 -1
- package/dist/commands/me.js +0 -25
- package/dist/commands/me.js.map +0 -1
- package/dist/commands/open.d.ts +0 -16
- package/dist/commands/open.d.ts.map +0 -1
- package/dist/commands/open.js +0 -34
- package/dist/commands/open.js.map +0 -1
- package/dist/commands/ports.d.ts +0 -75
- package/dist/commands/ports.d.ts.map +0 -1
- package/dist/commands/ports.js +0 -78
- package/dist/commands/ports.js.map +0 -1
- package/dist/commands/profile.d.ts +0 -21
- package/dist/commands/profile.d.ts.map +0 -1
- package/dist/commands/profile.js +0 -93
- package/dist/commands/profile.js.map +0 -1
- package/dist/commands/push.d.ts +0 -18
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -116
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/registry.d.ts +0 -15
- package/dist/commands/registry.d.ts.map +0 -1
- package/dist/commands/registry.js +0 -45
- package/dist/commands/registry.js.map +0 -1
- package/dist/commands/request.d.ts +0 -25
- package/dist/commands/request.d.ts.map +0 -1
- package/dist/commands/request.js +0 -58
- package/dist/commands/request.js.map +0 -1
- package/dist/commands/resume.d.ts +0 -22
- package/dist/commands/resume.d.ts.map +0 -1
- package/dist/commands/resume.js +0 -69
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/save.d.ts +0 -34
- package/dist/commands/save.d.ts.map +0 -1
- package/dist/commands/save.js +0 -141
- package/dist/commands/save.js.map +0 -1
- package/dist/commands/session.d.ts +0 -9
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js +0 -282
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/skills/markdown-loader.d.ts +0 -19
- package/dist/commands/skills/markdown-loader.d.ts.map +0 -1
- package/dist/commands/skills/markdown-loader.js +0 -108
- package/dist/commands/skills/markdown-loader.js.map +0 -1
- package/dist/commands/skills/registry.d.ts +0 -23
- package/dist/commands/skills/registry.d.ts.map +0 -1
- package/dist/commands/skills/registry.js +0 -45
- package/dist/commands/skills/registry.js.map +0 -1
- package/dist/commands/terminal.d.ts +0 -19
- package/dist/commands/terminal.d.ts.map +0 -1
- package/dist/commands/terminal.js +0 -39
- package/dist/commands/terminal.js.map +0 -1
- package/dist/commands/tree.d.ts +0 -16
- package/dist/commands/tree.d.ts.map +0 -1
- package/dist/commands/tree.js +0 -44
- package/dist/commands/tree.js.map +0 -1
- package/dist/commands/undo.d.ts +0 -18
- package/dist/commands/undo.d.ts.map +0 -1
- package/dist/commands/undo.js +0 -46
- package/dist/commands/undo.js.map +0 -1
- package/dist/config/config-store.d.ts +0 -19
- package/dist/config/config-store.d.ts.map +0 -1
- package/dist/config/config-store.js +0 -199
- package/dist/config/config-store.js.map +0 -1
- package/dist/config/defaults.d.ts +0 -22
- package/dist/config/defaults.d.ts.map +0 -1
- package/dist/config/defaults.js +0 -38
- package/dist/config/defaults.js.map +0 -1
- package/dist/config/ports.d.ts +0 -60
- package/dist/config/ports.d.ts.map +0 -1
- package/dist/config/ports.js +0 -8
- package/dist/config/ports.js.map +0 -1
- package/dist/config/profile-constants.d.ts +0 -4
- package/dist/config/profile-constants.d.ts.map +0 -1
- package/dist/config/profile-constants.js +0 -10
- package/dist/config/profile-constants.js.map +0 -1
- package/dist/config/profile.d.ts +0 -84
- package/dist/config/profile.d.ts.map +0 -1
- package/dist/config/profile.js +0 -66
- package/dist/config/profile.js.map +0 -1
- package/dist/contract/index.d.ts +0 -193
- package/dist/contract/index.d.ts.map +0 -1
- package/dist/contract/index.js +0 -14
- package/dist/contract/index.js.map +0 -1
- package/dist/core/app.d.ts +0 -35
- package/dist/core/app.d.ts.map +0 -1
- package/dist/core/app.js +0 -86
- package/dist/core/app.js.map +0 -1
- package/dist/core/command-router.d.ts +0 -29
- package/dist/core/command-router.d.ts.map +0 -1
- package/dist/core/command-router.js +0 -61
- package/dist/core/command-router.js.map +0 -1
- package/dist/core/errors.d.ts +0 -39
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/errors.js +0 -106
- package/dist/core/errors.js.map +0 -1
- package/dist/core/preflight.d.ts +0 -16
- package/dist/core/preflight.d.ts.map +0 -1
- package/dist/core/preflight.js +0 -38
- package/dist/core/preflight.js.map +0 -1
- package/dist/core/repl.d.ts +0 -18
- package/dist/core/repl.d.ts.map +0 -1
- package/dist/core/repl.js +0 -128
- package/dist/core/repl.js.map +0 -1
- package/dist/di/container.d.ts +0 -13
- package/dist/di/container.d.ts.map +0 -1
- package/dist/di/container.js +0 -160
- package/dist/di/container.js.map +0 -1
- package/dist/di/tokens.d.ts +0 -20
- package/dist/di/tokens.d.ts.map +0 -1
- package/dist/di/tokens.js +0 -22
- package/dist/di/tokens.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/render/ink-renderer.d.ts +0 -28
- package/dist/render/ink-renderer.d.ts.map +0 -1
- package/dist/render/ink-renderer.js +0 -174
- package/dist/render/ink-renderer.js.map +0 -1
- package/dist/render/plain-renderer.d.ts +0 -16
- package/dist/render/plain-renderer.d.ts.map +0 -1
- package/dist/render/plain-renderer.js +0 -38
- package/dist/render/plain-renderer.js.map +0 -1
- package/dist/render/ports.d.ts +0 -12
- package/dist/render/ports.d.ts.map +0 -1
- package/dist/render/ports.js +0 -10
- package/dist/render/ports.js.map +0 -1
- package/dist/render/raw-renderer.d.ts +0 -11
- package/dist/render/raw-renderer.d.ts.map +0 -1
- package/dist/render/raw-renderer.js +0 -68
- package/dist/render/raw-renderer.js.map +0 -1
- package/dist/render/repl-input.d.ts +0 -15
- package/dist/render/repl-input.d.ts.map +0 -1
- package/dist/render/repl-input.js +0 -102
- package/dist/render/repl-input.js.map +0 -1
- package/dist/session/file-session-store.d.ts +0 -26
- package/dist/session/file-session-store.d.ts.map +0 -1
- package/dist/session/file-session-store.js +0 -174
- package/dist/session/file-session-store.js.map +0 -1
- package/dist/session/ports.d.ts +0 -50
- package/dist/session/ports.d.ts.map +0 -1
- package/dist/session/ports.js +0 -6
- package/dist/session/ports.js.map +0 -1
- package/dist/sync/git-sync.d.ts +0 -16
- package/dist/sync/git-sync.d.ts.map +0 -1
- package/dist/sync/git-sync.js +0 -28
- package/dist/sync/git-sync.js.map +0 -1
- package/dist/sync/git.d.ts +0 -12
- package/dist/sync/git.d.ts.map +0 -1
- package/dist/sync/git.js +0 -100
- package/dist/sync/git.js.map +0 -1
- package/dist/sync/reconciler.d.ts +0 -36
- package/dist/sync/reconciler.d.ts.map +0 -1
- package/dist/sync/reconciler.js +0 -143
- package/dist/sync/reconciler.js.map +0 -1
- package/dist/sync/walk.d.ts +0 -23
- package/dist/sync/walk.d.ts.map +0 -1
- package/dist/sync/walk.js +0 -81
- package/dist/sync/walk.js.map +0 -1
- package/dist/sync/watch.d.ts +0 -13
- package/dist/sync/watch.d.ts.map +0 -1
- package/dist/sync/watch.js +0 -75
- package/dist/sync/watch.js.map +0 -1
- package/dist/tools/git-diff.d.ts +0 -16
- package/dist/tools/git-diff.d.ts.map +0 -1
- package/dist/tools/git-diff.js +0 -25
- package/dist/tools/git-diff.js.map +0 -1
- package/dist/tools/http-request.d.ts +0 -25
- package/dist/tools/http-request.d.ts.map +0 -1
- package/dist/tools/http-request.js +0 -41
- package/dist/tools/http-request.js.map +0 -1
- package/dist/tools/index.d.ts +0 -7
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -22
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/ports.d.ts +0 -58
- package/dist/tools/ports.d.ts.map +0 -1
- package/dist/tools/ports.js +0 -17
- package/dist/tools/ports.js.map +0 -1
- package/dist/tools/read-file.d.ts +0 -16
- package/dist/tools/read-file.d.ts.map +0 -1
- package/dist/tools/read-file.js +0 -24
- package/dist/tools/read-file.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -10
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/registry.js +0 -28
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/run-command.d.ts +0 -20
- package/dist/tools/run-command.d.ts.map +0 -1
- package/dist/tools/run-command.js +0 -65
- package/dist/tools/run-command.js.map +0 -1
- package/dist/tools/write-file.d.ts +0 -24
- package/dist/tools/write-file.d.ts.map +0 -1
- package/dist/tools/write-file.js +0 -60
- package/dist/tools/write-file.js.map +0 -1
- package/dist/transport/composite-transport.d.ts +0 -30
- package/dist/transport/composite-transport.d.ts.map +0 -1
- package/dist/transport/composite-transport.js +0 -71
- package/dist/transport/composite-transport.js.map +0 -1
- package/dist/transport/device-browser.d.ts +0 -19
- package/dist/transport/device-browser.d.ts.map +0 -1
- package/dist/transport/device-browser.js +0 -243
- package/dist/transport/device-browser.js.map +0 -1
- package/dist/transport/device-git.d.ts +0 -14
- package/dist/transport/device-git.d.ts.map +0 -1
- package/dist/transport/device-git.js +0 -107
- package/dist/transport/device-git.js.map +0 -1
- package/dist/transport/device-http.d.ts +0 -10
- package/dist/transport/device-http.d.ts.map +0 -1
- package/dist/transport/device-http.js +0 -96
- package/dist/transport/device-http.js.map +0 -1
- package/dist/transport/device-terminal.d.ts +0 -44
- package/dist/transport/device-terminal.d.ts.map +0 -1
- package/dist/transport/device-terminal.js +0 -140
- package/dist/transport/device-terminal.js.map +0 -1
- package/dist/transport/http-transport.d.ts +0 -26
- package/dist/transport/http-transport.d.ts.map +0 -1
- package/dist/transport/http-transport.js +0 -125
- package/dist/transport/http-transport.js.map +0 -1
- package/dist/transport/ports.d.ts +0 -67
- package/dist/transport/ports.d.ts.map +0 -1
- package/dist/transport/ports.js +0 -11
- package/dist/transport/ports.js.map +0 -1
- package/dist/transport/reconnect.d.ts +0 -44
- package/dist/transport/reconnect.d.ts.map +0 -1
- package/dist/transport/reconnect.js +0 -69
- package/dist/transport/reconnect.js.map +0 -1
- package/dist/transport/terminal-transport.d.ts +0 -28
- package/dist/transport/terminal-transport.d.ts.map +0 -1
- package/dist/transport/terminal-transport.js +0 -63
- package/dist/transport/terminal-transport.js.map +0 -1
- package/dist/transport/ws-stream-transport.d.ts +0 -66
- package/dist/transport/ws-stream-transport.d.ts.map +0 -1
- package/dist/transport/ws-stream-transport.js +0 -246
- package/dist/transport/ws-stream-transport.js.map +0 -1
package/dist/core/preflight.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// src/core/preflight.ts — project-binding guard (runs once before a project-scoped command).
|
|
2
|
-
//
|
|
3
|
-
// A folder's `.pocketdev/config.json` can be bound (X-Pocketdev-Project) to a project the
|
|
4
|
-
// CURRENTLY signed-in account does not own — e.g. it was pushed by a different account. That used to
|
|
5
|
-
// surface as a confusing 403 with a "tier" hint. This guard reconciles the binding up front: it lists
|
|
6
|
-
// the caller's projects and, if the bound one isn't accessible, auto-selects an owned project,
|
|
7
|
-
// persists the rebind, and tells the user — so commands always run against a project they can access.
|
|
8
|
-
import { CliError } from "./errors.js";
|
|
9
|
-
/** Commands that manage their own (or no) project and must skip the folder-binding guard. */
|
|
10
|
-
const SKIP = new Set(["login", "logout", "profile", "me", "whoami", "help", "session"]);
|
|
11
|
-
export function makeProjectGuard(d) {
|
|
12
|
-
return async (commandName) => {
|
|
13
|
-
if (commandName && SKIP.has(commandName))
|
|
14
|
-
return;
|
|
15
|
-
const boundId = d.binding.projectId;
|
|
16
|
-
if (!boundId)
|
|
17
|
-
return; // unbound → default workspace; nothing to reconcile
|
|
18
|
-
let projects;
|
|
19
|
-
try {
|
|
20
|
-
projects = await d.http.get("/api/projects");
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return; // let the real command surface auth/network errors, not the guard
|
|
24
|
-
}
|
|
25
|
-
if (!Array.isArray(projects) || projects.some((p) => p.id === boundId))
|
|
26
|
-
return; // binding is valid
|
|
27
|
-
if (projects.length === 0) {
|
|
28
|
-
throw CliError.config(`The bound project ${boundId} isn't accessible to your account.`, "You don't own any projects yet — run `pocketdev push` to create one.");
|
|
29
|
-
}
|
|
30
|
-
// Auto-select an owned project (most recently updated wins) and persist the rebind.
|
|
31
|
-
const target = [...projects].sort((a, b) => (b.updatedAt ?? 0) - (a.updatedAt ?? 0))[0];
|
|
32
|
-
d.persist(target.id, target.name);
|
|
33
|
-
d.binding.projectId = target.id;
|
|
34
|
-
d.binding.projectName = target.name;
|
|
35
|
-
d.log(`note: bound project ${boundId} isn't accessible; switched to "${target.name}" (${target.id}).\n`);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=preflight.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../src/core/preflight.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,EAAE;AACF,0FAA0F;AAC1F,qGAAqG;AACrG,sGAAsG;AACtG,+FAA+F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CAAC,CAAC,CAAC,CAAC,CAAE,CAAC;QACzF,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC,CAAC,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC;QAChC,CAAC,CAAC,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC;QACpC,CAAC,CAAC,GAAG,CACH,uBAAuB,OAAO,mCAAmC,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,EAAE,MAAM,CAClG,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/core/repl.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CommandRegistry, CommandRouter } from "./command-router.js";
|
|
2
|
-
import type { InkRenderer } from "../render/ink-renderer.js";
|
|
3
|
-
export declare class Repl {
|
|
4
|
-
private readonly router;
|
|
5
|
-
private readonly registry;
|
|
6
|
-
private readonly renderer;
|
|
7
|
-
private exited;
|
|
8
|
-
private buffer;
|
|
9
|
-
private waiter?;
|
|
10
|
-
constructor(router: CommandRouter, registry: CommandRegistry, renderer: InkRenderer);
|
|
11
|
-
run(): Promise<number>;
|
|
12
|
-
/** Returns true if the verb was a REPL-local command (handled here, not dispatched). */
|
|
13
|
-
private handleLocal;
|
|
14
|
-
private enqueue;
|
|
15
|
-
private next;
|
|
16
|
-
private requestExit;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=repl.d.ts.map
|
package/dist/core/repl.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/core/repl.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAQ7D,qBAAa,IAAI;IAMb,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAP3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAC,CAAyB;gBAGrB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,WAAW;IAGlC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAoD5B,wFAAwF;IACxF,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,WAAW;CAQpB"}
|
package/dist/core/repl.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// Repl — the interactive command loop for a bare `pocketdev` on a TTY.
|
|
2
|
-
//
|
|
3
|
-
// SRP: read a line from the Ink input, dispatch it through the CommandRouter, repeat. It owns the loop
|
|
4
|
-
// and the handful of REPL-local verbs (help/clear/exit); command behaviour lives in the commands, and
|
|
5
|
-
// rendering lives in the InkRenderer (whose transcript shows command output ABOVE the input).
|
|
6
|
-
//
|
|
7
|
-
// Commands run one at a time: while a dispatch is in flight the input is `busy` (Enter ignored). A small
|
|
8
|
-
// promise-queue bridges the event-driven Ink input (`onSubmit`) to the awaiting loop.
|
|
9
|
-
import { isCliError } from "./errors.js";
|
|
10
|
-
// Commands that don't fit a line-based REPL (raw PTY / long-running). We guide instead of hanging.
|
|
11
|
-
const REPL_UNSUPPORTED = {
|
|
12
|
-
terminal: "`/terminal` is a raw shell — run `pocketdev terminal` in its own window instead.",
|
|
13
|
-
session: "`/session` runs continuously — start it in a separate terminal (`pocketdev session`).",
|
|
14
|
-
};
|
|
15
|
-
export class Repl {
|
|
16
|
-
router;
|
|
17
|
-
registry;
|
|
18
|
-
renderer;
|
|
19
|
-
exited = false;
|
|
20
|
-
buffer = [];
|
|
21
|
-
waiter;
|
|
22
|
-
constructor(router, registry, renderer) {
|
|
23
|
-
this.router = router;
|
|
24
|
-
this.registry = registry;
|
|
25
|
-
this.renderer = renderer;
|
|
26
|
-
}
|
|
27
|
-
async run() {
|
|
28
|
-
const commands = this.registry.all().map((c) => ({ name: c.name, summary: c.summary }));
|
|
29
|
-
const setSlot = (busy) => this.renderer.setRepl({
|
|
30
|
-
commands,
|
|
31
|
-
busy,
|
|
32
|
-
onSubmit: (line) => this.enqueue(line),
|
|
33
|
-
onExit: () => this.requestExit(),
|
|
34
|
-
});
|
|
35
|
-
this.renderer.stream("EverywhereDev — type /help, or / for commands. Ctrl-C to exit.\n");
|
|
36
|
-
setSlot(false);
|
|
37
|
-
while (!this.exited) {
|
|
38
|
-
const line = await this.next();
|
|
39
|
-
if (this.exited)
|
|
40
|
-
break;
|
|
41
|
-
const trimmed = line.trim();
|
|
42
|
-
if (!trimmed)
|
|
43
|
-
continue;
|
|
44
|
-
this.renderer.stream(`❯ ${trimmed}\n`); // echo into the transcript
|
|
45
|
-
const argv = trimmed.split(/\s+/);
|
|
46
|
-
argv[0] = argv[0].replace(/^\//, ""); // strip the leading slash of /commands
|
|
47
|
-
const name = argv[0];
|
|
48
|
-
if (this.handleLocal(name))
|
|
49
|
-
continue;
|
|
50
|
-
if (name === "push" && argv.includes("--watch")) {
|
|
51
|
-
this.renderer.stream("`/push --watch` runs continuously — use a separate terminal.\n");
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
const note = REPL_UNSUPPORTED[name];
|
|
55
|
-
if (note) {
|
|
56
|
-
this.renderer.stream(note + "\n");
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
setSlot(true);
|
|
60
|
-
try {
|
|
61
|
-
const code = await this.router.dispatch(argv);
|
|
62
|
-
if (code !== 0)
|
|
63
|
-
this.renderer.stream(`(exit ${code})\n`);
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
if (isCliError(err))
|
|
67
|
-
this.renderer.error(err.message, err.hint);
|
|
68
|
-
else
|
|
69
|
-
this.renderer.error(err instanceof Error ? err.message : String(err));
|
|
70
|
-
}
|
|
71
|
-
if (this.exited)
|
|
72
|
-
break;
|
|
73
|
-
setSlot(false);
|
|
74
|
-
}
|
|
75
|
-
await this.renderer.dispose();
|
|
76
|
-
return 0;
|
|
77
|
-
}
|
|
78
|
-
/** Returns true if the verb was a REPL-local command (handled here, not dispatched). */
|
|
79
|
-
handleLocal(name) {
|
|
80
|
-
switch (name) {
|
|
81
|
-
case "help":
|
|
82
|
-
case "?": {
|
|
83
|
-
this.renderer.stream("Commands:\n");
|
|
84
|
-
for (const c of this.registry.all()) {
|
|
85
|
-
this.renderer.stream(` /${c.name.padEnd(12)} ${c.summary}\n`);
|
|
86
|
-
}
|
|
87
|
-
this.renderer.stream(" /clear Clear the screen\n /exit Quit the REPL\n");
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
case "clear":
|
|
91
|
-
this.renderer.clear();
|
|
92
|
-
return true;
|
|
93
|
-
case "exit":
|
|
94
|
-
case "quit":
|
|
95
|
-
this.requestExit();
|
|
96
|
-
return true;
|
|
97
|
-
default:
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
// ── input queue (Ink onSubmit → awaiting loop) ──────────────────────────────
|
|
102
|
-
enqueue(line) {
|
|
103
|
-
if (this.waiter) {
|
|
104
|
-
const w = this.waiter;
|
|
105
|
-
this.waiter = undefined;
|
|
106
|
-
w(line);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
this.buffer.push(line);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
next() {
|
|
113
|
-
if (this.buffer.length)
|
|
114
|
-
return Promise.resolve(this.buffer.shift());
|
|
115
|
-
return new Promise((resolve) => {
|
|
116
|
-
this.waiter = resolve;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
requestExit() {
|
|
120
|
-
this.exited = true;
|
|
121
|
-
if (this.waiter) {
|
|
122
|
-
const w = this.waiter;
|
|
123
|
-
this.waiter = undefined;
|
|
124
|
-
w(""); // unblock the loop; the `exited` guard breaks it
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
//# sourceMappingURL=repl.js.map
|
package/dist/core/repl.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repl.js","sourceRoot":"","sources":["../../src/core/repl.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,uGAAuG;AACvG,sGAAsG;AACtG,8FAA8F;AAC9F,EAAE;AACF,yGAAyG;AACzG,sFAAsF;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,mGAAmG;AACnG,MAAM,gBAAgB,GAA2B;IAC/C,QAAQ,EAAE,kFAAkF;IAC5F,OAAO,EAAE,uFAAuF;CACjG,CAAC;AAEF,MAAM,OAAO,IAAI;IAMI;IACA;IACA;IAPX,MAAM,GAAG,KAAK,CAAC;IACf,MAAM,GAAa,EAAE,CAAC;IACtB,MAAM,CAA0B;IAExC,YACmB,MAAqB,EACrB,QAAyB,EACzB,QAAqB;QAFrB,WAAM,GAAN,MAAM,CAAe;QACrB,aAAQ,GAAR,QAAQ,CAAiB;QACzB,aAAQ,GAAR,QAAQ,CAAa;IACrC,CAAC;IAEJ,KAAK,CAAC,GAAG;QACP,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACxF,MAAM,OAAO,GAAG,CAAC,IAAa,EAAE,EAAE,CAChC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;YACpB,QAAQ;YACR,IAAI;YACJ,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,I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yContainer } from "tsyringe";
|
|
3
|
-
import { App } from "../core/app.js";
|
|
4
|
-
/**
|
|
5
|
-
* Build a fully-wired child container for one CLI invocation.
|
|
6
|
-
*
|
|
7
|
-
* @param argv the process args (minus node + script), used to resolve flags in the ConfigStore.
|
|
8
|
-
* @param env the process environment, the env layer of the precedence chain.
|
|
9
|
-
*/
|
|
10
|
-
export declare function buildContainer(argv: readonly string[], env?: NodeJS.ProcessEnv): DependencyContainer;
|
|
11
|
-
/** Resolve the top-level App from a built container, given the resolved config (used by index.ts). */
|
|
12
|
-
export declare function resolveApp(c: DependencyContainer): App;
|
|
13
|
-
//# sourceMappingURL=container.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/di/container.ts"],"names":[],"mappings":"AAUA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAa,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAS/D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAoFrC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,mBAAmB,CA2DrB;AAED,sGAAsG;AACtG,wBAAgB,UAAU,CAAC,CAAC,EAAE,mBAAmB,GAAG,GAAG,CActD"}
|
package/dist/di/container.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
// DI composition root (tsyringe).
|
|
2
|
-
//
|
|
3
|
-
// It reads the active connection profile and binds the `AuthProvider` and transport ports. The CLI
|
|
4
|
-
// is FULL-REMOTE only (Ory Hydra device grant). NOTHING downstream branches on mode.
|
|
5
|
-
//
|
|
6
|
-
// SOLID realized here:
|
|
7
|
-
// - DIP: every consumer resolves an interface token (TOKENS.*); concretes are constructed only here.
|
|
8
|
-
// - ISP: the three transport ports are registered separately, with a composite façade on top.
|
|
9
|
-
// - SRP: this file only wires; it contains no business logic.
|
|
10
|
-
import "reflect-metadata";
|
|
11
|
-
import { container } from "tsyringe";
|
|
12
|
-
import { HydraOAuthAuthProvider } from "../auth/hydra-oauth-auth-provider.js";
|
|
13
|
-
import { OsKeychain } from "../auth/keychain.js";
|
|
14
|
-
import { defaultCommands } from "../commands/index.js";
|
|
15
|
-
import { writeProjectConfig } from "../commands/push.js";
|
|
16
|
-
import { ConfigStoreImpl } from "../config/config-store.js";
|
|
17
|
-
import { App } from "../core/app.js";
|
|
18
|
-
import { CommandRegistry } from "../core/command-router.js";
|
|
19
|
-
import { CliError } from "../core/errors.js";
|
|
20
|
-
import { makeProjectGuard } from "../core/preflight.js";
|
|
21
|
-
import { InkRenderer } from "../render/ink-renderer.js";
|
|
22
|
-
import { PlainRenderer } from "../render/plain-renderer.js";
|
|
23
|
-
import { FileSessionStore } from "../session/file-session-store.js";
|
|
24
|
-
import { CompositeTransport } from "../transport/composite-transport.js";
|
|
25
|
-
import { HttpTransport } from "../transport/http-transport.js";
|
|
26
|
-
import { TerminalTransport } from "../transport/terminal-transport.js";
|
|
27
|
-
import { WsStreamTransport } from "../transport/ws-stream-transport.js";
|
|
28
|
-
import { TOKENS } from "./tokens.js";
|
|
29
|
-
/**
|
|
30
|
-
* Lazy stand-in for a capability the foundation has not wired yet (the agent loop + run tracker land
|
|
31
|
-
* in a later slice). Touching it from a command that needs it fails with a clear message rather than a
|
|
32
|
-
* cryptic resolve error; the HTTP read/write commands never touch it.
|
|
33
|
-
*/
|
|
34
|
-
function notWired(capability) {
|
|
35
|
-
const fail = () => {
|
|
36
|
-
throw CliError.config(`The "${capability}" capability is not wired in this build.`, "Use the HTTP commands (tree, open, save, commits, diff, activity, agents) for now.");
|
|
37
|
-
};
|
|
38
|
-
return new Proxy(function () { }, { get: fail, apply: fail });
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Adapter: presents a context-bag `Command` (run(ctx)) as the router's `RoutableCommand`
|
|
42
|
-
* (run(argv, container)). The per-invocation `CommandContext` is built by `mkCtx`, so the command
|
|
43
|
-
* stays ignorant of the container — it sees only injected ports.
|
|
44
|
-
*/
|
|
45
|
-
class ContextCommand {
|
|
46
|
-
name;
|
|
47
|
-
summary;
|
|
48
|
-
cmd;
|
|
49
|
-
mkCtx;
|
|
50
|
-
constructor(name, summary, cmd, mkCtx) {
|
|
51
|
-
this.name = name;
|
|
52
|
-
this.summary = summary;
|
|
53
|
-
this.cmd = cmd;
|
|
54
|
-
this.mkCtx = mkCtx;
|
|
55
|
-
}
|
|
56
|
-
async run(argv) {
|
|
57
|
-
await this.cmd.run(this.mkCtx(argv));
|
|
58
|
-
return 0;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/** Populate the router registry with the built-in command set (names + aliases). */
|
|
62
|
-
function buildRegistry(c, config, renderer) {
|
|
63
|
-
const mkCtx = (argv) => {
|
|
64
|
-
const resolved = config.resolve();
|
|
65
|
-
return {
|
|
66
|
-
argv,
|
|
67
|
-
args: {},
|
|
68
|
-
http: c.resolve(TOKENS.HttpPort),
|
|
69
|
-
stream: c.resolve(TOKENS.StreamPort),
|
|
70
|
-
terminal: c.resolve(TOKENS.TerminalPort),
|
|
71
|
-
auth: c.resolve(TOKENS.AuthProvider),
|
|
72
|
-
config,
|
|
73
|
-
renderer,
|
|
74
|
-
sessions: c.resolve(TOKENS.SessionStore),
|
|
75
|
-
agentLoop: notWired("agent"),
|
|
76
|
-
runTracker: notWired("undo/resume tracking"),
|
|
77
|
-
nonInteractive: resolved.print || resolved.noTty,
|
|
78
|
-
json: resolved.json,
|
|
79
|
-
signal: new AbortController().signal,
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
const registry = new CommandRegistry();
|
|
83
|
-
for (const cmd of defaultCommands()) {
|
|
84
|
-
registry.register(new ContextCommand(cmd.name, cmd.summary, cmd, mkCtx));
|
|
85
|
-
for (const alias of cmd.aliases ?? []) {
|
|
86
|
-
registry.register(new ContextCommand(alias, cmd.summary, cmd, mkCtx));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return registry;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Build a fully-wired child container for one CLI invocation.
|
|
93
|
-
*
|
|
94
|
-
* @param argv the process args (minus node + script), used to resolve flags in the ConfigStore.
|
|
95
|
-
* @param env the process environment, the env layer of the precedence chain.
|
|
96
|
-
*/
|
|
97
|
-
export function buildContainer(argv, env = process.env) {
|
|
98
|
-
const c = container.createChildContainer();
|
|
99
|
-
// ── Config + active profile (precedence resolved exactly once, here). ──
|
|
100
|
-
const config = new ConfigStoreImpl(argv, env);
|
|
101
|
-
c.register(TOKENS.ConfigStore, { useValue: config });
|
|
102
|
-
const resolved = config.resolve();
|
|
103
|
-
const profile = resolved.profile; // { name, mode, hostUrl, ... }
|
|
104
|
-
// Token storage for the Hydra device-grant provider (OS keychain, 0600-file fallback in Docker).
|
|
105
|
-
c.register(TOKENS.Keychain, { useValue: new OsKeychain() });
|
|
106
|
-
// FULL-REMOTE only: Ory Hydra Device Authorization Grant + PKCE; tokens in the OS keychain.
|
|
107
|
-
c.register(TOKENS.AuthProvider, {
|
|
108
|
-
useFactory: (cc) => new HydraOAuthAuthProvider(config, cc.resolve(TOKENS.Keychain)),
|
|
109
|
-
});
|
|
110
|
-
// ── Transport: three narrow ports + a composite façade. Auth-agnostic (asks AuthProvider). ──
|
|
111
|
-
c.register(TOKENS.HttpPort, {
|
|
112
|
-
useFactory: (cc) => new HttpTransport(profile.hostUrl, cc.resolve(TOKENS.AuthProvider), resolved.projectId),
|
|
113
|
-
});
|
|
114
|
-
c.register(TOKENS.StreamPort, {
|
|
115
|
-
useFactory: (cc) => new WsStreamTransport(profile, cc.resolve(TOKENS.AuthProvider)),
|
|
116
|
-
});
|
|
117
|
-
c.register(TOKENS.TerminalPort, {
|
|
118
|
-
useFactory: (cc) => {
|
|
119
|
-
const stream = cc.resolve(TOKENS.StreamPort);
|
|
120
|
-
// Hand the ws transport's ResumeTracker to the terminal adapter so PTYs survive reconnects.
|
|
121
|
-
return new TerminalTransport(stream, stream.resumeTracker);
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
c.register(TOKENS.Transport, {
|
|
125
|
-
useFactory: (cc) => new CompositeTransport(cc.resolve(TOKENS.HttpPort), cc.resolve(TOKENS.StreamPort), cc.resolve(TOKENS.TerminalPort)),
|
|
126
|
-
});
|
|
127
|
-
// ── Session / transcript persistence. ──
|
|
128
|
-
c.register(TOKENS.SessionStore, {
|
|
129
|
-
useFactory: (cc) => new FileSessionStore(config, cc.resolve(TOKENS.HttpPort)),
|
|
130
|
-
});
|
|
131
|
-
// Output renderer: only the explicit `pocketdev repl` on a TTY gets the Ink REPL renderer. Bare
|
|
132
|
-
// `pocketdev` runs the live SESSION (file sync + device terminal sharing) with the plain renderer, and
|
|
133
|
-
// everything else (one-shot/pipe) is plain too.
|
|
134
|
-
const firstCmd = argv.find((a) => !a.startsWith("-"));
|
|
135
|
-
const interactive = firstCmd === "repl" && !resolved.print && !resolved.noTty;
|
|
136
|
-
const renderer = interactive ? new InkRenderer() : new PlainRenderer();
|
|
137
|
-
c.register(TOKENS.Renderer, { useValue: renderer });
|
|
138
|
-
// Command surface: the built-in HTTP/stream commands are registered here (each wrapped as a
|
|
139
|
-
// RoutableCommand that builds its CommandContext from the injected ports). ToolRegistry, AgentLoop and
|
|
140
|
-
// ApprovalGate land in later slices; commands that need them fail with a clear message via notWired().
|
|
141
|
-
c.register(CommandRegistry, { useValue: buildRegistry(c, config, renderer) });
|
|
142
|
-
return c;
|
|
143
|
-
}
|
|
144
|
-
/** Resolve the top-level App from a built container, given the resolved config (used by index.ts). */
|
|
145
|
-
export function resolveApp(c) {
|
|
146
|
-
const config = c.resolve(TOKENS.ConfigStore).resolve();
|
|
147
|
-
const registry = c.resolve(CommandRegistry);
|
|
148
|
-
// Pre-flight project guard: reconcile the folder's bound project against the signed-in account.
|
|
149
|
-
// `config` is the same resolved object the HttpTransport factory reads, so mutating its projectId
|
|
150
|
-
// re-points subsequent (transient) transports at the rebound project.
|
|
151
|
-
const renderer = new PlainRenderer();
|
|
152
|
-
const guard = makeProjectGuard({
|
|
153
|
-
http: c.resolve(TOKENS.HttpPort),
|
|
154
|
-
log: (line) => renderer.stream(line),
|
|
155
|
-
binding: config,
|
|
156
|
-
persist: (id, name) => writeProjectConfig(process.cwd(), id, name),
|
|
157
|
-
});
|
|
158
|
-
return new App(c, config, registry, guard);
|
|
159
|
-
}
|
|
160
|
-
//# sourceMappingURL=container.js.map
|
package/dist/di/container.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/di/container.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,EAAE;AACF,mGAAmG;AACnG,qFAAqF;AACrF,EAAE;AACF,uBAAuB;AACvB,sGAAsG;AACtG,+FAA+F;AAC/F,+DAA+D;AAE/D,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAA4B,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAwB,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAA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,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEpD,4FAA4F;IAC5F,uGAAuG;IACvG,uGAAuG;IACvG,CAAC,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE9E,OAAO,CAAC,CAAC;AACX,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,UAAU,CAAC,CAAsB;IAC/C,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC;IACvD,MAAM,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5C,gGAAgG;IAChG,kGAAkG;IAClG,sEAAsE;IACtE,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;IACrC,MAAM,KAAK,GAAG,gBAAgB,CAAC;QAC7B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QACpC,OAAO,EAAE,MAAsD;QAC/D,OAAO,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC;KACnE,CAAC,CAAC;IACH,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC"}
|
package/dist/di/tokens.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { InjectionToken } from "tsyringe";
|
|
2
|
-
import type { AuthProvider } from "../auth/ports.js";
|
|
3
|
-
import type { Keychain } from "../auth/keychain.js";
|
|
4
|
-
import type { ConfigStore } from "../config/ports.js";
|
|
5
|
-
import type { Renderer } from "../render/ports.js";
|
|
6
|
-
import type { SessionStore } from "../session/ports.js";
|
|
7
|
-
import type { HttpPort, StreamPort, TerminalPort, Transport } from "../transport/ports.js";
|
|
8
|
-
export declare const TOKENS: {
|
|
9
|
-
readonly ConfigStore: InjectionToken<ConfigStore>;
|
|
10
|
-
readonly AuthProvider: InjectionToken<AuthProvider>;
|
|
11
|
-
readonly Keychain: InjectionToken<Keychain>;
|
|
12
|
-
readonly HttpPort: InjectionToken<HttpPort>;
|
|
13
|
-
readonly StreamPort: InjectionToken<StreamPort>;
|
|
14
|
-
readonly TerminalPort: InjectionToken<TerminalPort>;
|
|
15
|
-
readonly Transport: InjectionToken<Transport>;
|
|
16
|
-
readonly SessionStore: InjectionToken<SessionStore>;
|
|
17
|
-
readonly Renderer: InjectionToken<Renderer>;
|
|
18
|
-
};
|
|
19
|
-
export type Tokens = typeof TOKENS;
|
|
20
|
-
//# sourceMappingURL=tokens.d.ts.map
|
package/dist/di/tokens.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/di/tokens.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE3F,eAAO,MAAM,MAAM;0BAEmC,cAAc,CAAC,WAAW,CAAC;2BAGzB,cAAc,CAAC,YAAY,CAAC;uBACpC,cAAc,CAAC,QAAQ,CAAC;uBAGxB,cAAc,CAAC,QAAQ,CAAC;yBACpB,cAAc,CAAC,UAAU,CAAC;2BACtB,cAAc,CAAC,YAAY,CAAC;wBAClC,cAAc,CAAC,SAAS,CAAC;2BAGnB,cAAc,CAAC,YAAY,CAAC;uBAGpC,cAAc,CAAC,QAAQ,CAAC;CAC9D,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC"}
|
package/dist/di/tokens.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Injection tokens — typed handles for every port wired in the composition root.
|
|
2
|
-
//
|
|
3
|
-
// tsyringe resolves interfaces by token (interfaces vanish at runtime). We use `InjectionToken<T>`
|
|
4
|
-
// so registration and resolution are type-checked: `c.resolve(TOKENS.HttpPort)` is typed `HttpPort`.
|
|
5
|
-
// SRP: this file only declares the registry of seams; container.ts decides what concrete fills each.
|
|
6
|
-
export const TOKENS = {
|
|
7
|
-
// Configuration / profile.
|
|
8
|
-
ConfigStore: Symbol.for("pocketdev.ConfigStore"),
|
|
9
|
-
// Authentication (the DI root binds exactly one of the two concretes by profile.mode).
|
|
10
|
-
AuthProvider: Symbol.for("pocketdev.AuthProvider"),
|
|
11
|
-
Keychain: Symbol.for("pocketdev.Keychain"),
|
|
12
|
-
// Transport ports (ISP: three narrow roles + a composite façade).
|
|
13
|
-
HttpPort: Symbol.for("pocketdev.HttpPort"),
|
|
14
|
-
StreamPort: Symbol.for("pocketdev.StreamPort"),
|
|
15
|
-
TerminalPort: Symbol.for("pocketdev.TerminalPort"),
|
|
16
|
-
Transport: Symbol.for("pocketdev.Transport"),
|
|
17
|
-
// Session / transcript persistence.
|
|
18
|
-
SessionStore: Symbol.for("pocketdev.SessionStore"),
|
|
19
|
-
// Output renderer (Ink REPL on a TTY, else Plain). Commands resolve it via mkCtx; App reuses it.
|
|
20
|
-
Renderer: Symbol.for("pocketdev.Renderer"),
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=tokens.js.map
|
package/dist/di/tokens.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/di/tokens.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,mGAAmG;AACnG,qGAAqG;AACrG,qGAAqG;AAUrG,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAgC;IAE/E,uFAAuF;IACvF,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAiC;IAClF,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAA6B;IAEtE,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAA6B;IACtE,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAA+B;IAC5E,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAiC;IAClF,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAA8B;IAEzE,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAiC;IAElF,iGAAiG;IACjG,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAA6B;CAC9D,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
/**
|
|
3
|
-
* Program entry. Returns nothing; sets `process.exitCode` so pipes/CI observe the result without an
|
|
4
|
-
* abrupt `process.exit` that could truncate buffered stdout.
|
|
5
|
-
*
|
|
6
|
-
* @param argv process args with node + script already stripped (the shim passes argv.slice(2)).
|
|
7
|
-
*/
|
|
8
|
-
export declare function main(argv: readonly string[]): Promise<void>;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,kBAAkB,CAAC;AAK1B;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBjE"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,EAAE;AACF,uDAAuD;AACvD,iGAAiG;AACjG,mEAAmE;AACnE,2EAA2E;AAC3E,uFAAuF;AACvF,iEAAiE;AACjE,EAAE;AACF,oGAAoG;AACpG,8EAA8E;AAE9E,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAuB;IAChD,wGAAwG;IACxG,yGAAyG;IACzG,2EAA2E;IAC3E,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE;QAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9H,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,GAAG,GAAG,UAAU,CAAC,CAA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./repl-input.js";
|
|
4
|
-
export declare class InkRenderer implements Renderer {
|
|
5
|
-
private readonly store;
|
|
6
|
-
private instance?;
|
|
7
|
-
/** A pending prompt resolver; only one prompt is shown at a time. */
|
|
8
|
-
private pendingPrompt?;
|
|
9
|
-
/** The interactive REPL input slot (set by the Repl controller); rendered at the bottom of Root. */
|
|
10
|
-
private replSlot?;
|
|
11
|
-
private mount;
|
|
12
|
-
/** Mount (if needed) and show the REPL input. Re-call to update `busy`/handlers. */
|
|
13
|
-
setRepl(slot: ReplInputProps): void;
|
|
14
|
-
get currentRepl(): ReplInputProps | undefined;
|
|
15
|
-
/** Reset the transcript (the `/clear` REPL verb). */
|
|
16
|
-
clear(): void;
|
|
17
|
-
stream(chunk: string): void;
|
|
18
|
-
error(message: string, hint?: string): void;
|
|
19
|
-
diff(ranges: readonly DiffRange[], path: string): void;
|
|
20
|
-
prompt(question: string, choices: readonly string[]): Promise<string>;
|
|
21
|
-
/** Internal: re-render the root (Root reads `currentPrompt`). */
|
|
22
|
-
private refresh;
|
|
23
|
-
/** Exposed to Root so it can render the active prompt. */
|
|
24
|
-
get currentPrompt(): InkRenderer["pendingPrompt"];
|
|
25
|
-
/** Tear down the Ink app (called on REPL exit). */
|
|
26
|
-
dispose(): Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=ink-renderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ink-renderer.d.ts","sourceRoot":"","sources":["../../src/render/ink-renderer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAyHjE,qBAAa,WAAY,YAAW,QAAQ;IAC1C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ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