@gajae-gateway/cli 0.1.3 → 0.1.5

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.
@@ -0,0 +1,24 @@
1
+ import { type SourceExtract } from "./plan";
2
+ import { type SourceTree } from "./source-fs";
3
+ /**
4
+ * Hermes Agent (NousResearch/hermes-agent) keeps everything under one home,
5
+ * `~/.hermes` (HERMES_HOME):
6
+ *
7
+ * SOUL.md, AGENTS.md persona / instructions
8
+ * memories/MEMORY.md, USER.md bounded entry stores, entries joined by "\n§\n"
9
+ * .env credentials (DISCORD_BOT_TOKEN, SLACK_BOT_TOKEN, ...)
10
+ * config.yaml settings (discord.free_response_channels, ...)
11
+ * cron/jobs.json {"jobs": [...], "updated_at": ...}
12
+ * skills/<category>/<name>/SKILL.md, skills/.bundled_manifest
13
+ *
14
+ * See docs/migration.md for the upstream references.
15
+ */
16
+ export declare const HERMES_ENTRY_DELIMITER = "\n\u00A7\n";
17
+ export declare function detectHermes(root: string): Promise<boolean>;
18
+ export declare function readHermes(tree: SourceTree, home: string): Promise<SourceExtract>;
19
+ /** Hermes stores memory as delimited entries; gajae-way memory is Markdown, one bullet block per entry. */
20
+ export declare function entriesToMarkdown(title: string, raw: string): string;
21
+ export declare function copySkill(tree: SourceTree, dir: string, name: string, extract: SourceExtract, seen: Set<string>): Promise<void>;
22
+ /** Top-level entries no reader consumed, reported so nothing is dropped silently. */
23
+ export declare function reportLeftovers(tree: SourceTree, dir: string, extract: SourceExtract, reason: (name: string) => string): Promise<void>;
24
+ //# sourceMappingURL=hermes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../src/migrate/hermes.ts"],"names":[],"mappings":"AAEA,OAAO,EAWN,KAAK,aAAa,EAClB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAMN,KAAK,UAAU,EAGf,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,eAAU,CAAC;AAE9C,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMjE;AAiBD,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAmHvF;AAED,2GAA2G;AAC3G,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAMpE;AAuMD,wBAAsB,SAAS,CAC9B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,GACf,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED,qFAAqF;AACrF,wBAAsB,eAAe,CACpC,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC9B,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -0,0 +1,10 @@
1
+ import { type SourceExtract } from "./plan";
2
+ import { type SourceTree } from "./source-fs";
3
+ /**
4
+ * OpenClaw is a gajae-way-compatible agent framework. Migration reads its
5
+ * config.json, .env, and skill/memory structures from an OpenClaw home.
6
+ */
7
+ export declare const OPENCLAW_CONFIG = "config.json";
8
+ export declare function detectOpenClaw(root: string): Promise<boolean>;
9
+ export declare function readOpenClaw(tree: SourceTree, _home: string): Promise<SourceExtract>;
10
+ //# sourceMappingURL=openclaw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openclaw.d.ts","sourceRoot":"","sources":["../../src/migrate/openclaw.ts"],"names":[],"mappings":"AAEA,OAAO,EAQN,KAAK,aAAa,EAElB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAmD,KAAK,UAAU,EAAyB,MAAM,aAAa,CAAC;AAEtH;;;GAGG;AACH,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAInE;AAUD,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAoG1F"}
@@ -0,0 +1,117 @@
1
+ import type { MonitorSpec, OriginRef } from "@gajae-gateway/protocol";
2
+ export declare const MIGRATION_SOURCES: readonly ["hermes", "openclaw"];
3
+ export type MigrationSource = (typeof MIGRATION_SOURCES)[number];
4
+ export type MigrationCategory = "persona" | "memory" | "channels" | "credentials" | "monitors" | "skills" | "other";
5
+ /** One file the migration produces, relative to the gajae-way home. */
6
+ export interface SourceFile {
7
+ readonly category: MigrationCategory;
8
+ /** Source path(s) this output derives from, for the report. */
9
+ readonly sources: readonly string[];
10
+ /** Target path relative to the gajae-way home. */
11
+ readonly target: string;
12
+ readonly content: string | Uint8Array;
13
+ /** Credential material: written 0600 under secrets/, never printed. */
14
+ readonly secret?: boolean;
15
+ /** Modification time to carry over from the source (timestamps are preserved). */
16
+ readonly mtime?: Date;
17
+ }
18
+ /**
19
+ * A JSON document merged into whatever the target home already holds, so a
20
+ * re-run over its own output converges instead of stacking duplicates.
21
+ */
22
+ export interface MergedJson {
23
+ readonly category: MigrationCategory;
24
+ readonly sources: readonly string[];
25
+ readonly target: string;
26
+ merge(existing: Record<string, unknown> | undefined): Record<string, unknown>;
27
+ }
28
+ export interface Unmapped {
29
+ readonly category: MigrationCategory;
30
+ readonly source: string;
31
+ readonly reason: string;
32
+ }
33
+ export interface Inventory {
34
+ readonly persona: string[];
35
+ readonly memory: string[];
36
+ readonly channels: string[];
37
+ readonly schedules: string[];
38
+ readonly skills: string[];
39
+ }
40
+ /** Everything a source reader extracts; the planner turns it into concrete writes. */
41
+ export interface SourceExtract {
42
+ readonly source: MigrationSource;
43
+ readonly root: string;
44
+ readonly inventory: Inventory;
45
+ readonly files: SourceFile[];
46
+ readonly merges: MergedJson[];
47
+ readonly monitors: {
48
+ readonly source: string;
49
+ readonly spec: MonitorSpec;
50
+ }[];
51
+ readonly unmapped: Unmapped[];
52
+ readonly warnings: string[];
53
+ }
54
+ export declare function emptyExtract(source: MigrationSource, root: string): SourceExtract;
55
+ export declare function gatewayCron(expr: string): string | undefined;
56
+ /** A fixed interval as a cron schedule, when it divides the hour or the day evenly. */
57
+ export declare function intervalCron(minutes: number): string | undefined;
58
+ export declare function slug(value: string): string;
59
+ export declare const MONITOR_INSTRUCTION_MAX = 4000;
60
+ /**
61
+ * Builds a validated cron MonitorSpec, or the reason it cannot be one. The
62
+ * checks mirror the gateway registry's own validation so a spec accepted here
63
+ * is never rejected at import.
64
+ */
65
+ export declare function cronMonitor(input: {
66
+ readonly source: MigrationSource;
67
+ readonly name: string;
68
+ readonly schedule: string;
69
+ readonly instruction: string;
70
+ readonly enabled: boolean;
71
+ readonly target?: OriginRef;
72
+ readonly taken: Set<string>;
73
+ }): MonitorSpec | string;
74
+ /**
75
+ * A delivery target as an origin. Telegram chat ids are negative for groups and
76
+ * positive for the private chat with that user, where the chat id is the peer.
77
+ * Discord and Slack DMs need a conversation id the source does not record.
78
+ */
79
+ export declare function deliveryOrigin(platform: string, rawTarget: string): OriginRef | string;
80
+ /** Channel credential names this migration can carry. */
81
+ export type ChannelCredential = "discord" | "telegram" | "slack-bot" | "slack-app";
82
+ export declare const SECRET_FILES: Record<ChannelCredential, string>;
83
+ export interface ChannelPlan {
84
+ readonly credentials: Partial<Record<ChannelCredential, {
85
+ readonly value: string;
86
+ readonly source: string;
87
+ }>>;
88
+ /** Gateway `config.json` channel policies keyed `<platform>:<id>`. */
89
+ readonly channels: Record<string, {
90
+ engagement: "open" | "mention-open";
91
+ }>;
92
+ readonly allowlist: Set<string>;
93
+ dmPolicy?: "open";
94
+ }
95
+ export declare function emptyChannelPlan(): ChannelPlan;
96
+ /**
97
+ * Turns a channel plan into secret files plus merged gateway/adapter config.
98
+ * Merges only add: an existing policy, allowlist entry or owner target the
99
+ * operator already set is never replaced by an imported one.
100
+ */
101
+ export declare function emitChannels(extract: SourceExtract, plan: ChannelPlan, home: string, configSource: string): void;
102
+ /** Adds imported monitor specs to `migration/monitors.json`, which the gateway imports once at boot. */
103
+ export declare function emitMonitors(extract: SourceExtract): void;
104
+ /** Relative to the gajae-way home; the gateway reads the same path (packages/gateway/src/monitors/migrated.ts). */
105
+ export declare const MIGRATED_MONITORS_FILE = "migration/monitors.json";
106
+ /** Custom memory axis that holds imported curated memory, so the audit does not report it as orphaned. */
107
+ export declare const IMPORTED_AXIS: {
108
+ readonly id: "imported";
109
+ readonly displayName: "Imported memory";
110
+ readonly root: "imported";
111
+ readonly nesting: "nested";
112
+ readonly index: "tree";
113
+ readonly layout: "free";
114
+ readonly retrievalPriority: 50;
115
+ };
116
+ export declare function emitImportedAxis(extract: SourceExtract): void;
117
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/migrate/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGtE,eAAO,MAAM,iBAAiB,iCAAkC,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpH,uEAAuE;AACvE,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAA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WAAW,CAAC;AAEnF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAK1D,CAAC;AAEF,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAC9G,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC,CAAC;IAC3E,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,gBAAgB,IAAI,WAAW,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAyFhH;AAED,wGAAwG;AACxG,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAazD;AAED,mHAAmH;AACnH,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE,0GAA0G;AAC1G,eAAO,MAAM,aAAa;;;;;;;;CAQhB,CAAC;AAEX,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAW7D"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Read-only access to a source tree. Every read is recorded, so whatever the
3
+ * readers did not consume can be reported as unmapped instead of vanishing.
4
+ * Nothing here opens a file for writing.
5
+ */
6
+ export declare class SourceTree {
7
+ #private;
8
+ readonly root: string;
9
+ constructor(root: string);
10
+ /** Relative display path for a source file, `~`-free and stable across hosts. */
11
+ rel(path: string): string;
12
+ consume(path: string): void;
13
+ isConsumed(path: string): boolean;
14
+ /** Consumed exactly, or entirely beneath a consumed directory. */
15
+ isFullyConsumed(path: string): boolean;
16
+ text(path: string): Promise<string | undefined>;
17
+ bytes(path: string): Promise<Uint8Array | undefined>;
18
+ }
19
+ /** Stat without following symlinks; only a plain regular file qualifies. */
20
+ export declare function regularFile(path: string): Promise<{
21
+ mtime: Date;
22
+ } | undefined>;
23
+ export declare function isDirectory(path: string): Promise<boolean>;
24
+ export declare function entries(path: string): Promise<string[]>;
25
+ /** Every regular file under `dir`, relative to it, skipping symlinks (they may point anywhere). */
26
+ export declare function walkFiles(dir: string, prefix?: string): Promise<string[]>;
27
+ /** Minimal dotenv reader: KEY=VALUE lines, optional `export`, single/double quotes, `#` comments. */
28
+ export declare function parseDotenv(text: string): Map<string, string>;
29
+ export declare function expandHome(path: string): string;
30
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
31
+ /** A comma-separated string or a list, as both Hermes and OpenClaw accept. */
32
+ export declare function stringList(value: unknown): string[];
33
+ export declare const DATED_FILE: RegExp;
34
+ //# sourceMappingURL=source-fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-fs.d.ts","sourceRoot":"","sources":["../../src/migrate/source-fs.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,qBAAa,UAAU;;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAGV,IAAI,EAAE,MAAM;IAIxB,iFAAiF;IACjF,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAKzB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI3B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAMjC,kEAAkE;IAClE,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAKhC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAO/C,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;CAM1D;AAED,4EAA4E;AAC5E,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG,SAAS,CAAC,CAOpF;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMhE;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAM7D;AAED,mGAAmG;AACnG,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAU3E;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAe7D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAGnD;AAED,eAAO,MAAM,UAAU,QAAkC,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface MigrateOptions {
2
+ source?: string;
3
+ target?: string;
4
+ dryRun?: boolean;
5
+ }
6
+ /**
7
+ * Main migration entry point. Detects the source type (Hermes or OpenClaw),
8
+ * reads its configuration, and writes the gajae-way-compatible output.
9
+ */
10
+ export declare function migrate(options: MigrateOptions): Promise<void>;
11
+ /**
12
+ * Parse command-line arguments for the migrate command.
13
+ */
14
+ export declare function parseMigrateArgs(args: readonly string[]): MigrateOptions;
15
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,cAAc;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA0GpE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,CAsBxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"restart-stack.d.ts","sourceRoot":"","sources":["../src/restart-stack.ts"],"names":[],"mappings":"AAIA,OAAO,EAKN,KAAK,eAAe,EAKpB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAClF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5E,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,CA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WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAiCvG;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG/E;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAO5G;AAED,uEAAuE;AACvE,wBAAgB,YAAY,IAAI,SAAS,WAAW,EAAE,CAKrD;AAOD,wBAAgB,eAAe,IAAI,eAAe,CAGjD;AA6BD,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAqCjG;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * `gajaeway setup`: guided credential setup for the platform adapters.
3
+ *
4
+ * Invariants, each pinned by tests:
5
+ * - a token is validated against its platform API before anything is written;
6
+ * one rejected token writes nothing at all, so a half-configured home never
7
+ * exists;
8
+ * - tokens are only ever read from the environment or a no-echo prompt, never
9
+ * from argv (argv is visible in `ps` and shell history);
10
+ * - secret files are written 0600 inside a 0700 `secrets/` directory, atomically;
11
+ * - no message this module produces contains a token: every error passes
12
+ * through `redact` with every secret collected so far.
13
+ */
14
+ export declare const SETUP_PLATFORMS: readonly ["discord", "slack", "telegram"];
15
+ export type SetupPlatform = (typeof SETUP_PLATFORMS)[number];
16
+ /** Environment variables `--from-env` reads. Tokens have no flag spelling on purpose. */
17
+ export declare const SETUP_ENV: {
18
+ readonly discordToken: "GAJAEWAY_DISCORD_TOKEN";
19
+ readonly discordAppId: "GAJAEWAY_DISCORD_APP_ID";
20
+ readonly slackBotToken: "GAJAEWAY_SLACK_BOT_TOKEN";
21
+ readonly slackAppToken: "GAJAEWAY_SLACK_APP_TOKEN";
22
+ readonly telegramToken: "GAJAEWAY_TELEGRAM_TOKEN";
23
+ readonly ownerIds: "GAJAEWAY_OWNER_IDS";
24
+ };
25
+ export declare const SETUP_USAGE = "usage: gajaeway setup [--from-env] [--adapters discord,slack,telegram] [--owner ID[,ID...]] [--discord-app-id ID] | setup --status";
26
+ /** Secret file names under `$GAJAEWAY_HOME/secrets`, matching docs/deployment.md. */
27
+ export declare const SECRET_FILES: {
28
+ readonly discord: "discord-token";
29
+ readonly slackBot: "slack-bot-token";
30
+ readonly slackApp: "slack-app-token";
31
+ readonly telegram: "telegram-token";
32
+ };
33
+ export type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
34
+ export declare class SetupError extends Error {
35
+ constructor(message: string);
36
+ }
37
+ export declare const REDACTED = "[redacted]";
38
+ /** Replaces every occurrence of every secret. Short strings are skipped so a stray "a" cannot shred output. */
39
+ export declare function redact(text: string, secrets: Iterable<string>): string;
40
+ export interface ParsedSetupArgs {
41
+ readonly mode: "setup" | "status";
42
+ readonly fromEnv: boolean;
43
+ readonly adapters?: readonly SetupPlatform[];
44
+ readonly owners: readonly string[];
45
+ readonly discordAppId?: string;
46
+ }
47
+ export declare function parseSetupArgs(args: readonly string[]): ParsedSetupArgs;
48
+ export declare function parseAdapterList(value: string): SetupPlatform[];
49
+ /** Tokens collected for the adapters being (re)configured. */
50
+ export interface SetupTokens {
51
+ readonly discord?: {
52
+ readonly token: string;
53
+ readonly appId?: string;
54
+ };
55
+ readonly slack?: {
56
+ readonly botToken: string;
57
+ readonly appToken: string;
58
+ };
59
+ readonly telegram?: {
60
+ readonly token: string;
61
+ };
62
+ }
63
+ /**
64
+ * The `--from-env` token set. With `--adapters`, every named adapter must be
65
+ * fully present; without it, every adapter whose variables are present is
66
+ * enabled, and a half-present Slack pair is an error rather than a skip.
67
+ */
68
+ export declare function tokensFromEnv(env: NodeJS.ProcessEnv, adapters: readonly SetupPlatform[] | undefined, discordAppId: string | undefined): SetupTokens;
69
+ export declare function secretsOf(tokens: SetupTokens): string[];
70
+ /** What each platform said about the credentials; never contains a token. */
71
+ export interface ValidatedIdentity {
72
+ readonly platform: SetupPlatform;
73
+ readonly summary: string;
74
+ /** A user id the platform names as the app owner, when it names one. */
75
+ readonly ownerId?: string;
76
+ }
77
+ /** Discord: the bot token must authenticate `/users/@me` as a bot and, when given, belong to the expected application. */
78
+ export declare function validateDiscord(credentials: NonNullable<SetupTokens["discord"]>, fetcher: FetchLike): Promise<ValidatedIdentity>;
79
+ /**
80
+ * Slack: the bot token must pass `auth.test` as a bot, and the app-level token
81
+ * must be able to open a Socket Mode connection (`apps.connections.open`) —
82
+ * the exact call the adapter makes at startup. The returned URL is discarded.
83
+ */
84
+ export declare function validateSlack(credentials: NonNullable<SetupTokens["slack"]>, fetcher: FetchLike): Promise<ValidatedIdentity>;
85
+ /** Telegram: `getMe` with the token. The token is part of the URL, so fetch errors are redacted. */
86
+ export declare function validateTelegram(credentials: NonNullable<SetupTokens["telegram"]>, fetcher: FetchLike): Promise<ValidatedIdentity>;
87
+ export declare function validateAll(tokens: SetupTokens, fetcher: FetchLike): Promise<ValidatedIdentity[]>;
88
+ /** Atomic 0600 write: a temp file created 0600, then renamed over the target. */
89
+ export declare function writePrivateFile(path: string, contents: string): Promise<void>;
90
+ export interface ApplySetupOptions {
91
+ readonly home: string;
92
+ readonly tokens: SetupTokens;
93
+ readonly owners: readonly string[];
94
+ }
95
+ export interface AppliedSetup {
96
+ readonly written: readonly string[];
97
+ readonly owners: readonly string[];
98
+ }
99
+ /**
100
+ * Writes secrets, adapter configs, and the gateway config. Existing files are
101
+ * merged, not replaced: re-running setup for one adapter (token rotation)
102
+ * leaves the other adapters and every unrelated config field untouched.
103
+ * All inputs are read and parsed before the first write.
104
+ */
105
+ export declare function applySetup(options: ApplySetupOptions): Promise<AppliedSetup>;
106
+ /** Adapters with a config file in `home`, in canonical order: the compose profiles to run. */
107
+ export declare function enabledAdapters(home: string): Promise<SetupPlatform[]>;
108
+ export interface Prompter {
109
+ ask(question: string): Promise<string>;
110
+ /** Reads a line without echoing it. */
111
+ askSecret(question: string): Promise<string>;
112
+ close(): void;
113
+ }
114
+ /** Interactive collection. Tokens are read without echo and never repeated back. */
115
+ export declare function tokensFromPrompts(prompter: Prompter, parsed: ParsedSetupArgs): Promise<{
116
+ tokens: SetupTokens;
117
+ owners: string[];
118
+ }>;
119
+ /** Terminal prompter: raw-mode, no-echo secret entry. Requires a TTY. */
120
+ export declare function terminalPrompter(): Prompter;
121
+ export interface RunSetupOptions {
122
+ readonly home: string;
123
+ readonly env?: NodeJS.ProcessEnv;
124
+ readonly fetch?: FetchLike;
125
+ readonly prompter?: () => Prompter;
126
+ readonly log?: (line: string) => void;
127
+ }
128
+ /** The whole command. Returns the lines it printed so tests can assert nothing secret escaped. */
129
+ export declare function runSetup(args: readonly string[], options: RunSetupOptions): Promise<void>;
130
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,eAAe,2CAA4C,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,yFAAyF;AACzF,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,eAAO,MAAM,WAAW,uIAC6G,CAAC;AAEtI,qFAAqF;AACrF,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,M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AE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC/F"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * `gajaeway update`: self-update a binary install from the project's GitHub
3
+ * releases, the way `gjc update` does for gajae-code. Production hosts run
4
+ * standalone binaries under launchd/systemd without a source checkout, so the
5
+ * CLI owns its own upgrade path: compare against the latest release, replace
6
+ * the installed binaries with a backup, and queue the existing restart-stack
7
+ * supervisor. A source checkout keeps upgrading through `git` + `bun run
8
+ * build`; `--bin-dir` covers hosts that drive the update from elsewhere.
9
+ */
10
+ export declare const UPDATE_USAGE = "usage: gajaeway update [--check] [--force] [--bin-dir DIR] [--no-restart]";
11
+ export declare const DEFAULT_RELEASE_REPO = "Yeachan-Heo/gajae-way";
12
+ /** A fork can point updates at its own releases; the declared upstream stays the default. */
13
+ export declare function releaseRepo(env?: NodeJS.ProcessEnv): string;
14
+ export interface ReleaseAsset {
15
+ readonly name: string;
16
+ readonly url: string;
17
+ }
18
+ export interface ReleaseInfo {
19
+ readonly tag: string;
20
+ readonly assets: readonly ReleaseAsset[];
21
+ }
22
+ export interface ParsedUpdateArgs {
23
+ readonly check: boolean;
24
+ readonly force: boolean;
25
+ readonly noRestart: boolean;
26
+ readonly binDir?: string;
27
+ }
28
+ export declare function parseUpdateArgs(args: readonly string[]): ParsedUpdateArgs;
29
+ /** Release tags are `vX.Y.Z` (optionally with a prerelease); anything else is not comparable. */
30
+ export declare function releaseVersion(tag: string): string | undefined;
31
+ /** The release workflow publishes one tarball per platform/arch of the whole `dist/`. */
32
+ export declare function releaseAssetName(platform?: NodeJS.Platform, arch?: string): string;
33
+ export declare function selectReleaseAsset(release: ReleaseInfo, name: string): ReleaseAsset | undefined;
34
+ export declare function isNewer(current: string, latest: string): boolean;
35
+ /**
36
+ * Every binary a release tarball can contain, in the order updates report
37
+ * them. An operator's bin dir may carry only a subset (for example no
38
+ * Discord/Telegram adapters); the update replaces what is installed plus the
39
+ * core pair, never adding adapters the host did not choose.
40
+ */
41
+ export declare const KNOWN_BINARIES: readonly ["gajaeway", "gajaeway-gateway", "gajaeway-admin", "gajaeway-slack", "gajaeway-discord", "gajaeway-telegram"];
42
+ export declare const CORE_BINARIES: readonly ["gajaeway", "gajaeway-gateway"];
43
+ export declare function releaseMarkerPath(binDir: string): string;
44
+ export declare function readInstalledRelease(binDir: string): Promise<string | undefined>;
45
+ /**
46
+ * The bin dir of the running compiled binary. Under `bun packages/cli/src/main.ts`
47
+ * the executable is the interpreter, not an install, so the caller must pass
48
+ * `--bin-dir`; a renamed binary directory is adopted as long as the file still
49
+ * carries a `gajaeway…` name.
50
+ */
51
+ export declare function resolveBinDir(flag: string | undefined, execPath?: string): Promise<string | undefined>;
52
+ export interface UpdateResult {
53
+ readonly current: string;
54
+ readonly latest: string;
55
+ readonly tag: string;
56
+ readonly repo: string;
57
+ readonly checkedOnly: boolean;
58
+ readonly upToDate: boolean;
59
+ readonly installed: readonly string[];
60
+ readonly backupDir?: string;
61
+ readonly restartQueued?: string;
62
+ readonly restartSkipped?: boolean;
63
+ }
64
+ export declare function renderUpdate(result: UpdateResult): string[];
65
+ export interface RestartQueueReceipt {
66
+ readonly receiptId: string;
67
+ readonly supervisorPid: number;
68
+ }
69
+ export type ReleaseFetcher = (repo: string) => Promise<ReleaseInfo>;
70
+ export type AssetDownloader = (asset: ReleaseAsset) => Promise<Uint8Array>;
71
+ export type TarballExtractor = (tarball: Uint8Array, intoDir: string) => Promise<void>;
72
+ export type RestartQueuer = (home: string) => Promise<RestartQueueReceipt>;
73
+ export interface UpdateDeps {
74
+ readonly fetchLatestRelease?: ReleaseFetcher;
75
+ readonly downloadAsset?: AssetDownloader;
76
+ readonly extractTarball?: TarballExtractor;
77
+ readonly queueRestart?: RestartQueuer;
78
+ readonly platform?: NodeJS.Platform;
79
+ readonly arch?: string;
80
+ readonly env?: NodeJS.ProcessEnv;
81
+ readonly execPath?: string;
82
+ readonly now?: () => number;
83
+ }
84
+ export interface RunUpdateOptions {
85
+ readonly args: ParsedUpdateArgs;
86
+ readonly home: string;
87
+ readonly deps?: UpdateDeps;
88
+ }
89
+ export declare function runUpdate(options: RunUpdateOptions): Promise<UpdateResult>;
90
+ /**
91
+ * One update at a time per bin dir. A lock naming a live pid refuses; a lock
92
+ * naming a dead one is stale and taken over.
93
+ */
94
+ export declare function acquireUpdateLock(binDir: string): Promise<() => Promise<void>>;
95
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAmBA;;;;;;;;GAQG;AAEH,eAAO,MAAM,YAAY,8EAA8E,CAAC;AAExG,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAGxE;AASD,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,CAuBzE;AAED,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG9D;AAED,yFAAyF;AACzF,wBAAgB,gBAAgB,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AE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CA8EhF;AAkGD;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAuBpF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * `gajaeway ops upgrade [--gjc X.Y.Z]`
3
+ *
4
+ * Atomically upgrades the gateway's gjc to the pinned version (or an override).
5
+ * The process:
6
+ * 1. Verify CI is green (deploy gate)
7
+ * 2. Stop intake (implicit on restart)
8
+ * 3. Wait for in-flight turns (bounded)
9
+ * 4. Back up the DB
10
+ * 5. Install the pinned gjc into the gateway's own prefix (checksum-verified)
11
+ * 6. Restart the gateway's broker
12
+ * 7. ops restart-stack
13
+ * 8. Verify status (clients current, 0 pending, no held turns)
14
+ *
15
+ * Fails closed: leaves old binaries in place on any step.
16
+ */
17
+ export interface UpgradeOptions {
18
+ readonly home: string;
19
+ /** Override gjc version; defaults to reading from gateway's package.json */
20
+ readonly gjcVersion?: string;
21
+ /** Test seam: function to check CI status */
22
+ readonly checkCiStatus?: (repo: string) => Promise<boolean>;
23
+ /** Test seam: function to read gateway pinned gjc version */
24
+ readonly readPinnedVersion?: (home: string) => Promise<string>;
25
+ }
26
+ /** Read the pinned gjc version from the gateway's package.json */
27
+ export declare function readGatewayPinnedGjcVersion(home: string): Promise<string>;
28
+ export interface UpgradeResult {
29
+ readonly status: "ok" | "failed";
30
+ readonly detail: string;
31
+ }
32
+ export declare function performUpgrade(options: UpgradeOptions): Promise<UpgradeResult>;
33
+ //# sourceMappingURL=upgrade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../src/upgrade.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,6CAA6C;IAC7C,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,6DAA6D;IAC7D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/D;AAED,kEAAkE;AAClE,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAe/E;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,QAAQ,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AA2DD,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAwFpF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gajae-gateway/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "Owner CLI for the gajaeway gateway: status, sessions, chat, monitors, and worker lanes over the gateway socket. Requires the Bun runtime (uses Bun.file/Bun.spawn).",
6
6
  "license": "AGPL-3.0-only",
