mercury-agent 0.5.0 → 0.5.2

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.
Files changed (125) hide show
  1. package/README.md +452 -451
  2. package/container/Dockerfile +127 -127
  3. package/container/Dockerfile.base +109 -109
  4. package/container/Dockerfile.power +17 -17
  5. package/container/agent-package.json +8 -8
  6. package/container/build.sh +54 -54
  7. package/docs/ROADMAP.md +3 -4
  8. package/docs/archive/summarization/2026-07-02-recent-dev-summary.md +71 -0
  9. package/docs/auth/dashboard.md +28 -28
  10. package/docs/auth/overview.md +109 -109
  11. package/docs/auth/whatsapp.md +173 -173
  12. package/docs/authoring-profiles.md +174 -174
  13. package/docs/configuration.md +54 -54
  14. package/docs/container-lifecycle.md +349 -349
  15. package/docs/{bugs/bwrap-privileged-linux-docker.md → debug/major/2026-07-02-bwrap-privileged-linux-docker.md} +21 -1
  16. package/docs/{bugs/e2big-prompt-delivery-fix.md → debug/major/2026-07-02-e2big-prompt-delivery-fix.md} +27 -1
  17. package/docs/{bugs/registry-pull-no-local-fallback.md → debug/major/2026-07-02-registry-pull-no-local-fallback.md} +27 -1
  18. package/docs/debug/summarization/2026-07-02-common-bug-patterns.md +72 -0
  19. package/docs/deployment.md +199 -199
  20. package/docs/extensions.md +375 -375
  21. package/docs/graceful-shutdown.md +62 -62
  22. package/docs/kb-distillation.md +77 -77
  23. package/docs/media/overview.md +140 -140
  24. package/docs/media/whatsapp.md +171 -171
  25. package/docs/memory.md +137 -137
  26. package/docs/permissions.md +217 -217
  27. package/docs/pipeline.md +228 -228
  28. package/docs/prd-chat-memory.md +76 -76
  29. package/docs/prd-config-load.md +82 -82
  30. package/docs/rate-limiting.md +229 -229
  31. package/docs/runbooks/publish-checklist.md +9 -1
  32. package/docs/scheduler.md +288 -288
  33. package/docs/setup-discord.md +100 -100
  34. package/docs/setup-slack.md +119 -119
  35. package/docs/setup-whatsapp.md +94 -94
  36. package/docs/subagents.md +166 -166
  37. package/docs/web-search.md +62 -62
  38. package/examples/extensions/README.md +12 -12
  39. package/examples/extensions/charts/index.ts +13 -13
  40. package/examples/extensions/charts/skill/SKILL.md +98 -98
  41. package/examples/extensions/gws/README.md +52 -52
  42. package/examples/extensions/gws/skill/SKILL.md +57 -57
  43. package/examples/extensions/gws/skill/references/calendar.md +101 -101
  44. package/examples/extensions/gws/skill/references/docs.md +65 -65
  45. package/examples/extensions/gws/skill/references/drive.md +79 -79
  46. package/examples/extensions/gws/skill/references/gmail.md +85 -85
  47. package/examples/extensions/gws/skill/references/sheets.md +60 -60
  48. package/examples/extensions/napkin/skill/SKILL.md +728 -728
  49. package/examples/extensions/pdf/skill/LICENSE.txt +30 -30
  50. package/examples/extensions/pdf/skill/SKILL.md +314 -314
  51. package/examples/extensions/pdf/skill/forms.md +294 -294
  52. package/examples/extensions/pdf/skill/reference.md +611 -611
  53. package/examples/extensions/pdf/skill/scripts/check_bounding_boxes.py +65 -65
  54. package/examples/extensions/pdf/skill/scripts/check_fillable_fields.py +11 -11
  55. package/examples/extensions/pdf/skill/scripts/convert_pdf_to_images.py +33 -33
  56. package/examples/extensions/pdf/skill/scripts/create_validation_image.py +37 -37
  57. package/examples/extensions/pdf/skill/scripts/extract_form_field_info.py +122 -122
  58. package/examples/extensions/pdf/skill/scripts/extract_form_structure.py +115 -115
  59. package/examples/extensions/pdf/skill/scripts/fill_fillable_fields.py +98 -98
  60. package/examples/extensions/pdf/skill/scripts/fill_pdf_form_with_annotations.py +107 -107
  61. package/examples/extensions/permission-guard/index.ts +65 -65
  62. package/examples/extensions/pinchtab/skill/SKILL.md +224 -224
  63. package/examples/extensions/pinchtab/skill/TRUST.md +69 -69
  64. package/examples/extensions/pinchtab/skill/references/api.md +297 -297
  65. package/examples/extensions/pinchtab/skill/references/env.md +45 -45
  66. package/examples/extensions/pinchtab/skill/references/profiles.md +107 -107
  67. package/examples/extensions/tradestation/host/refresh.ts +102 -102
  68. package/examples/extensions/tradestation/index.ts +153 -153
  69. package/examples/extensions/tradestation/skill/SKILL.md +67 -67
  70. package/examples/extensions/voice-synth/index.ts +94 -94
  71. package/examples/extensions/voice-synth/skill/SKILL.md +38 -38
  72. package/examples/extensions/voice-transcribe/requirements.txt +8 -8
  73. package/examples/extensions/voice-transcribe/scripts/transcribe.py +179 -179
  74. package/examples/extensions/voice-transcribe/skill/SKILL.md +53 -53
  75. package/examples/extensions/yahoo-mail/cli/package.json +13 -13
  76. package/examples/extensions/yahoo-mail/skill/SKILL.md +78 -78
  77. package/package.json +106 -106
  78. package/resources/agents/explore.md +50 -50
  79. package/resources/agents/worker.md +24 -24
  80. package/resources/connection-env-vars.json +25 -25
  81. package/resources/pi-extensions/subagent/agents.ts +126 -126
  82. package/resources/pi-extensions/subagent/index.ts +964 -964
  83. package/resources/profiles/coding/AGENTS.md +43 -43
  84. package/resources/profiles/coding/mercury-profile.yaml +15 -15
  85. package/resources/profiles/general/AGENTS.md +31 -31
  86. package/resources/profiles/general/mercury-profile.yaml +15 -15
  87. package/resources/profiles/research/AGENTS.md +40 -40
  88. package/resources/profiles/research/mercury-profile.yaml +15 -15
  89. package/resources/skills/config/SKILL.md +25 -25
  90. package/resources/skills/context/SKILL.md +33 -33
  91. package/resources/skills/conversation-recap/SKILL.md +19 -19
  92. package/resources/skills/mutes/SKILL.md +31 -31
  93. package/resources/skills/permissions/SKILL.md +19 -19
  94. package/resources/skills/preferences/SKILL.md +31 -31
  95. package/resources/skills/recall/SKILL.md +24 -24
  96. package/resources/skills/roles/SKILL.md +18 -18
  97. package/resources/skills/spaces/SKILL.md +18 -18
  98. package/resources/skills/tasks/SKILL.md +45 -45
  99. package/resources/templates/AGENTS.md +157 -157
  100. package/resources/templates/env.template +38 -38
  101. package/resources/templates/mercury.example.yaml +99 -99
  102. package/src/agent/container-entry.ts +1 -1
  103. package/src/agent/container-runner.ts +1345 -1346
  104. package/src/cli/mercury.ts +39 -7
  105. package/src/cli/mrctl.ts +636 -636
  106. package/src/config-file.ts +540 -540
  107. package/src/config.ts +339 -339
  108. package/src/core/api.ts +125 -125
  109. package/src/core/caller-token.ts +101 -101
  110. package/src/core/permissions.ts +228 -228
  111. package/src/core/profiles.ts +271 -271
  112. package/src/core/routes/capability.ts +70 -70
  113. package/src/core/routes/index.ts +15 -15
  114. package/src/core/runtime.ts +1530 -1530
  115. package/src/dashboard/index.html +729 -729
  116. package/src/extensions/api.ts +273 -273
  117. package/src/extensions/loader.ts +286 -286
  118. package/src/extensions/types.ts +517 -517
  119. package/src/main.ts +605 -605
  120. package/docs/pending-updates/applicative-profiles.md +0 -15
  121. package/docs/pending-updates/caller-bound-capability-token.md +0 -15
  122. package/docs/pending-updates/dm-auto-space.md +0 -15
  123. /package/docs/archive/{2026-07-01-applicative-profiles.md → applicative-profiles/2026-07-01-applicative-profiles.md} +0 -0
  124. /package/docs/archive/{2026-07-01-caller-bound-capability-token.md → applicative-profiles/2026-07-01-caller-bound-capability-token.md} +0 -0
  125. /package/docs/archive/{2026-07-01-dm-auto-space.md → applicative-profiles/2026-07-01-dm-auto-space.md} +0 -0
