appduct 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -52
- package/dist/artifact-inspect.d.ts +5 -4
- package/dist/bin.d.ts +0 -1
- package/dist/bin.js +1250 -2
- package/dist/cli/command-options.d.ts +8 -1
- package/dist/cli/create-cli.d.ts +0 -1
- package/dist/cli/dispatch.d.ts +10 -1
- package/dist/cli/envelope.d.ts +19 -0
- package/dist/cli/global-flags.d.ts +30 -0
- package/dist/cli/open-target.d.ts +25 -8
- package/dist/cli/result-types.d.ts +30 -5
- package/dist/cli/router.d.ts +78 -0
- package/dist/cli/routes/daemon/index.d.ts +9 -0
- package/dist/cli/routes/daemon/index.js +848 -0
- package/dist/cli/routes/daemon/run.d.ts +3 -0
- package/dist/cli/routes/daemon/run.js +3246 -0
- package/dist/cli/routes/daemon/start.d.ts +3 -0
- package/dist/cli/routes/daemon/start.js +1668 -0
- package/dist/cli/routes/daemon/status.d.ts +4 -0
- package/dist/cli/routes/daemon/status.js +1676 -0
- package/dist/cli/routes/daemon/stop.d.ts +4 -0
- package/dist/cli/routes/daemon/stop.js +1646 -0
- package/dist/cli/routes/doctor.d.ts +3 -0
- package/dist/cli/routes/doctor.js +1075 -0
- package/dist/cli/routes/events.d.ts +3 -0
- package/dist/cli/routes/events.js +1906 -0
- package/dist/cli/routes/init.d.ts +3 -0
- package/dist/cli/routes/init.js +1486 -0
- package/dist/cli/routes/invoke.d.ts +3 -0
- package/dist/cli/routes/invoke.js +1884 -0
- package/dist/cli/routes/keygen.d.ts +3 -0
- package/dist/cli/routes/keygen.js +928 -0
- package/dist/cli/routes/link.d.ts +3 -0
- package/dist/cli/routes/link.js +2705 -0
- package/dist/cli/routes/ls.d.ts +3 -0
- package/dist/cli/routes/ls.js +1659 -0
- package/dist/cli/routes/mcp.d.ts +5 -0
- package/dist/cli/routes/mcp.js +3917 -0
- package/dist/cli/routes/revoke.d.ts +3 -0
- package/dist/cli/routes/revoke.js +1675 -0
- package/dist/cli/routes/tools.d.ts +3 -0
- package/dist/cli/routes/tools.js +1851 -0
- package/dist/cli/runner.d.ts +3 -11
- package/dist/cli/types.d.ts +9 -6
- package/dist/cli/version-guard.d.ts +20 -0
- package/dist/cli.d.ts +0 -1
- package/dist/client/app-client.d.ts +0 -1
- package/dist/client/bootstrap.d.ts +4 -4
- package/dist/client/connect.d.ts +0 -1
- package/dist/client/errors.d.ts +0 -1
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.js +2379 -16
- package/dist/commands/daemon/context.d.ts +14 -0
- package/dist/commands/daemon/run.d.ts +11 -0
- package/dist/commands/daemon/start.d.ts +5 -0
- package/dist/commands/daemon/status.d.ts +5 -0
- package/dist/commands/daemon/stop.d.ts +5 -0
- package/dist/commands/doctor.d.ts +0 -1
- package/dist/commands/events.d.ts +0 -1
- package/dist/commands/init.d.ts +17 -4
- package/dist/commands/invoke.d.ts +0 -1
- package/dist/commands/keygen.d.ts +0 -1
- package/dist/commands/link.d.ts +1 -2
- package/dist/commands/ls.d.ts +0 -1
- package/dist/commands/mcp.d.ts +2 -4
- package/dist/commands/revoke.d.ts +0 -1
- package/dist/commands/tools.d.ts +19 -3
- package/dist/daemon/address.d.ts +0 -1
- package/dist/daemon/audit.d.ts +6 -11
- package/dist/daemon/calls.d.ts +0 -1
- package/dist/daemon/config.d.ts +13 -16
- package/dist/daemon/daemon.d.ts +0 -1
- package/dist/daemon/event-bus.d.ts +0 -1
- package/dist/daemon/links.d.ts +0 -1
- package/dist/daemon/listener.d.ts +0 -1
- package/dist/daemon/log-rotation.d.ts +0 -1
- package/dist/daemon/pidfile.d.ts +14 -8
- package/dist/daemon/policy.d.ts +0 -1
- package/dist/daemon/registry.d.ts +0 -1
- package/dist/daemon/rpc-errors.d.ts +16 -0
- package/dist/daemon/rpc-server.d.ts +0 -11
- package/dist/daemon/sessions.d.ts +0 -1
- package/dist/daemon/socket-probe.d.ts +0 -1
- package/dist/daemon/state-dir.d.ts +0 -1
- package/dist/daemon/timers.d.ts +0 -1
- package/dist/daemon/tls.d.ts +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/host-certificate.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1307 -3
- package/dist/key-material.d.ts +0 -1
- package/dist/link.d.ts +8 -7
- package/dist/mcp/app-tools.d.ts +153 -0
- package/dist/mcp/connect-tool.d.ts +14 -8
- package/dist/mcp/daemon-tools.d.ts +2 -11
- package/dist/mcp/events-tool.d.ts +0 -1
- package/dist/mcp/server.d.ts +33 -14
- package/dist/native-scheme.d.ts +0 -1
- package/dist/output.d.ts +8 -11
- package/dist/package-root.d.ts +11 -0
- package/dist/package-version.d.ts +0 -1
- package/dist/qr-terminal.d.ts +0 -1
- package/dist/rpc/client.d.ts +0 -1
- package/dist/scheme.d.ts +60 -2
- package/dist/spki-pin.d.ts +0 -1
- package/package.json +4 -3
- package/dist/artifact-inspect.d.ts.map +0 -1
- package/dist/artifact-inspect.js +0 -315
- package/dist/bin.d.ts.map +0 -1
- package/dist/cli/command-options.d.ts.map +0 -1
- package/dist/cli/command-options.js +0 -95
- package/dist/cli/create-cli.d.ts.map +0 -1
- package/dist/cli/create-cli.js +0 -56
- package/dist/cli/dispatch.d.ts.map +0 -1
- package/dist/cli/dispatch.js +0 -275
- package/dist/cli/open-target.d.ts.map +0 -1
- package/dist/cli/open-target.js +0 -438
- package/dist/cli/result-types.d.ts.map +0 -1
- package/dist/cli/result-types.js +0 -6
- package/dist/cli/runner.d.ts.map +0 -1
- package/dist/cli/runner.js +0 -111
- package/dist/cli/types.d.ts.map +0 -1
- package/dist/cli/types.js +0 -10
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -2
- package/dist/client/app-client.d.ts.map +0 -1
- package/dist/client/app-client.js +0 -223
- package/dist/client/bootstrap.d.ts.map +0 -1
- package/dist/client/bootstrap.js +0 -108
- package/dist/client/connect.d.ts.map +0 -1
- package/dist/client/connect.js +0 -38
- package/dist/client/errors.d.ts.map +0 -1
- package/dist/client/errors.js +0 -40
- package/dist/client/index.d.ts.map +0 -1
- package/dist/commands/daemon.d.ts +0 -22
- package/dist/commands/daemon.d.ts.map +0 -1
- package/dist/commands/daemon.js +0 -128
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -42
- package/dist/commands/events.d.ts.map +0 -1
- package/dist/commands/events.js +0 -76
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -231
- package/dist/commands/invoke.d.ts.map +0 -1
- package/dist/commands/invoke.js +0 -54
- package/dist/commands/keygen.d.ts.map +0 -1
- package/dist/commands/keygen.js +0 -46
- package/dist/commands/link.d.ts.map +0 -1
- package/dist/commands/link.js +0 -43
- package/dist/commands/ls.d.ts.map +0 -1
- package/dist/commands/ls.js +0 -7
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -98
- package/dist/commands/revoke.d.ts.map +0 -1
- package/dist/commands/revoke.js +0 -7
- package/dist/commands/tools.d.ts.map +0 -1
- package/dist/commands/tools.js +0 -52
- package/dist/daemon/address.d.ts.map +0 -1
- package/dist/daemon/address.js +0 -71
- package/dist/daemon/audit.d.ts.map +0 -1
- package/dist/daemon/audit.js +0 -237
- package/dist/daemon/calls.d.ts.map +0 -1
- package/dist/daemon/calls.js +0 -158
- package/dist/daemon/config.d.ts.map +0 -1
- package/dist/daemon/config.js +0 -170
- package/dist/daemon/daemon.d.ts.map +0 -1
- package/dist/daemon/daemon.js +0 -560
- package/dist/daemon/event-bus.d.ts.map +0 -1
- package/dist/daemon/event-bus.js +0 -111
- package/dist/daemon/links.d.ts.map +0 -1
- package/dist/daemon/links.js +0 -118
- package/dist/daemon/listener.d.ts.map +0 -1
- package/dist/daemon/listener.js +0 -132
- package/dist/daemon/log-rotation.d.ts.map +0 -1
- package/dist/daemon/log-rotation.js +0 -136
- package/dist/daemon/pidfile.d.ts.map +0 -1
- package/dist/daemon/pidfile.js +0 -90
- package/dist/daemon/policy.d.ts.map +0 -1
- package/dist/daemon/policy.js +0 -24
- package/dist/daemon/registry.d.ts.map +0 -1
- package/dist/daemon/registry.js +0 -31
- package/dist/daemon/rpc-server.d.ts.map +0 -1
- package/dist/daemon/rpc-server.js +0 -203
- package/dist/daemon/sessions.d.ts.map +0 -1
- package/dist/daemon/sessions.js +0 -429
- package/dist/daemon/socket-probe.d.ts.map +0 -1
- package/dist/daemon/socket-probe.js +0 -28
- package/dist/daemon/state-dir.d.ts.map +0 -1
- package/dist/daemon/state-dir.js +0 -43
- package/dist/daemon/timers.d.ts.map +0 -1
- package/dist/daemon/timers.js +0 -12
- package/dist/daemon/tls.d.ts.map +0 -1
- package/dist/daemon/tls.js +0 -79
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -162
- package/dist/host-certificate.d.ts.map +0 -1
- package/dist/host-certificate.js +0 -111
- package/dist/index.d.ts.map +0 -1
- package/dist/key-material.d.ts.map +0 -1
- package/dist/key-material.js +0 -42
- package/dist/link.d.ts.map +0 -1
- package/dist/link.js +0 -117
- package/dist/mcp/connect-tool.d.ts.map +0 -1
- package/dist/mcp/connect-tool.js +0 -396
- package/dist/mcp/daemon-tools.d.ts.map +0 -1
- package/dist/mcp/daemon-tools.js +0 -29
- package/dist/mcp/events-tool.d.ts.map +0 -1
- package/dist/mcp/events-tool.js +0 -322
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -538
- package/dist/mcp/tool-mapping.d.ts +0 -58
- package/dist/mcp/tool-mapping.d.ts.map +0 -1
- package/dist/mcp/tool-mapping.js +0 -143
- package/dist/mcp/tool-namespace.d.ts +0 -40
- package/dist/mcp/tool-namespace.d.ts.map +0 -1
- package/dist/mcp/tool-namespace.js +0 -65
- package/dist/native-scheme.d.ts.map +0 -1
- package/dist/native-scheme.js +0 -465
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js +0 -342
- package/dist/package-version.d.ts.map +0 -1
- package/dist/package-version.js +0 -47
- package/dist/qr-terminal.d.ts.map +0 -1
- package/dist/qr-terminal.js +0 -45
- package/dist/rpc/client.d.ts.map +0 -1
- package/dist/rpc/client.js +0 -819
- package/dist/scheme.d.ts.map +0 -1
- package/dist/scheme.js +0 -321
- package/dist/spki-pin.d.ts.map +0 -1
- package/dist/spki-pin.js +0 -14
package/dist/cli/runner.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CliResult } from "./result-types.js";
|
|
2
2
|
import { type RenderOptions } from "../output.js";
|
|
3
|
-
import
|
|
3
|
+
import type { CliEnv } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Long-lived command result shape shared by any CLI command that keeps a process alive
|
|
6
6
|
* until completion/cancellation (e.g. a foreground daemon run). Not tied to any specific
|
|
@@ -22,14 +22,6 @@ export type HostedCommandReporter = {
|
|
|
22
22
|
onEvent: (event: unknown) => void | Promise<void>;
|
|
23
23
|
dispose: () => void;
|
|
24
24
|
};
|
|
25
|
-
export declare const executeCommand: (command: string, handler: () => CliResult<unknown> | Promise<CliResult<unknown>>,
|
|
26
|
-
|
|
27
|
-
}) => Promise<number>;
|
|
28
|
-
export declare const executeHostedCommand: (command: string, handler: () => Promise<HostedCommandResult>, options: CliIoWriters & {
|
|
29
|
-
json: boolean;
|
|
30
|
-
color: boolean;
|
|
31
|
-
clock: Clock;
|
|
32
|
-
reporter?: HostedCommandReporter;
|
|
33
|
-
}) => Promise<number>;
|
|
25
|
+
export declare const executeCommand: (command: string, handler: () => CliResult<unknown> | Promise<CliResult<unknown>>, env: CliEnv, render?: Partial<Pick<RenderOptions, "qr" | "full">>) => Promise<number>;
|
|
26
|
+
export declare const executeHostedCommand: (command: string, handler: () => Promise<HostedCommandResult>, env: CliEnv, reporter?: HostedCommandReporter) => Promise<number>;
|
|
34
27
|
export {};
|
|
35
|
-
//# sourceMappingURL=runner.d.ts.map
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GlobalFlags } from "./global-flags.js";
|
|
2
2
|
export type Clock = {
|
|
3
3
|
now: () => Date;
|
|
4
4
|
};
|
|
5
5
|
export declare const systemClock: Clock;
|
|
6
|
-
export declare const createCommandMeta: (command: string, startedAt: Date, finishedAt: Date) => CommandMeta;
|
|
7
6
|
export type RunCliOptions = {
|
|
8
7
|
stdout?: Pick<typeof process.stdout, "write" | "isTTY">;
|
|
9
8
|
stderr?: Pick<typeof process.stderr, "write">;
|
|
10
9
|
clock?: Clock;
|
|
11
10
|
};
|
|
12
11
|
export type CliIoWriters = Required<Pick<RunCliOptions, "stdout" | "stderr">>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Everything a route's handler needs about how to behave and where to write, in one object:
|
|
14
|
+
* the resolved global flags plus the writers and clock. A future global flag is added to
|
|
15
|
+
* `global-flags.ts`'s table and becomes available as `env.flags.<name>` everywhere this is
|
|
16
|
+
* threaded, with no other plumbing change.
|
|
17
|
+
*/
|
|
18
|
+
export type CliEnv = {
|
|
19
|
+
flags: GlobalFlags;
|
|
16
20
|
stdout: CliIoWriters["stdout"];
|
|
17
21
|
stderr: CliIoWriters["stderr"];
|
|
18
22
|
clock: Clock;
|
|
19
23
|
};
|
|
20
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The daemon version check as a route sees it (ARCHITECTURE.md §4 "Version drift"). Lives on the
|
|
3
|
+
* route side of the eager/route bundle boundary on purpose: the check throws
|
|
4
|
+
* `DaemonVersionMismatchError` instances, and they must be created by the same copy of
|
|
5
|
+
* `rpc/client.ts` that the route's `runner.ts` classifies them with (see `RouteContext`).
|
|
6
|
+
*/
|
|
7
|
+
import type { RouteContext } from "./router.js";
|
|
8
|
+
import { type VersionCheckOptions } from "../rpc/client.js";
|
|
9
|
+
/** The check's options for a route, with the drift notice going to `onWarning` (default: the
|
|
10
|
+
* context's `warn`). `mcp` passes its own writer: stderr is that server's only log channel. */
|
|
11
|
+
export declare const versionCheckOptions: (context: RouteContext, onWarning?: (message: string) => void) => Promise<VersionCheckOptions>;
|
|
12
|
+
/**
|
|
13
|
+
* Wraps a command handler so the daemon's version is verified once, before the command's first
|
|
14
|
+
* RPC. `autoSpawn: false`: with nothing listening there is no drift to find, and any daemon this
|
|
15
|
+
* process spawns afterwards is its own build. Applied to every command that talks to the daemon
|
|
16
|
+
* except `daemon run` (it *is* the daemon), `daemon status` (warns instead — see
|
|
17
|
+
* `commands/daemon/status.ts`) and `daemon stop` (already the remedy); `keygen`/`doctor` never
|
|
18
|
+
* open a daemon connection at all.
|
|
19
|
+
*/
|
|
20
|
+
export declare const guarded: (context: RouteContext) => <T>(handler: () => T | Promise<T>) => (() => Promise<T>);
|
package/dist/cli.d.ts
CHANGED
|
@@ -123,4 +123,3 @@ export type AppClient<TTools = ToolMap> = {
|
|
|
123
123
|
export declare const transportTimeoutForToolCall: (timeoutMs: number | undefined) => number;
|
|
124
124
|
export declare const makeAppClient: <TTools = ToolMap>(stream: DaemonStream, sessionId: string) => AppClient<TTools>;
|
|
125
125
|
export {};
|
|
126
|
-
//# sourceMappingURL=app-client.d.ts.map
|
|
@@ -13,9 +13,10 @@ export type LinkOptions = {
|
|
|
13
13
|
target?: OpenTarget;
|
|
14
14
|
/** `--device` equivalent: an adb serial, a simulator udid, or a paired-device udid. */
|
|
15
15
|
device?: string;
|
|
16
|
-
/** `--
|
|
17
|
-
*
|
|
18
|
-
|
|
16
|
+
/** `--app-id` equivalent: the installed app's id, required (via this, or the project
|
|
17
|
+
* `.appduct/config.json`'s `appId.<platform>`) with `target: "android"` or `target:
|
|
18
|
+
* "ios-device"`. */
|
|
19
|
+
appId?: string;
|
|
19
20
|
/** `--relaunch` equivalent; only valid with `target: "ios-device"`. */
|
|
20
21
|
relaunch?: boolean;
|
|
21
22
|
/** Highest-precedence scheme source, ahead of `APPDUCT_SCHEME`, a project
|
|
@@ -45,4 +46,3 @@ export type WaitForSessionOptions = {
|
|
|
45
46
|
/** Waits for `sessionId` (from {@link link}) to be claimed by a device, then returns a connected
|
|
46
47
|
* {@link AppClient} for it — resolves immediately if it's already claimed. */
|
|
47
48
|
export declare const waitForSession: <TTools = ToolMap>(sessionId: string, options?: WaitForSessionOptions) => Promise<AppClient<TTools>>;
|
|
48
|
-
//# sourceMappingURL=bootstrap.d.ts.map
|
package/dist/client/connect.d.ts
CHANGED
|
@@ -14,4 +14,3 @@ export type ConnectOptions = {
|
|
|
14
14
|
};
|
|
15
15
|
/** Opens a persistent connection to the daemon and resolves `options.selector` to one session. */
|
|
16
16
|
export declare const connect: <TTools = ToolMap>(options?: ConnectOptions) => Promise<AppClient<TTools>>;
|
|
17
|
-
//# sourceMappingURL=connect.d.ts.map
|
package/dist/client/errors.d.ts
CHANGED
|
@@ -23,4 +23,3 @@ export declare class AppductError extends Error {
|
|
|
23
23
|
/** Converts any error thrown by the RPC layer into a {@link AppductError}, preserving the wire
|
|
24
24
|
* `data.type` verbatim when present. Idempotent on an already-converted error. */
|
|
25
25
|
export declare const toAppductError: (error: unknown) => AppductError;
|
|
26
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dist/client/index.d.ts
CHANGED
|
@@ -16,4 +16,3 @@ export { link, waitForSession, type LinkOptions, type LinkResult, type WaitForSe
|
|
|
16
16
|
export { AppductError, type AppductErrorType } from "./errors.js";
|
|
17
17
|
export type { AppClient, AppEvent, CallOptions, EventsOptions, EventsResult, ToolMap, WaitForEventOptions, } from "./app-client.js";
|
|
18
18
|
export type { AgentEndpoint, ErrorType, ToolDescriptor } from "@appduct/shared";
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|