@@ -41,8 +41,8 @@
41
41
  "prepublishOnly": "bun run build"
42
42
  },
43
43
  "dependencies": {
44
- "@gajae-gateway/sdk": "0.1.3",
45
- "@gajae-gateway/protocol": "0.1.3"
44
+ "@gajae-gateway/sdk": "0.1.5",
45
+ "@gajae-gateway/protocol": "0.1.5"
46
46
  },
47
47
  "engines": {
48
48
  "bun": ">=1.4.0"
package/src/list.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MonitorRecord } from "@gajae-gateway/protocol";
1
+ import type { MonitorRecord, MonitorScheduleProjection } from "@gajae-gateway/protocol";
2
2
  import { originKey } from "@gajae-gateway/protocol";
3
3
 
4
4
  /**
@@ -135,13 +135,31 @@ function triggerSummary(monitor: MonitorRecord): string {
135
135
  }
136
136
  }
137
137
 
138
- export const MONITOR_COLUMNS: readonly Column<MonitorRecord>[] = [
139
- { name: "id", value: (monitor) => monitor.monitorId.slice(0, 8) },
140
- { name: "name", value: (monitor) => monitor.name },
141
- { name: "schedule", value: triggerSummary },
142
- { name: "events", value: (monitor) => [...monitor.eventTypes] },
143
- { name: "target", value: (monitor) => (monitor.channelTarget ? originKey(monitor.channelTarget.origin) : null) },
144
- { name: "enabled", value: (monitor) => monitor.enabled },
138
+ export interface MonitorListRow {
139
+ readonly monitor: MonitorRecord;
140
+ readonly schedule: MonitorScheduleProjection | null;
141
+ }
142
+
143
+ export const MONITOR_COLUMNS: readonly Column<MonitorListRow>[] = [
144
+ { name: "id", value: (row) => row.monitor.monitorId.slice(0, 8) },
145
+ { name: "name", value: (row) => row.monitor.name },
146
+ { name: "schedule", value: (row) => triggerSummary(row.monitor) },
147
+ { name: "timezone", value: (row) => row.schedule?.effectiveTimezone ?? null },
148
+ {
149
+ name: "nextFire",
150
+ value: (row) => {
151
+ const { monitor, schedule } = row;
152
+ if (monitor.trigger.kind !== "cron") return null;
153
+ if (!monitor.enabled) return "paused";
154
+ if (!schedule) return null;
155
+ if (!schedule.nextFireAt) return "never";
156
+ const utc = schedule.nextFireAt.utc.replace(/:\d{2}\.\d{3}Z$/, "Z");
157
+ return `${schedule.nextFireAt.local} / ${utc}`;
158
+ },
159
+ },
160
+ { name: "events", value: (row) => [...row.monitor.eventTypes] },
161
+ { name: "target", value: (row) => (row.monitor.channelTarget ? originKey(row.monitor.channelTarget.origin) : null) },
162
+ { name: "enabled", value: (row) => row.monitor.enabled },
145
163
  ];
146
164
 
147
165
  export interface SessionListRow {
@@ -176,12 +194,19 @@ export function renderList<T>(
176
194
  columns: readonly Column<T>[],
177
195
  rows: readonly T[],
178
196
  options: ListOptions,
179
- envelope: { readonly key: string; readonly result: unknown },
197
+ envelope: {
198
+ readonly key: string;
199
+ readonly result: unknown;
200
+ /** Restore the gateway array-item shape when display rows are wrapped. */
201
+ readonly serializeRow?: (row: T) => unknown;
202
+ },
180
203
  ): string[] {
181
204
  const entries = pageRows(rows, options);
182
205
  const selected = selectColumns(columns, options.fields);
183
206
  if (!options.json) return renderTable(selected, entries);
184
207
  if (!options.fields && options.limit === undefined && options.offset === 0) return [JSON.stringify(envelope.result)];
185
- const projected = options.fields ? projectRows(selected, entries) : entries.map((entry) => entry.row);
208
+ const projected = options.fields
209
+ ? projectRows(selected, entries)
210
+ : entries.map((entry) => (envelope.serializeRow ? envelope.serializeRow(entry.row) : entry.row));
186
211
  return [JSON.stringify({ ...(envelope.result as object), [envelope.key]: projected })];
187
212
  }