@@ -1,98 +1,98 @@
1
- ---
2
- name: charts
3
- description: Generate SVG/PNG charts (bar, line, pie, scatter, radar, heatmap, funnel, gauge, sankey, etc.) from ECharts JSON configs
4
- ---
5
-
6
- # Charts CLI
7
-
8
- Generate charts from the command line using ECharts. No browser needed.
9
-
10
- ## Usage
11
-
12
- ### List available chart types
13
-
14
- ```bash
15
- charts schema --list
16
- ```
17
-
18
- ### Get schema for a chart type
19
-
20
- ```bash
21
- charts schema bar
22
- charts schema pie
23
- charts schema xAxis
24
- ```
25
-
26
- ### Render a chart
27
-
28
- ```bash
29
- # Pipe JSON config
30
- cat option.json | charts render -o outbox/chart.png
31
-
32
- # Or render from file
33
- charts render --config option.json -o outbox/chart.png
34
- ```
35
-
36
- ### Options
37
-
38
- | Option | Description |
39
- |--------|-------------|
40
- | `-o, --output <file>` | Output path (`.svg` or `.png`) |
41
- | `-W, --width <n>` | Width in pixels (default: 800) |
42
- | `-H, --height <n>` | Height in pixels (default: 400) |
43
- | `--theme <name>` | `dark`, `vintage`, or path to JSON |
44
- | `--format <type>` | `svg` or `png` (auto-detected from extension) |
45
-
46
- ### Supported chart types
47
-
48
- bar, line, pie, scatter, radar, funnel, gauge, treemap, boxplot, heatmap, candlestick, sankey
49
-
50
- ## Visual style rules
51
-
52
- Always apply these defaults unless the user asks for something else.
53
-
54
- ### Global defaults
55
-
56
- - `backgroundColor: "#ffffff"`
57
- - Title: centered, top 14, fontSize 16, fontWeight bold, color `#111827`
58
- - Grid: `{ left: 60, right: 32, top: 60, bottom: 48 }`
59
- - Color palette: `#4f46e5`, `#0d9488`, `#d97706`, `#dc2626`, `#7c3aed`, `#0891b2`
60
-
61
- ### Axis styling
62
-
63
- - xAxis: hide ticks, axis line `#d1d5db`, label color `#4b5563`, fontSize 13
64
- - yAxis: hide line + ticks, label color `#9ca3af`, dashed split lines `#e5e7eb`
65
-
66
- ### Bar
67
-
68
- - `barWidth: "50%"`
69
- - Rounded top corners: `borderRadius: [5,5,0,0]`
70
- - Labels on top
71
-
72
- ### Line
73
-
74
- - `smooth: true`
75
- - `symbol: "circle"`, `symbolSize: 7`, line width 3
76
- - Single-series line charts should usually use light area fill
77
-
78
- ### Pie / donut
79
-
80
- - No axes
81
- - Use white segment borders
82
- - Prefer `-W 800 -H 500`
83
-
84
- ### Scatter
85
-
86
- - Both axes `type: "value"`
87
- - `symbolSize: 8`, opacity `0.7`
88
-
89
- ### Radar / Funnel / Gauge / Heatmap / Sankey / Treemap / Boxplot / Candlestick
90
-
91
- Use the same conventions as documented by `charts schema` and keep styling clean and modern.
92
-
93
- ## Workflow
94
-
95
- 1. Use `charts schema <type>` to inspect the config shape
96
- 2. Build the ECharts JSON option
97
- 3. Render to a file in `outbox/`
98
- 4. Reply briefly describing the chart so Mercury sends the file back to the user
1
+ ---
2
+ name: charts
3
+ description: Generate SVG/PNG charts (bar, line, pie, scatter, radar, heatmap, funnel, gauge, sankey, etc.) from ECharts JSON configs
4
+ ---
5
+
6
+ # Charts CLI
7
+
8
+ Generate charts from the command line using ECharts. No browser needed.
9
+
10
+ ## Usage
11
+
12
+ ### List available chart types
13
+
14
+ ```bash
15
+ charts schema --list
16
+ ```
17
+
18
+ ### Get schema for a chart type
19
+
20
+ ```bash
21
+ charts schema bar
22
+ charts schema pie
23
+ charts schema xAxis
24
+ ```
25
+
26
+ ### Render a chart
27
+
28
+ ```bash
29
+ # Pipe JSON config
30
+ cat option.json | charts render -o outbox/chart.png
31
+
32
+ # Or render from file
33
+ charts render --config option.json -o outbox/chart.png
34
+ ```
35
+
36
+ ### Options
37
+
38
+ | Option | Description |
39
+ |--------|-------------|
40
+ | `-o, --output <file>` | Output path (`.svg` or `.png`) |
41
+ | `-W, --width <n>` | Width in pixels (default: 800) |
42
+ | `-H, --height <n>` | Height in pixels (default: 400) |
43
+ | `--theme <name>` | `dark`, `vintage`, or path to JSON |
44
+ | `--format <type>` | `svg` or `png` (auto-detected from extension) |
45
+
46
+ ### Supported chart types
47
+
48
+ bar, line, pie, scatter, radar, funnel, gauge, treemap, boxplot, heatmap, candlestick, sankey
49
+
50
+ ## Visual style rules
51
+
52
+ Always apply these defaults unless the user asks for something else.
53
+
54
+ ### Global defaults
55
+
56
+ - `backgroundColor: "#ffffff"`
57
+ - Title: centered, top 14, fontSize 16, fontWeight bold, color `#111827`
58
+ - Grid: `{ left: 60, right: 32, top: 60, bottom: 48 }`
59
+ - Color palette: `#4f46e5`, `#0d9488`, `#d97706`, `#dc2626`, `#7c3aed`, `#0891b2`
60
+
61
+ ### Axis styling
62
+
63
+ - xAxis: hide ticks, axis line `#d1d5db`, label color `#4b5563`, fontSize 13
64
+ - yAxis: hide line + ticks, label color `#9ca3af`, dashed split lines `#e5e7eb`
65
+
66
+ ### Bar
67
+
68
+ - `barWidth: "50%"`
69
+ - Rounded top corners: `borderRadius: [5,5,0,0]`
70
+ - Labels on top
71
+
72
+ ### Line
73
+
74
+ - `smooth: true`
75
+ - `symbol: "circle"`, `symbolSize: 7`, line width 3
76
+ - Single-series line charts should usually use light area fill
77
+
78
+ ### Pie / donut
79
+
80
+ - No axes
81
+ - Use white segment borders
82
+ - Prefer `-W 800 -H 500`
83
+
84
+ ### Scatter
85
+
86
+ - Both axes `type: "value"`
87
+ - `symbolSize: 8`, opacity `0.7`
88
+
89
+ ### Radar / Funnel / Gauge / Heatmap / Sankey / Treemap / Boxplot / Candlestick
90
+
91
+ Use the same conventions as documented by `charts schema` and keep styling clean and modern.
92
+
93
+ ## Workflow
94
+
95
+ 1. Use `charts schema <type>` to inspect the config shape
96
+ 2. Build the ECharts JSON option
97
+ 3. Render to a file in `outbox/`
98
+ 4. Reply briefly describing the chart so Mercury sends the file back to the user
@@ -1,52 +1,52 @@
1
- # gws Extension (Google Workspace CLI)
2
-
3
- Admin-gated Mercury extension for Google Workspace APIs via [`@googleworkspace/cli`](https://github.com/googleworkspace/cli).
4
-
5
- ## What this example shows
6
-
7
- - `mercury.cli()` to install `gws`
8
- - `mercury.permission()` with admin-only default access
9
- - `mercury.skill()` so the agent knows how to use `gws`
10
-
11
- ## Install
12
-
13
- Copy into your Mercury project:
14
-
15
- ```bash
16
- mkdir -p .mercury/extensions/gws
17
- cp -R examples/extensions/gws/* .mercury/extensions/gws/
18
- ```
19
-
20
- Then restart Mercury (or reinstall service).
21
-
22
- ## Auth setup (host machine)
23
-
24
- 1. Install and authenticate `gws` on the host:
25
-
26
- ```bash
27
- npm i -g @googleworkspace/cli
28
- gws auth login
29
- ```
30
-
31
- 2. Export credentials once:
32
-
33
- ```bash
34
- gws auth export --unmasked > .mercury/global/gws-credentials.json
35
- ```
36
-
37
- 3. Add to `.env`:
38
-
39
- ```bash
40
- MERCURY_GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/home/mercury/.pi/agent/gws-credentials.json
41
- ```
42
-
43
- (You can also use `MERCURY_GOOGLE_WORKSPACE_CLI_TOKEN`, but it expires quickly.)
44
-
45
- ## Verify
46
-
47
- ```bash
48
- mercury chat --space main --caller "<admin-caller-id>" \
49
- "run exactly: gws drive files list --params '{\"pageSize\": 3}'"
50
- ```
51
-
52
- A non-admin caller should be blocked by RBAC.
1
+ # gws Extension (Google Workspace CLI)
2
+
3
+ Admin-gated Mercury extension for Google Workspace APIs via [`@googleworkspace/cli`](https://github.com/googleworkspace/cli).
4
+
5
+ ## What this example shows
6
+
7
+ - `mercury.cli()` to install `gws`
8
+ - `mercury.permission()` with admin-only default access
9
+ - `mercury.skill()` so the agent knows how to use `gws`
10
+
11
+ ## Install
12
+
13
+ Copy into your Mercury project:
14
+
15
+ ```bash
16
+ mkdir -p .mercury/extensions/gws
17
+ cp -R examples/extensions/gws/* .mercury/extensions/gws/
18
+ ```
19
+
20
+ Then restart Mercury (or reinstall service).
21
+
22
+ ## Auth setup (host machine)
23
+
24
+ 1. Install and authenticate `gws` on the host:
25
+
26
+ ```bash
27
+ npm i -g @googleworkspace/cli
28
+ gws auth login
29
+ ```
30
+
31
+ 2. Export credentials once:
32
+
33
+ ```bash
34
+ gws auth export --unmasked > .mercury/global/gws-credentials.json
35
+ ```
36
+
37
+ 3. Add to `.env`:
38
+
39
+ ```bash
40
+ MERCURY_GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/home/mercury/.pi/agent/gws-credentials.json
41
+ ```
42
+
43
+ (You can also use `MERCURY_GOOGLE_WORKSPACE_CLI_TOKEN`, but it expires quickly.)
44
+
45
+ ## Verify
46
+
47
+ ```bash
48
+ mercury chat --space main --caller "<admin-caller-id>" \
49
+ "run exactly: gws drive files list --params '{\"pageSize\": 3}'"
50
+ ```
51
+
52
+ A non-admin caller should be blocked by RBAC.
@@ -1,57 +1,57 @@
1
- ---
2
- name: gws
3
- description: Access Gmail, Google Drive, Google Calendar, Docs, and Sheets via the gws CLI. Use for email (read, send, triage inbox, reply, forward), calendar (today's agenda, add or reschedule events, meeting prep), Drive (list, find, organize files), and Docs/Sheets (read, summarize, append). Triggers on any Google Workspace or Gmail request.
4
- allowed-tools: Bash
5
- ---
6
-
7
- # Google Workspace (gws)
8
-
9
- Use the `gws` CLI via Bash for all Google Workspace operations.
10
-
11
- ## Presentation rules — always enforce
12
-
13
- **Never paste raw gws output into a reply.** Translate every result into plain language before responding.
14
-
15
- | Raw output field | What to show instead |
16
- |---|---|
17
- | `name` or `summary` | The display name only |
18
- | `mimeType: application/vnd.google-apps.document` | "Google Doc" |
19
- | `mimeType: application/vnd.google-apps.spreadsheet` | "spreadsheet" |
20
- | `mimeType: application/vnd.google-apps.folder` | "folder" |
21
- | `mimeType: application/pdf` | "PDF" |
22
- | Any `id` field | Never shown; use internally only for follow-up commands |
23
- | JSON objects or arrays | Summarise in prose |
24
- | Email `labelIds`, `threadId`, `messageId` | Never shown |
25
-
26
- ## Credentials setup (run once per session before any gws command)
27
-
28
- `GWS_CREDENTIALS_JSON` contains the credentials as a JSON string. Materialize it to the path gws expects, then verify auth:
29
-
30
- ```bash
31
- [ -n "$GWS_CREDENTIALS_JSON" ] && echo "$GWS_CREDENTIALS_JSON" > "${GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE:-/tmp/gws-credentials.json}" && export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE="${GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE:-/tmp/gws-credentials.json}"
32
- gws auth status
33
- ```
34
-
35
- If `auth_method` is not `none`, credentials are ready. Skip this step on subsequent calls in the same session (the file persists in /tmp for the container lifetime).
36
-
37
- ## Dispatch table
38
-
39
- Match the user's intent to the right category and read the reference file before acting:
40
-
41
- | User intent | Category | Reference file |
42
- |---|---|---|
43
- | email, inbox, gmail, send message, unread, triage | Gmail | `references/gmail.md` |
44
- | drive, files, folder, upload, download, share | Drive | `references/drive.md` |
45
- | calendar, agenda, event, meeting, schedule | Calendar | `references/calendar.md` |
46
- | doc, document, write, append, summarise | Docs | `references/docs.md` |
47
- | sheet, spreadsheet, row, data | Sheets | `references/sheets.md` |
48
-
49
- **Always read the reference file for the matched category before running a command.**
50
-
51
- ## Fallback
52
-
53
- If no helper covers the case, use the raw API:
54
- ```bash
55
- gws <service> --help # list available subcommands
56
- ```
57
- Still translate the output before replying.
1
+ ---
2
+ name: gws
3
+ description: Access Gmail, Google Drive, Google Calendar, Docs, and Sheets via the gws CLI. Use for email (read, send, triage inbox, reply, forward), calendar (today's agenda, add or reschedule events, meeting prep), Drive (list, find, organize files), and Docs/Sheets (read, summarize, append). Triggers on any Google Workspace or Gmail request.
4
+ allowed-tools: Bash
5
+ ---
6
+
7
+ # Google Workspace (gws)
8
+
9
+ Use the `gws` CLI via Bash for all Google Workspace operations.
10
+
11
+ ## Presentation rules — always enforce
12
+
13
+ **Never paste raw gws output into a reply.** Translate every result into plain language before responding.
14
+
15
+ | Raw output field | What to show instead |
16
+ |---|---|
17
+ | `name` or `summary` | The display name only |
18
+ | `mimeType: application/vnd.google-apps.document` | "Google Doc" |
19
+ | `mimeType: application/vnd.google-apps.spreadsheet` | "spreadsheet" |
20
+ | `mimeType: application/vnd.google-apps.folder` | "folder" |
21
+ | `mimeType: application/pdf` | "PDF" |
22
+ | Any `id` field | Never shown; use internally only for follow-up commands |
23
+ | JSON objects or arrays | Summarise in prose |
24
+ | Email `labelIds`, `threadId`, `messageId` | Never shown |
25
+
26
+ ## Credentials setup (run once per session before any gws command)
27
+
28
+ `GWS_CREDENTIALS_JSON` contains the credentials as a JSON string. Materialize it to the path gws expects, then verify auth:
29
+
30
+ ```bash
31
+ [ -n "$GWS_CREDENTIALS_JSON" ] && echo "$GWS_CREDENTIALS_JSON" > "${GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE:-/tmp/gws-credentials.json}" && export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE="${GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE:-/tmp/gws-credentials.json}"
32
+ gws auth status
33
+ ```
34
+
35
+ If `auth_method` is not `none`, credentials are ready. Skip this step on subsequent calls in the same session (the file persists in /tmp for the container lifetime).
36
+
37
+ ## Dispatch table
38
+
39
+ Match the user's intent to the right category and read the reference file before acting:
40
+
41
+ | User intent | Category | Reference file |
42
+ |---|---|---|
43
+ | email, inbox, gmail, send message, unread, triage | Gmail | `references/gmail.md` |
44
+ | drive, files, folder, upload, download, share | Drive | `references/drive.md` |
45
+ | calendar, agenda, event, meeting, schedule | Calendar | `references/calendar.md` |
46
+ | doc, document, write, append, summarise | Docs | `references/docs.md` |
47
+ | sheet, spreadsheet, row, data | Sheets | `references/sheets.md` |
48
+
49
+ **Always read the reference file for the matched category before running a command.**
50
+
51
+ ## Fallback
52
+
53
+ If no helper covers the case, use the raw API:
54
+ ```bash
55
+ gws <service> --help # list available subcommands
56
+ ```
57
+ Still translate the output before replying.
@@ -1,101 +1,101 @@
1
- # Calendar Reference
2
-
3
- Use `gws calendar` for all calendar operations.
4
-
5
- ## Today's agenda
6
-
7
- ```bash
8
- gws calendar +agenda --today
9
- ```
10
-
11
- ## This week's agenda
12
-
13
- ```bash
14
- gws calendar +agenda --week
15
- ```
16
-
17
- ## Next N days
18
-
19
- ```bash
20
- gws calendar +agenda --days 3
21
- ```
22
-
23
- ## Filter to a specific calendar
24
-
25
- ```bash
26
- gws calendar +agenda --today --calendar 'Work'
27
- gws calendar +agenda --week --calendar 'Personal'
28
- ```
29
-
30
- ## Timezone override
31
-
32
- ```bash
33
- gws calendar +agenda --today --timezone America/New_York
34
- ```
35
-
36
- ## Create an event
37
-
38
- ```bash
39
- gws calendar +insert \
40
- --summary 'Team Standup' \
41
- --start '2026-04-24T09:00:00-05:00' \
42
- --end '2026-04-24T09:30:00-05:00'
43
-
44
- # With location and attendees
45
- gws calendar +insert \
46
- --summary 'Project Review' \
47
- --start '2026-04-24T14:00:00-05:00' \
48
- --end '2026-04-24T15:00:00-05:00' \
49
- --location 'Conference Room A' \
50
- --attendee alice@example.com \
51
- --attendee bob@example.com
52
-
53
- # With Google Meet link
54
- gws calendar +insert \
55
- --summary 'Remote Sync' \
56
- --start '2026-04-24T10:00:00-05:00' \
57
- --end '2026-04-24T10:30:00-05:00' \
58
- --meet
59
- ```
60
-
61
- Use RFC3339 format for times (e.g. `2026-04-24T09:00:00+03:00`). Always confirm date, time, and timezone with the user before creating.
62
-
63
- ## Reschedule an event
64
-
65
- Get the event ID from `+agenda` output (store internally — never show to user):
66
-
67
- ```bash
68
- # Get event ID
69
- gws calendar events list --params '{"calendarId":"primary","q":"Team Standup","maxResults":5}'
70
-
71
- # Update start/end times (replace timezone with the user's local timezone)
72
- gws calendar events update \
73
- --params '{"calendarId":"primary","eventId":"<EVENT_ID>"}' \
74
- --json '{"start":{"dateTime":"2026-04-25T09:00:00-05:00","timeZone":"America/New_York"},"end":{"dateTime":"2026-04-25T09:30:00-05:00","timeZone":"America/New_York"}}'
75
- ```
76
-
77
- ## Meeting prep (attendees, agenda for an upcoming event)
78
-
79
- ```bash
80
- # Find the event
81
- gws calendar events list --params '{"calendarId":"primary","q":"<MEETING_NAME>","maxResults":3}'
82
-
83
- # Get full event details including attendees
84
- gws calendar events get --params '{"calendarId":"primary","eventId":"<EVENT_ID>"}'
85
- ```
86
-
87
- Present: title, date/time, location (if any), attendee names — never show email addresses or event IDs unless the user asks.
88
-
89
- ## Raw API fallback
90
-
91
- ```bash
92
- gws calendar events list --params '{"calendarId":"primary","timeMin":"<ISO_DATE>","maxResults":10}'
93
- gws calendar --help # list all subcommands
94
- ```
95
-
96
- ## Output format rules
97
-
98
- - Agenda: "9:00 AM — Team Standup (30 min)" or "All day — Public Holiday"
99
- - Event created: "Added 'Team Standup' to your calendar for Friday April 24 at 9:00 AM"
100
- - Reschedule confirmation: "Moved 'Team Standup' to Saturday April 25 at 9:00 AM"
101
- - Never show event IDs, calendar IDs, or raw dateTime strings
1
+ # Calendar Reference
2
+
3
+ Use `gws calendar` for all calendar operations.
4
+
5
+ ## Today's agenda
6
+
7
+ ```bash
8
+ gws calendar +agenda --today
9
+ ```
10
+
11
+ ## This week's agenda
12
+
13
+ ```bash
14
+ gws calendar +agenda --week
15
+ ```
16
+
17
+ ## Next N days
18
+
19
+ ```bash
20
+ gws calendar +agenda --days 3
21
+ ```
22
+
23
+ ## Filter to a specific calendar
24
+
25
+ ```bash
26
+ gws calendar +agenda --today --calendar 'Work'
27
+ gws calendar +agenda --week --calendar 'Personal'
28
+ ```
29
+
30
+ ## Timezone override
31
+
32
+ ```bash
33
+ gws calendar +agenda --today --timezone America/New_York
34
+ ```
35
+
36
+ ## Create an event
37
+
38
+ ```bash
39
+ gws calendar +insert \
40
+ --summary 'Team Standup' \
41
+ --start '2026-04-24T09:00:00-05:00' \
42
+ --end '2026-04-24T09:30:00-05:00'
43
+
44
+ # With location and attendees
45
+ gws calendar +insert \
46
+ --summary 'Project Review' \
47
+ --start '2026-04-24T14:00:00-05:00' \
48
+ --end '2026-04-24T15:00:00-05:00' \
49
+ --location 'Conference Room A' \
50
+ --attendee alice@example.com \
51
+ --attendee bob@example.com
52
+
53
+ # With Google Meet link
54
+ gws calendar +insert \
55
+ --summary 'Remote Sync' \
56
+ --start '2026-04-24T10:00:00-05:00' \
57
+ --end '2026-04-24T10:30:00-05:00' \
58
+ --meet
59
+ ```
60
+
61
+ Use RFC3339 format for times (e.g. `2026-04-24T09:00:00+03:00`). Always confirm date, time, and timezone with the user before creating.
62
+
63
+ ## Reschedule an event
64
+
65
+ Get the event ID from `+agenda` output (store internally — never show to user):
66
+
67
+ ```bash
68
+ # Get event ID
69
+ gws calendar events list --params '{"calendarId":"primary","q":"Team Standup","maxResults":5}'
70
+
71
+ # Update start/end times (replace timezone with the user's local timezone)
72
+ gws calendar events update \
73
+ --params '{"calendarId":"primary","eventId":"<EVENT_ID>"}' \
74
+ --json '{"start":{"dateTime":"2026-04-25T09:00:00-05:00","timeZone":"America/New_York"},"end":{"dateTime":"2026-04-25T09:30:00-05:00","timeZone":"America/New_York"}}'
75
+ ```
76
+
77
+ ## Meeting prep (attendees, agenda for an upcoming event)
78
+
79
+ ```bash
80
+ # Find the event
81
+ gws calendar events list --params '{"calendarId":"primary","q":"<MEETING_NAME>","maxResults":3}'
82
+
83
+ # Get full event details including attendees
84
+ gws calendar events get --params '{"calendarId":"primary","eventId":"<EVENT_ID>"}'
85
+ ```
86
+
87
+ Present: title, date/time, location (if any), attendee names — never show email addresses or event IDs unless the user asks.
88
+
89
+ ## Raw API fallback
90
+
91
+ ```bash
92
+ gws calendar events list --params '{"calendarId":"primary","timeMin":"<ISO_DATE>","maxResults":10}'
93
+ gws calendar --help # list all subcommands
94
+ ```
95
+
96
+ ## Output format rules
97
+
98
+ - Agenda: "9:00 AM — Team Standup (30 min)" or "All day — Public Holiday"
99
+ - Event created: "Added 'Team Standup' to your calendar for Friday April 24 at 9:00 AM"
100
+ - Reschedule confirmation: "Moved 'Team Standup' to Saturday April 25 at 9:00 AM"
101
+ - Never show event IDs, calendar IDs, or raw dateTime strings