@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/auth/ports.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Auth port — the single seam the transport sees.
|
|
2
|
-
//
|
|
3
|
-
// DIP: the transport asks for an `Authorization` header value and never knows how it was obtained.
|
|
4
|
-
// The CLI is FULL-REMOTE only; HydraOAuthAuthProvider implements this interface.
|
|
5
|
-
export function hasBearerSource(p) {
|
|
6
|
-
return typeof p.bearerToken === "function";
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=ports.js.map
|
package/dist/auth/ports.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ports.js","sourceRoot":"","sources":["../../src/auth/ports.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,mGAAmG;AACnG,iFAAiF;AA+BjF,MAAM,UAAU,eAAe,CAAC,CAAe;IAC7C,OAAO,OAAQ,CAA2B,CAAC,WAAW,KAAK,UAAU,CAAC;AACxE,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class ActivityCommand implements Command {
|
|
4
|
-
readonly name = "activity";
|
|
5
|
-
readonly summary = "Show recent activity, then live-stream new events (GET /api/activity + WS)";
|
|
6
|
-
readonly schema: z.ZodObject<{
|
|
7
|
-
/** Keep streaming new events until Ctrl-C (default true in a TTY, false in a pipe). */
|
|
8
|
-
follow: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
follow?: boolean | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
follow?: boolean | undefined;
|
|
13
|
-
}>;
|
|
14
|
-
run(ctx: CommandContext): Promise<void>;
|
|
15
|
-
private print;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/commands/activity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAY1D,qBAAa,eAAgB,YAAW,OAAO;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,OAAO,gFAAgF;IAChG,QAAQ,CAAC,MAAM;QAXf,uFAAuF;;;;;;OAW9D;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B7C,OAAO,CAAC,KAAK;CASd"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// src/commands/activity.ts — `/activity` / `pocketdev activity` → GET /api/activity + WS stream
|
|
2
|
-
//
|
|
3
|
-
// SRP: print the recent activity snapshot, then (when following) live-stream new events from
|
|
4
|
-
// the WS `activity:init` / `activity` channels. Depends on HttpPort + StreamPort + Renderer.
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { bindArgs, parseArgs } from "./ports.js";
|
|
7
|
-
const schema = z.object({
|
|
8
|
-
/** Keep streaming new events until Ctrl-C (default true in a TTY, false in a pipe). */
|
|
9
|
-
follow: z.boolean().optional(),
|
|
10
|
-
});
|
|
11
|
-
export class ActivityCommand {
|
|
12
|
-
name = "activity";
|
|
13
|
-
summary = "Show recent activity, then live-stream new events (GET /api/activity + WS)";
|
|
14
|
-
schema = schema;
|
|
15
|
-
async run(ctx) {
|
|
16
|
-
const args = parseArgs(this.schema, bindArgs(ctx.argv, []));
|
|
17
|
-
const follow = args.follow ?? !ctx.nonInteractive;
|
|
18
|
-
const snapshot = await ctx.http.get("/api/activity");
|
|
19
|
-
if (ctx.json && !follow) {
|
|
20
|
-
ctx.renderer.stream(JSON.stringify(snapshot) + "\n");
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
for (const e of snapshot.events)
|
|
24
|
-
this.print(ctx, e);
|
|
25
|
-
if (!follow)
|
|
26
|
-
return;
|
|
27
|
-
await ctx.stream.connect();
|
|
28
|
-
ctx.renderer.stream("— following activity (Ctrl-C to stop) —\n");
|
|
29
|
-
// `activity:init` may resend the backlog after a reconnect; render it idempotently.
|
|
30
|
-
const offInit = ctx.stream.on("activity:init", (events) => {
|
|
31
|
-
for (const e of events)
|
|
32
|
-
this.print(ctx, e);
|
|
33
|
-
});
|
|
34
|
-
const offEvent = ctx.stream.on("activity", (event) => this.print(ctx, event));
|
|
35
|
-
await waitForAbort(ctx.signal);
|
|
36
|
-
offInit();
|
|
37
|
-
offEvent();
|
|
38
|
-
}
|
|
39
|
-
print(ctx, e) {
|
|
40
|
-
if (ctx.json) {
|
|
41
|
-
ctx.renderer.stream(JSON.stringify(e) + "\n");
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const ts = new Date(e.at).toISOString();
|
|
45
|
-
const where = e.path ? ` ${e.path}` : "";
|
|
46
|
-
ctx.renderer.stream(`${ts} ${e.kind.padEnd(7)} ${e.message}${where}\n`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function waitForAbort(signal) {
|
|
50
|
-
if (signal.aborted)
|
|
51
|
-
return Promise.resolve();
|
|
52
|
-
return new Promise((resolve) => signal.addEventListener("abort", () => resolve(), { once: true }));
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=activity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/commands/activity.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,EAAE;AACF,6FAA6F;AAC7F,6FAA6F;AAE7F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,uFAAuF;IACvF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAMH,MAAM,OAAO,eAAe;IACjB,IAAI,GAAG,UAAU,CAAC;IAClB,OAAO,GAAG,4EAA4E,CAAC;IACvF,MAAM,GAAG,MAAM,CAAC;IAEzB,KAAK,CAAC,GAAG,CAAC,GAAmB;QAC3B,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,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AAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;YAC9C,OAAO;QACT,CAAC;QACD,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC;IAC3E,CAAC;CACF;AAED,SAAS,YAAY,CAAC,MAAmB;IACvC,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACrG,CAAC"}
|
package/dist/commands/agent.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class AgentCommand implements Command {
|
|
4
|
-
readonly name = "agent";
|
|
5
|
-
readonly summary = "Run an AI agent prompt (POST /api/agent/prompt + WS stream)";
|
|
6
|
-
readonly aliases: string[];
|
|
7
|
-
readonly schema: z.ZodObject<{
|
|
8
|
-
/** The prompt text; in pipe mode it may instead arrive on stdin. */
|
|
9
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
10
|
-
/** Target a specific agent id (else the host picks the default). */
|
|
11
|
-
agent: z.ZodOptional<z.ZodString>;
|
|
12
|
-
/** Inline selected-code/file context to attach to the prompt. */
|
|
13
|
-
context: z.ZodOptional<z.ZodString>;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
agent?: string | undefined;
|
|
16
|
-
context?: string | undefined;
|
|
17
|
-
prompt?: string | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
agent?: string | undefined;
|
|
20
|
-
context?: string | undefined;
|
|
21
|
-
prompt?: string | undefined;
|
|
22
|
-
}>;
|
|
23
|
-
run(ctx: CommandContext): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAY1D,qBAAa,YAAa,YAAW,OAAO;IAC1C,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,OAAO,iEAAiE;IACjF,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,MAAM;QAZf,oEAAoE;;QAEpE,oEAAoE;;QAEpE,iEAAiE;;;;;;;;;;OAQxC;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA+B9C"}
|
package/dist/commands/agent.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// src/commands/agent.ts — `/agent "<prompt>"` / `pocketdev agent "<prompt>"`
|
|
2
|
-
// POST /api/agent/prompt + WS agent:* stream (driven by AgentLoop).
|
|
3
|
-
//
|
|
4
|
-
// SRP: parse the prompt + options and hand off to the AgentLoop, which owns streaming,
|
|
5
|
-
// approval, rendering, and transcript. Supports one-shot/pipe (`-p`) and context/agentId.
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { bindArgs, parseArgs } from "./ports.js";
|
|
8
|
-
const schema = z.object({
|
|
9
|
-
/** The prompt text; in pipe mode it may instead arrive on stdin. */
|
|
10
|
-
prompt: z.string().optional(),
|
|
11
|
-
/** Target a specific agent id (else the host picks the default). */
|
|
12
|
-
agent: z.string().optional(),
|
|
13
|
-
/** Inline selected-code/file context to attach to the prompt. */
|
|
14
|
-
context: z.string().optional(),
|
|
15
|
-
});
|
|
16
|
-
export class AgentCommand {
|
|
17
|
-
name = "agent";
|
|
18
|
-
summary = "Run an AI agent prompt (POST /api/agent/prompt + WS stream)";
|
|
19
|
-
aliases = ["ask"];
|
|
20
|
-
schema = schema;
|
|
21
|
-
async run(ctx) {
|
|
22
|
-
const args = parseArgs(this.schema, bindArgs(ctx.argv, ["prompt"]));
|
|
23
|
-
const prompt = args.prompt ?? (await maybeReadStdin(ctx.signal));
|
|
24
|
-
if (!prompt || prompt.trim().length === 0) {
|
|
25
|
-
ctx.renderer.error("No prompt provided.", 'Usage: pocketdev agent "fix the failing test"');
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const outcome = await ctx.agentLoop.run({
|
|
29
|
-
prompt,
|
|
30
|
-
...(args.agent ? { agentId: args.agent } : {}),
|
|
31
|
-
...(args.context ? { context: args.context } : {}),
|
|
32
|
-
...(ctx.sessionId ? { sessionId: ctx.sessionId } : {}),
|
|
33
|
-
}, ctx.signal);
|
|
34
|
-
if (ctx.json) {
|
|
35
|
-
ctx.renderer.stream(JSON.stringify({
|
|
36
|
-
runId: outcome.runId,
|
|
37
|
-
agent: outcome.agent,
|
|
38
|
-
code: outcome.code,
|
|
39
|
-
error: outcome.error,
|
|
40
|
-
touchedPaths: outcome.touchedPaths,
|
|
41
|
-
}) + "\n");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/** In pipe/print mode, read the prompt from stdin when not supplied positionally. */
|
|
46
|
-
async function maybeReadStdin(signal) {
|
|
47
|
-
// Only consume stdin when it is piped (not an interactive TTY).
|
|
48
|
-
if (process.stdin.isTTY)
|
|
49
|
-
return undefined;
|
|
50
|
-
return readAll(signal);
|
|
51
|
-
}
|
|
52
|
-
function readAll(signal) {
|
|
53
|
-
return new Promise((resolve, reject) => {
|
|
54
|
-
let buf = "";
|
|
55
|
-
const onData = (c) => (buf += c.toString("utf8"));
|
|
56
|
-
const onEnd = () => {
|
|
57
|
-
cleanup();
|
|
58
|
-
resolve(buf.trim());
|
|
59
|
-
};
|
|
60
|
-
const onErr = (e) => {
|
|
61
|
-
cleanup();
|
|
62
|
-
reject(e);
|
|
63
|
-
};
|
|
64
|
-
const onAbort = () => {
|
|
65
|
-
cleanup();
|
|
66
|
-
reject(new Error("aborted"));
|
|
67
|
-
};
|
|
68
|
-
const cleanup = () => {
|
|
69
|
-
process.stdin.off("data", onData);
|
|
70
|
-
process.stdin.off("end", onEnd);
|
|
71
|
-
process.stdin.off("error", onErr);
|
|
72
|
-
signal.removeEventListener("abort", onAbort);
|
|
73
|
-
};
|
|
74
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
75
|
-
process.stdin.on("data", onData);
|
|
76
|
-
process.stdin.on("end", onEnd);
|
|
77
|
-
process.stdin.on("error", onErr);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,sEAAsE;AACtE,EAAE;AACF,uFAAuF;AACvF,0FAA0F;AAE1F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,oEAAoE;IACpE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,oEAAoE;IACpE,KAAK,E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QACF,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAClC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAChC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAClC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class AgentsCommand implements Command {
|
|
4
|
-
readonly name = "agents";
|
|
5
|
-
readonly summary = "List available AI agents (GET /api/agents)";
|
|
6
|
-
readonly schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
7
|
-
run(ctx: CommandContext): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAS1D,qBAAa,aAAc,YAAW,OAAO;IAC3C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,OAAO,gDAAgD;IAChE,QAAQ,CAAC,MAAM,iDAAU;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB9C"}
|
package/dist/commands/agents.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// src/commands/agents.ts — `/agents` / `pocketdev agents` → GET /api/agents
|
|
2
|
-
//
|
|
3
|
-
// SRP: list the AI agents the host exposes and their availability. Depends on HttpPort.
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { bindArgs, parseArgs } from "./ports.js";
|
|
6
|
-
const schema = z.object({});
|
|
7
|
-
export class AgentsCommand {
|
|
8
|
-
name = "agents";
|
|
9
|
-
summary = "List available AI agents (GET /api/agents)";
|
|
10
|
-
schema = schema;
|
|
11
|
-
async run(ctx) {
|
|
12
|
-
parseArgs(this.schema, bindArgs(ctx.argv, []));
|
|
13
|
-
const res = await ctx.http.get("/api/agents");
|
|
14
|
-
if (ctx.json) {
|
|
15
|
-
ctx.renderer.stream(JSON.stringify(res) + "\n");
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
if (res.agents.length === 0) {
|
|
19
|
-
ctx.renderer.stream("(no agents available)\n");
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
for (const a of res.agents) {
|
|
23
|
-
const status = a.available ? "ready" : "unavailable";
|
|
24
|
-
ctx.renderer.stream(`${a.id.padEnd(20)} ${a.name.padEnd(24)} ${status}\n`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=agents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,wFAAwF;AAExF,OA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
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class CommitsCommand implements Command {
|
|
4
|
-
readonly name = "commits";
|
|
5
|
-
readonly summary = "List recent commits (GET /api/commits)";
|
|
6
|
-
readonly aliases: string[];
|
|
7
|
-
readonly schema: z.ZodObject<{
|
|
8
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
limit: number;
|
|
11
|
-
}, {
|
|
12
|
-
limit?: number | undefined;
|
|
13
|
-
}>;
|
|
14
|
-
run(ctx: CommandContext): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=commits.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commits.d.ts","sourceRoot":"","sources":["../../src/commands/commits.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAW1D,qBAAa,cAAe,YAAW,OAAO;IAC5C,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,OAAO,4CAA4C;IAC5D,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,MAAM;;;;;;OAAU;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAuB9C"}
|
package/dist/commands/commits.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// src/commands/commits.ts — `/commits [--limit]` / `pocketdev commits` → GET /api/commits?limit
|
|
2
|
-
//
|
|
3
|
-
// SRP: list recent commits. Depends on HttpPort + Renderer.
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { bindArgs, parseArgs } from "./ports.js";
|
|
6
|
-
const schema = z.object({
|
|
7
|
-
limit: z.coerce.number().int().min(1).max(200).default(20),
|
|
8
|
-
});
|
|
9
|
-
export class CommitsCommand {
|
|
10
|
-
name = "commits";
|
|
11
|
-
summary = "List recent commits (GET /api/commits)";
|
|
12
|
-
aliases = ["log"];
|
|
13
|
-
schema = schema;
|
|
14
|
-
async run(ctx) {
|
|
15
|
-
const args = parseArgs(this.schema, bindArgs(ctx.argv, []));
|
|
16
|
-
const res = await ctx.http.get("/api/commits", { limit: String(args.limit) });
|
|
17
|
-
if (ctx.json) {
|
|
18
|
-
ctx.renderer.stream(JSON.stringify(res) + "\n");
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (res.commits.length === 0) {
|
|
22
|
-
ctx.renderer.stream("(no commits)\n");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
for (const c of res.commits) {
|
|
26
|
-
const short = c.hash.slice(0, 8);
|
|
27
|
-
const ai = c.aiAuthored ? " [ai]" : "";
|
|
28
|
-
const stat = formatStat(c.additions, c.deletions);
|
|
29
|
-
ctx.renderer.stream(`${short} ${c.subject}${ai}\n`);
|
|
30
|
-
ctx.renderer.stream(` ${c.author} · ${c.date}${stat}\n`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function formatStat(additions, deletions) {
|
|
35
|
-
if (additions === undefined && deletions === undefined)
|
|
36
|
-
return "";
|
|
37
|
-
return ` · +${additions ?? 0}/-${deletions ?? 0}`;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=commits.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commits.js","sourceRoot":"","sources":["../../src/commands/commits.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,EAAE;AACF,4DAA4D;AAE5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,CAA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AAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;YAClD,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,OAAO,GAAG,EAAE,IAAI,CAAC,CAAC;YACrD,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;CACF;AAED,SAAS,UAAU,CAAC,SAAkB,EAAE,SAAkB;IACxD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAClE,OAAO,OAAO,SAAS,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,EAAE,CAAC;AACpD,CAAC"}
|
package/dist/commands/diff.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class DiffCommand implements Command {
|
|
4
|
-
readonly name = "diff";
|
|
5
|
-
readonly summary = "Show git diff ranges for a file (GET /api/diff)";
|
|
6
|
-
readonly schema: z.ZodObject<{
|
|
7
|
-
path: z.ZodString;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
path: string;
|
|
10
|
-
}, {
|
|
11
|
-
path: string;
|
|
12
|
-
}>;
|
|
13
|
-
run(ctx: CommandContext): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAY1D,qBAAa,WAAY,YAAW,OAAO;IACzC,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,OAAO,qDAAqD;IACrE,QAAQ,CAAC,MAAM;;;;;;OAAU;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAiB9C"}
|
package/dist/commands/diff.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// src/commands/diff.ts — `/diff <path>` / `pocketdev diff <path>` → GET /api/diff?path
|
|
2
|
-
//
|
|
3
|
-
// SRP: fetch git diff ranges for a file and render them. Depends on HttpPort + Renderer.
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { bindArgs, parseArgs } from "./ports.js";
|
|
6
|
-
const schema = z.object({
|
|
7
|
-
path: z.string().min(1, "a file path is required"),
|
|
8
|
-
});
|
|
9
|
-
export class DiffCommand {
|
|
10
|
-
name = "diff";
|
|
11
|
-
summary = "Show git diff ranges for a file (GET /api/diff)";
|
|
12
|
-
schema = schema;
|
|
13
|
-
async run(ctx) {
|
|
14
|
-
const args = parseArgs(this.schema, bindArgs(ctx.argv, ["path"]));
|
|
15
|
-
const res = await ctx.http.get("/api/diff", { path: args.path });
|
|
16
|
-
if (ctx.json) {
|
|
17
|
-
ctx.renderer.stream(JSON.stringify(res) + "\n");
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (res.ranges.length === 0) {
|
|
21
|
-
ctx.renderer.stream(`${res.path}: no changes\n`);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
ctx.renderer.diff(res.ranges, res.path);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=diff.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,EAAE;AACF,yFAAyF;AAEzF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,yBAAyB,CAAC;CACnD,CAAC,CAAC;AAOH,MAAM,OAAO,WAAW;IACb,IAAI,GAAG,MAAM,CAAC;IACd,OAAO,GAAG,iDAAiD,CAAC;IAC5D,MAAM,GAAG,MAAM,CAAC;IAEzB,KAAK,CAAC,GAAG,CAAC,GAAmB;QAC3B,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAElE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAe,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAE/E,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACb,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;YAChD,OAAO;QACT,CAAC;QAED,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,gBAAgB,CAAC,CAAC;YACjD,OAAO;QACT,CAAC;QAED,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class ExposeCommand implements Command {
|
|
4
|
-
readonly name = "expose";
|
|
5
|
-
readonly summary = "Expose a local port via tunnel (POST /api/expose \u2014 501 until implemented)";
|
|
6
|
-
readonly schema: z.ZodObject<{
|
|
7
|
-
port: z.ZodNumber;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
port: number;
|
|
10
|
-
}, {
|
|
11
|
-
port: number;
|
|
12
|
-
}>;
|
|
13
|
-
run(ctx: CommandContext): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=expose.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expose.d.ts","sourceRoot":"","sources":["../../src/commands/expose.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAO1D,qBAAa,aAAc,YAAW,OAAO;IAC3C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,OAAO,oFAA+E;IAC/F,QAAQ,CAAC,MAAM;;;;;;OAAU;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAwB9C"}
|
package/dist/commands/expose.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// src/commands/expose.ts — `/expose <port>` / `pocketdev expose <port>` → POST /api/expose
|
|
2
|
-
//
|
|
3
|
-
// SRP: request a public tunnel for a local port. The host returns 501 (not-implemented)
|
|
4
|
-
// until the tunnel is built; we surface its hint rather than pretending it worked (§14).
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { CliError } from "../core/errors.js";
|
|
7
|
-
import { bindArgs, parseArgs } from "./ports.js";
|
|
8
|
-
const schema = z.object({
|
|
9
|
-
port: z.coerce.number().int().min(1).max(65535),
|
|
10
|
-
});
|
|
11
|
-
export class ExposeCommand {
|
|
12
|
-
name = "expose";
|
|
13
|
-
summary = "Expose a local port via tunnel (POST /api/expose — 501 until implemented)";
|
|
14
|
-
schema = schema;
|
|
15
|
-
async run(ctx) {
|
|
16
|
-
const args = parseArgs(this.schema, bindArgs(ctx.argv, ["port"]));
|
|
17
|
-
try {
|
|
18
|
-
const res = await ctx.http.post("/api/expose", { port: args.port });
|
|
19
|
-
// Forward-compatible: if/when the host implements tunnels it returns a public URL.
|
|
20
|
-
if (ctx.json) {
|
|
21
|
-
ctx.renderer.stream(JSON.stringify(res) + "\n");
|
|
22
|
-
}
|
|
23
|
-
else if (res.url) {
|
|
24
|
-
ctx.renderer.stream(`Port ${args.port} is now public at ${res.url}\n`);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
ctx.renderer.stream(`Exposed port ${args.port}.\n`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
if (err instanceof CliError && err.kind === "not_implemented") {
|
|
32
|
-
ctx.renderer.error(`Port tunneling is not implemented on this host yet (expose ${args.port}).`, err.hint ?? "Install a tunneler (e.g. cloudflared) per the host's guidance.");
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
throw err;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=expose.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expose.js","sourceRoot":"","sources":["../../src/commands/expose.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,EAAE;AACF,wFAAwF;AACxF,yFAAyF;AAEzF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,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ACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CACF"}
|
package/dist/commands/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Command } from "./ports.js";
|
|
2
|
-
export { CommandRegistry } from "./registry.js";
|
|
3
|
-
export type { Command, CommandContext, ArgSchema } from "./ports.js";
|
|
4
|
-
/** The CLI is a SINGLE command: `pocketdev` runs the live session (and signs in inline when needed — see
|
|
5
|
-
* SessionCommand). The other one-shot commands were retired; the session is the only entry. */
|
|
6
|
-
export declare function defaultCommands(): Command[];
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAErE;gGACgG;AAChG,wBAAgB,eAAe,IAAI,OAAO,EAAE,CAE3C"}
|
package/dist/commands/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// src/commands/index.ts — the default command set (OCP wiring helper).
|
|
2
|
-
//
|
|
3
|
-
// The DI composition root imports `defaultCommands()` and feeds it to `CommandRegistry`.
|
|
4
|
-
// Adding a command = add a file and a line here; the router/loop never changes.
|
|
5
|
-
import { SessionCommand } from "./session.js";
|
|
6
|
-
export { CommandRegistry } from "./registry.js";
|
|
7
|
-
/** The CLI is a SINGLE command: `pocketdev` runs the live session (and signs in inline when needed — see
|
|
8
|
-
* SessionCommand). The other one-shot commands were retired; the session is the only entry. */
|
|
9
|
-
export function defaultCommands() {
|
|
10
|
-
return [new SessionCommand()];
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,yFAAyF;AACzF,gFAAgF;AAGhF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD;gGACgG;AAChG,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/commands/login.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class LoginCommand implements Command {
|
|
4
|
-
readonly name = "login";
|
|
5
|
-
readonly summary = "Sign in to the active host (LOCAL verify or Hydra device grant)";
|
|
6
|
-
readonly schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
7
|
-
run(ctx: CommandContext): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK1D,qBAAa,YAAa,YAAW,OAAO;IAC1C,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,OAAO,qEAAqE;IACrF,QAAQ,CAAC,MAAM,iDAAU;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAgB9C"}
|
package/dist/commands/login.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// src/commands/login.ts — `/login` / `pocketdev login`.
|
|
2
|
-
//
|
|
3
|
-
// SRP: this command only drives the AuthProvider's interactive sign-in (HydraOAuthAuthProvider:
|
|
4
|
-
// OAuth2 device grant + PKCE + keychain), hidden behind the AuthProvider port.
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { bindArgs, parseArgs } from "./ports.js";
|
|
7
|
-
const schema = z.object({});
|
|
8
|
-
export class LoginCommand {
|
|
9
|
-
name = "login";
|
|
10
|
-
summary = "Sign in to the active host (LOCAL verify or Hydra device grant)";
|
|
11
|
-
schema = schema;
|
|
12
|
-
async run(ctx) {
|
|
13
|
-
parseArgs(this.schema, bindArgs(ctx.argv, []));
|
|
14
|
-
const profile = ctx.config.profile();
|
|
15
|
-
ctx.renderer.stream(`Signing in to '${profile.name}' (${profile.mode}) at ${profile.hostUrl}…\n`);
|
|
16
|
-
// login() throws on failure (bad PAT, denied device grant); let the router map it.
|
|
17
|
-
await ctx.auth.login();
|
|
18
|
-
const subject = ctx.auth.subject();
|
|
19
|
-
if (ctx.json) {
|
|
20
|
-
ctx.renderer.stream(JSON.stringify({ ok: true, profile: profile.name, subject }) + "\n");
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
ctx.renderer.stream(`Signed in as ${subject}.\n`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=login.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,gGAAgG;AAChG,+EAA+E;AAE/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE5B,MAAM,OAAO,YAAY;IACd,IAAI,GAAG,OAAO,CAAC;IACf,OAAO,GAAG,iEAAiE,CAAC;IAC5E,MAAM,GAAG,MAAM,CAAC;IAEzB,KAAK,CAAC,GAAG,CAAC,GAAmB;QAC3B,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QAE/C,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACrC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,OAAO,CAAC,IAAI,MAAM,OAAO,CAAC,IAAI,QAAQ,OAAO,CAAC,OAAO,KAAK,CAAC,CAAC;QAElG,mFAAmF;QACnF,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAEvB,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACb,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3F,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,OAAO,KAAK,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class LogoutCommand implements Command {
|
|
4
|
-
readonly name = "logout";
|
|
5
|
-
readonly summary = "Drop cached credentials for the active host";
|
|
6
|
-
readonly schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
7
|
-
run(ctx: CommandContext): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=logout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK1D,qBAAa,aAAc,YAAW,OAAO;IAC3C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,OAAO,iDAAiD;IACjE,QAAQ,CAAC,MAAM,iDAAU;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAY9C"}
|
package/dist/commands/logout.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// src/commands/logout.ts — `/logout` / `pocketdev logout`.
|
|
2
|
-
//
|
|
3
|
-
// SRP: drop cached credentials. LOCAL clears the in-memory PAT; REMOTE revokes the token
|
|
4
|
-
// (/oauth2/revoke) and clears the OS keychain entry. Both behind AuthProvider.logout().
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { bindArgs, parseArgs } from "./ports.js";
|
|
7
|
-
const schema = z.object({});
|
|
8
|
-
export class LogoutCommand {
|
|
9
|
-
name = "logout";
|
|
10
|
-
summary = "Drop cached credentials for the active host";
|
|
11
|
-
schema = schema;
|
|
12
|
-
async run(ctx) {
|
|
13
|
-
parseArgs(this.schema, bindArgs(ctx.argv, []));
|
|
14
|
-
const profile = ctx.config.profile();
|
|
15
|
-
await ctx.auth.logout();
|
|
16
|
-
if (ctx.json) {
|
|
17
|
-
ctx.renderer.stream(JSON.stringify({ ok: true, profile: profile.name }) + "\n");
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
ctx.renderer.stream(`Signed out of '${profile.name}'.\n`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=logout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,yFAAyF;AACzF,wFAAwF;AAExF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE5B,MAAM,OAAO,aAAa;IACf,IAAI,GAAG,QAAQ,CAAC;IAChB,OAAO,GAAG,6CAA6C,CAAC;IACxD,MAAM,GAAG,MAAM,CAAC;IAEzB,KAAK,CAAC,GAAG,CAAC,GAAmB;QAC3B,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QAE/C,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAExB,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACb,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAClF,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,OAAO,CAAC,IAAI,MAAM,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CACF"}
|
package/dist/commands/me.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Command, CommandContext } from "./ports.js";
|
|
3
|
-
export declare class MeCommand implements Command {
|
|
4
|
-
readonly name = "me";
|
|
5
|
-
readonly summary = "Show the signed-in account and tier (GET /api/me)";
|
|
6
|
-
readonly aliases: string[];
|
|
7
|
-
readonly schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
8
|
-
run(ctx: CommandContext): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=me.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../src/commands/me.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI1D,qBAAa,SAAU,YAAW,OAAO;IACvC,QAAQ,CAAC,IAAI,QAAQ;IACrB,QAAQ,CAAC,OAAO,uDAAuD;IACvE,QAAQ,CAAC,OAAO,WAAc;IAC9B,QAAQ,CAAC,MAAM,iDAAU;IAEnB,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAc9C"}
|
package/dist/commands/me.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// src/commands/me.ts — `/me` / `pocketdev me` → GET /api/me
|
|
2
|
-
//
|
|
3
|
-
// SRP: print the signed-in account + effective tier/entitlement. Depends on HttpPort only (ISP).
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
const schema = z.object({});
|
|
6
|
-
export class MeCommand {
|
|
7
|
-
name = "me";
|
|
8
|
-
summary = "Show the signed-in account and tier (GET /api/me)";
|
|
9
|
-
aliases = ["whoami"];
|
|
10
|
-
schema = schema;
|
|
11
|
-
async run(ctx) {
|
|
12
|
-
const me = await ctx.http.get("/api/me");
|
|
13
|
-
if (ctx.json) {
|
|
14
|
-
ctx.renderer.stream(JSON.stringify(me) + "\n");
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const e = me.entitlement;
|
|
18
|
-
ctx.renderer.stream(`account: ${me.principal.subject}\n`);
|
|
19
|
-
ctx.renderer.stream(`tier: ${me.tier}\n`);
|
|
20
|
-
ctx.renderer.stream(`cloud: ${e?.cloudRemote ? "enabled" : "disabled"}\n`);
|
|
21
|
-
if (e?.status)
|
|
22
|
-
ctx.renderer.stream(`status: ${e.status}\n`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=me.js.map
|
package/dist/commands/me.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"me.js","sourceRoot":"","sources":["../../src/commands/me.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,iGAAiG;AAEjG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE5B,MAAM,OAAO,SAAS;IACX,IAAI,GAAG,IAAI,CAAC;IACZ,OAAO,GAAG,mDAAmD,CAAC;IAC9D,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrB,MAAM,GAAG,MAAM,CAAC;IAEzB,KAAK,CAAC,GAAG,CAAC,GAAmB;QAC3B,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAa,SAAS,CAAC,CAAC;QAErD,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACb,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;YAC/C,OAAO;QACT,CAAC;QAED,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC;QACzB,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,CAAC;QAC1D,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC;QAC7C,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC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