gws-axi 0.12.0 → 0.13.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 +10 -2
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/cli.js +6 -3
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/setup.d.ts +2 -0
- package/dist/src/commands/setup.js +25 -0
- package/dist/src/commands/setup.js.map +1 -0
- package/dist/src/commands/setup.test.d.ts +1 -0
- package/dist/src/commands/setup.test.js +27 -0
- package/dist/src/commands/setup.test.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ I want to authenticate the following Google accounts:
|
|
|
37
37
|
- personal@gmail.com
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
The explicit `gws-axi auth setup` in the prompt matters: this is your very first session, so the agent doesn't yet have any ambient context about `gws-axi`. Naming the first command gets the agent into the structured flow, where the CLI's output takes over.
|
|
40
|
+
The explicit `gws-axi auth setup` in the prompt matters: this is your very first session, so the agent doesn't yet have any ambient context about `gws-axi`. Naming the first command gets the agent into the structured flow, where the CLI's output takes over. Once you install the SessionStart hook (see [step 4](#4-make-gws-axi-your-agents-default-for-google-workspace)), every subsequent session auto-loads a compact `gws-axi` status line — so after that, you can skip the command and just say "use gws-axi to ..." and the agent knows.
|
|
41
41
|
|
|
42
42
|
Expect ~10 minutes end-to-end for a fresh Google Cloud project; ~3 minutes if you already have one you want to reuse.
|
|
43
43
|
|
|
@@ -54,7 +54,15 @@ gws-axi calendar events # upcoming 7 days on your primary calen
|
|
|
54
54
|
|
|
55
55
|
### 4. Make gws-axi your agent's default for Google Workspace
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
gws-axi gives agents two complementary ways to pick up ambient context (per [AXI principle 7](https://axi.md) — context is delivered through hooks and installable skills, and installation is always explicit opt-in, never a side effect of ordinary commands):
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
gws-axi setup hooks
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This installs a **SessionStart hook** into your agent's config — Claude Code (`~/.claude/settings.json`), Codex (`~/.codex/hooks.json`), and OpenCode. From then on, every new agent session sees a compact `gws-axi` status line in ambient context — authenticated accounts, write-protection status, setup health. The command is idempotent and self-repairing: re-run it any time (e.g. after upgrading or moving the install) and it repairs a stale executable path without duplicating entries. There is no auto-install — the hook only appears when you run `setup hooks`.
|
|
64
|
+
|
|
65
|
+
The hook and an installable skill are the two ambient-context paths: the hook injects current state at session start, while a skill can teach the agent the full command surface on demand. Run `gws-axi setup hooks` to get the hook in place.
|
|
58
66
|
|
|
59
67
|
To make sure agents reach for `gws-axi` instead of stale alternatives, also consider:
|
|
60
68
|
|
package/dist/src/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const TOP_HELP = "usage: gws-axi [command] [args] [flags]\ncommands[
|
|
1
|
+
export declare const TOP_HELP = "usage: gws-axi [command] [args] [flags]\ncommands[9]:\n (none)=home, auth, doctor, calendar, gmail, docs, drive, slides, setup\nflags[2]:\n --help, -v/-V/--version\nexamples:\n gws-axi\n gws-axi auth setup\n gws-axi doctor\n gws-axi calendar events\n gws-axi setup hooks\n";
|
|
2
2
|
export declare function main(): Promise<void>;
|
package/dist/src/cli.js
CHANGED
|
@@ -10,11 +10,12 @@ import { gmailCommand } from "./commands/gmail.js";
|
|
|
10
10
|
import { docsCommand } from "./commands/docs.js";
|
|
11
11
|
import { driveCommand } from "./commands/drive.js";
|
|
12
12
|
import { slidesCommand } from "./commands/slides.js";
|
|
13
|
+
import { setupCommand, SETUP_HELP } from "./commands/setup.js";
|
|
13
14
|
const DESCRIPTION = "Agent ergonomic CLI for Google Workspace. Unified interface for Gmail, Calendar, Docs, Drive, and Slides with agent-guided OAuth setup.";
|
|
14
15
|
const VERSION = readPackageVersion();
|
|
15
16
|
export const TOP_HELP = `usage: gws-axi [command] [args] [flags]
|
|
16
|
-
commands[
|
|
17
|
-
(none)=home, auth, doctor, calendar, gmail, docs, drive, slides
|
|
17
|
+
commands[9]:
|
|
18
|
+
(none)=home, auth, doctor, calendar, gmail, docs, drive, slides, setup
|
|
18
19
|
flags[2]:
|
|
19
20
|
--help, -v/-V/--version
|
|
20
21
|
examples:
|
|
@@ -22,6 +23,7 @@ examples:
|
|
|
22
23
|
gws-axi auth setup
|
|
23
24
|
gws-axi doctor
|
|
24
25
|
gws-axi calendar events
|
|
26
|
+
gws-axi setup hooks
|
|
25
27
|
`;
|
|
26
28
|
// Services that have real subcommand dispatchers handle --help themselves
|
|
27
29
|
// (so `<service> <sub> --help` shows subcommand-specific help). For stubs
|
|
@@ -29,13 +31,13 @@ examples:
|
|
|
29
31
|
const COMMAND_HELP = {
|
|
30
32
|
auth: AUTH_HELP,
|
|
31
33
|
doctor: DOCTOR_HELP,
|
|
34
|
+
setup: SETUP_HELP,
|
|
32
35
|
};
|
|
33
36
|
export async function main() {
|
|
34
37
|
await runAxiCli({
|
|
35
38
|
description: DESCRIPTION,
|
|
36
39
|
version: VERSION,
|
|
37
40
|
topLevelHelp: TOP_HELP,
|
|
38
|
-
...(process.env.GWS_AXI_DISABLE_HOOKS === "1" ? { hooks: false } : {}),
|
|
39
41
|
home: async () => homeCommand(),
|
|
40
42
|
commands: {
|
|
41
43
|
auth: authCommand,
|
|
@@ -45,6 +47,7 @@ export async function main() {
|
|
|
45
47
|
docs: docsCommand,
|
|
46
48
|
drive: driveCommand,
|
|
47
49
|
slides: slidesCommand,
|
|
50
|
+
setup: setupCommand,
|
|
48
51
|
},
|
|
49
52
|
getCommandHelp: (command) => COMMAND_HELP[command],
|
|
50
53
|
});
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IA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CAAC,EAAE,CAAC;YAC3B,SAAS;QACX,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAEzD,CAAC;QACF,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpE,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const SETUP_HELP = "usage: gws-axi setup hooks\nInstall or repair agent SessionStart hooks so each session starts with gws-axi's\nhome view (Google Workspace state \u2014 authenticated accounts, write-protection status,\nsetup/health) as ambient context. Installs to Claude Code, Codex, and OpenCode.\nIdempotent; repairs a stale executable path.\nexamples:\n gws-axi setup hooks";
|
|
2
|
+
export declare function setupCommand(args: string[]): Promise<string>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AxiError, installSessionStartHooks } from "axi-sdk-js";
|
|
2
|
+
import { joinBlocks, renderHelp, renderObject } from "../output/index.js";
|
|
3
|
+
export const SETUP_HELP = `usage: gws-axi setup hooks
|
|
4
|
+
Install or repair agent SessionStart hooks so each session starts with gws-axi's
|
|
5
|
+
home view (Google Workspace state — authenticated accounts, write-protection status,
|
|
6
|
+
setup/health) as ambient context. Installs to Claude Code, Codex, and OpenCode.
|
|
7
|
+
Idempotent; repairs a stale executable path.
|
|
8
|
+
examples:
|
|
9
|
+
gws-axi setup hooks`;
|
|
10
|
+
export async function setupCommand(args) {
|
|
11
|
+
if (args.includes("--help"))
|
|
12
|
+
return SETUP_HELP;
|
|
13
|
+
if (args[0] !== "hooks") {
|
|
14
|
+
throw new AxiError(`Unknown setup action: ${args[0] ?? "(none)"}`, "VALIDATION_ERROR", [
|
|
15
|
+
"Run `gws-axi setup hooks`",
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
const errors = [];
|
|
19
|
+
installSessionStartHooks({ marker: "gws-axi", timeoutSeconds: 10, onError: (m) => errors.push(m) });
|
|
20
|
+
if (errors.length > 0) {
|
|
21
|
+
throw new AxiError("Hook installation reported problems", "HOOK_INSTALL_FAILED", errors);
|
|
22
|
+
}
|
|
23
|
+
return joinBlocks(renderObject({ hooks: { status: "installed", integrations: "Claude Code, Codex, OpenCode", marker: "gws-axi" } }), renderHelp(["Restart your agent session to receive gws-axi ambient context"]));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE1E,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;sBAMJ,CAAC;AAEvB,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAc;IAC/C,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,UAAU,CAAC;IAC/C,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,IAAI,QAAQ,CAAC,yBAAyB,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,kBAAkB,EAAE;YACrF,2BAA2B;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,wBAAwB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACpG,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,QAAQ,CAAC,qCAAqC,EAAE,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO,UAAU,CACf,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,8BAA8B,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,EACjH,UAAU,CAAC,CAAC,+DAA+D,CAAC,CAAC,CAC9E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { AxiError } from "axi-sdk-js";
|
|
3
|
+
import { setupCommand, SETUP_HELP } from "./setup.js";
|
|
4
|
+
describe("setup command", () => {
|
|
5
|
+
it("returns help for --help without installing", async () => {
|
|
6
|
+
await expect(setupCommand(["--help"])).resolves.toBe(SETUP_HELP);
|
|
7
|
+
});
|
|
8
|
+
it("rejects an unknown action with VALIDATION_ERROR", async () => {
|
|
9
|
+
await expect(setupCommand(["frobnicate"])).rejects.toMatchObject({
|
|
10
|
+
code: "VALIDATION_ERROR",
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
it("rejects a missing action with VALIDATION_ERROR (AxiError)", async () => {
|
|
14
|
+
try {
|
|
15
|
+
await setupCommand([]);
|
|
16
|
+
throw new Error("should have thrown");
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
expect(err).toBeInstanceOf(AxiError);
|
|
20
|
+
expect(err.code).toBe("VALIDATION_ERROR");
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
it("SETUP_HELP documents the single `setup hooks` action", () => {
|
|
24
|
+
expect(SETUP_HELP).toContain("gws-axi setup hooks");
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=setup.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,qBAAqB,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gws-axi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "AXI-compliant Google Workspace CLI — token-efficient TOON output, agent-guided auth setup, unified interface for Gmail, Calendar, Docs, Drive, Slides",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|