hikoutei 0.5.15 → 0.5.16

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 (48) hide show
  1. package/README.md +63 -6
  2. package/dist/cli/args.d.ts.map +1 -1
  3. package/dist/cli/args.js +69 -5
  4. package/dist/cli/args.js.map +1 -1
  5. package/dist/cli/checkpoint.d.ts +716 -0
  6. package/dist/cli/checkpoint.d.ts.map +1 -0
  7. package/dist/cli/checkpoint.js +1463 -0
  8. package/dist/cli/checkpoint.js.map +1 -0
  9. package/dist/cli/errors.d.ts +25 -1
  10. package/dist/cli/errors.d.ts.map +1 -1
  11. package/dist/cli/errors.js +25 -1
  12. package/dist/cli/errors.js.map +1 -1
  13. package/dist/cli/flowResult.d.ts +55 -0
  14. package/dist/cli/flowResult.d.ts.map +1 -0
  15. package/dist/cli/flowResult.js +48 -0
  16. package/dist/cli/flowResult.js.map +1 -0
  17. package/dist/cli/gcloudRunner.d.ts +25 -1
  18. package/dist/cli/gcloudRunner.d.ts.map +1 -1
  19. package/dist/cli/gcloudRunner.js +32 -2
  20. package/dist/cli/gcloudRunner.js.map +1 -1
  21. package/dist/cli/humanAuth.d.ts +101 -0
  22. package/dist/cli/humanAuth.d.ts.map +1 -0
  23. package/dist/cli/humanAuth.js +175 -0
  24. package/dist/cli/humanAuth.js.map +1 -0
  25. package/dist/cli/keyProvision.d.ts +327 -0
  26. package/dist/cli/keyProvision.d.ts.map +1 -0
  27. package/dist/cli/keyProvision.js +1204 -0
  28. package/dist/cli/keyProvision.js.map +1 -0
  29. package/dist/cli/saVerify.d.ts +106 -0
  30. package/dist/cli/saVerify.d.ts.map +1 -0
  31. package/dist/cli/saVerify.js +137 -0
  32. package/dist/cli/saVerify.js.map +1 -0
  33. package/dist/cli/sdkError.d.ts +33 -0
  34. package/dist/cli/sdkError.d.ts.map +1 -0
  35. package/dist/cli/sdkError.js +78 -0
  36. package/dist/cli/sdkError.js.map +1 -0
  37. package/dist/cli/setup.d.ts +1 -1
  38. package/dist/cli/setup.js +37 -8
  39. package/dist/cli/setup.js.map +1 -1
  40. package/dist/cli/setupFlow.d.ts +220 -47
  41. package/dist/cli/setupFlow.d.ts.map +1 -1
  42. package/dist/cli/setupFlow.js +1471 -174
  43. package/dist/cli/setupFlow.js.map +1 -1
  44. package/dist/cli/sheetsFactory.d.ts +356 -29
  45. package/dist/cli/sheetsFactory.d.ts.map +1 -1
  46. package/dist/cli/sheetsFactory.js +488 -46
  47. package/dist/cli/sheetsFactory.js.map +1 -1
  48. package/package.json +2 -1
package/README.md CHANGED
@@ -125,11 +125,64 @@ an operation for each write. The sync runtime uses one Google Sheets API
125
125
  provider (the internal `googleSheetsApi` bootstrap option) with a service
126
126
  account — no Apps Script deployment.
127
127
 
128
- **Fastest path:** install the gcloud CLI, run `gcloud auth login`, then
129
- `npx hikoutei setup` — it creates the project, service account, key, and a
130
- spreadsheet owned by that service account, and writes
131
- `GOOGLE_APPLICATION_CREDENTIALS` plus `HIKOUTEI_SYNC_SPREADSHEET_URL` into
132
- your `.env`. The manual steps below remain available for advanced setups.
128
+ **Fastest path:** install the gcloud CLI and log in once with Drive access
129
+ (`gcloud auth login --enable-gdrive-access`), then `npx hikoutei setup` — it
130
+ creates the project, service account, and key, creates a spreadsheet owned
131
+ by your account, shares it with the service account as an Editor, verifies
132
+ service-account access, and writes `GOOGLE_APPLICATION_CREDENTIALS` plus
133
+ `HIKOUTEI_SYNC_SPREADSHEET_URL` into your `.env`. The human access token is
134
+ used in memory only and never stored. Automatic setup runs on macOS and
135
+ Linux; on Windows a non-dry-run is refused before any mutation and manual
136
+ setup is available. Interrupted runs resume from a local checkpoint
137
+ (`.hikoutei-setup-state.json`); a spreadsheet create whose outcome is
138
+ unknown is reconciled by its creation marker on the next run and setup
139
+ never creates a second spreadsheet (inspect Drive and rerun if setup
140
+ reports `sheet_create_uncertain`, and a create rejected up front with
141
+ HTTP 400/403 plus a confirmed-zero marker lookup rolls back to `key_ready`
142
+ so a corrected rerun starts a fresh marker). Sharing is write-ahead too:
143
+ `spreadsheet_share_started` is persisted before the idempotent SA writer
144
+ permission ensure and `spreadsheet_shared` after it, so a crash between
145
+ the remote permission mutation and the checkpoint write resumes the
146
+ ensure on the next run and never creates a second spreadsheet. The
147
+ service-account key is
148
+ created under a write-ahead contract too: the user-managed key list is
149
+ recorded as a baseline before the single gcloud key create, and
150
+ `key_create_started`/`key_ready` checkpoints let a crashed run recover a
151
+ staged or installed key instead of creating a second one. Only the
152
+ invocation that just persisted `key_create_started` may issue the one key
153
+ create; resumed runs are reconcile-only and, when no credential and no
154
+ post-baseline key are visible, poll the key list plus staged/final
155
+ evidence for up to two minutes (2, 4, 8, 16, 30, 30, 30 s) before failing
156
+ with `key_create_uncertain` — the create is never retried automatically.
157
+ An unmatched user-managed key with no local credential is never deleted
158
+ automatically — setup fails with `key_create_uncertain` and you inspect
159
+ the key list in the Google Cloud console before rerunning (a
160
+ verified-absent state requires removing the setup state file to reset the
161
+ key checkpoint); reused keys are enforced to owner-only mode 600. An exclusive lock directory
162
+ (`.hikoutei-setup-state.json.lock`) prevents concurrent runs and is never
163
+ removed automatically: a crash leaves an empty lock directory behind, and
164
+ removing it manually is required only when you are certain no setup is
165
+ running. Starting fresh requires removing or moving both the checkpoint and
166
+ the key file, or passing `--project` to recover an existing key —
167
+ checkpointed or identity-matched cloud resources are reused, and setup
168
+ never deletes cloud resources. The manual steps below remain available for
169
+ advanced setups.
170
+
171
+ **Keep setup artifacts out of Git.** `hikoutei setup` writes its defaults
172
+ into the current directory: the service-account key
173
+ (`hikoutei-service-account.json`, owner-only mode 600 — a secret), the
174
+ resume checkpoint (`.hikoutei-setup-state.json` and its `.tmp`/unique-temp
175
+ and `.lock` siblings), private key staging/cleanup directories
176
+ (`.hikoutei-key-stage-*`, `.hikoutei-key-cleanup-*`), and
177
+ `.hikoutei-env-*` temporary env writes. The repository's `.gitignore`
178
+ already ignores these defaults, so a plain `git add .` does not pick them
179
+ up. A `.gitignore` is **not a security boundary**, though: it only keeps
180
+ untracked files out of `git add`, and it does not protect files that are
181
+ already tracked (remove a mistakenly tracked key from history and rotate
182
+ it — delete the user-managed key in the Cloud console and rerun setup).
183
+ When you use a custom `--output` or keep the key or checkpoint at custom
184
+ paths, add those exact paths to your application's ignore rules and never
185
+ commit them.
133
186
 
134
187
  ### Env-driven sync auto-start
135
188
 
@@ -161,7 +214,11 @@ shared on the spreadsheet (the error tells you which email to share).
161
214
  access is not enough.
162
215
  2. **Keep the key server-side.** Put the service-account key path in
163
216
  `GOOGLE_APPLICATION_CREDENTIALS` on the server and the spreadsheet ID in an
164
- untracked secret store. Never put the key in browser code or Git.
217
+ untracked secret store. Never put the key in browser code or Git: add the
218
+ key path (and any custom `.env`/checkpoint paths) to the application's
219
+ `.gitignore` — the defaults created by `hikoutei setup` are already
220
+ ignored, but a `.gitignore` is not a security boundary and does not
221
+ protect already-tracked files.
165
222
  3. **Start the internal sync bootstrap** with `googleSheetsApi` configured. It
166
223
  creates and verifies headers on the registered tabs, then starts outbox
167
224
  delivery and User_Input polling.
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAmC,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEjF,kEAAkE;AAClE,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAE/C,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qCAA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AAM,EAAE,OAAO,CAAC;CAC1B;AAED,gDAAgD;AAChD,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAanE,eAAO,MAAM,eAAe,QAkEhB,CAAC;AAUb;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,oBAAoB,CAyG5E"}
package/dist/cli/args.js CHANGED
@@ -5,6 +5,7 @@
5
5
  * the filesystem, or the network. The result is an explicit union so the CLI
6
6
  * entry can branch on help / valid / invalid without inspecting message text.
7
7
  */
8
+ import { isValidGcpProjectId, isValidServiceAccountName } from "./checkpoint.js";
8
9
  import { SETUP_ERROR_CODES, setupFailure } from "./errors.js";
9
10
  /** Default service-account name when `--sa-name` is not given. */
10
11
  export const DEFAULT_SA_NAME = "hikoutei-sa";
@@ -22,10 +23,12 @@ const SETUP_FLAGS = {
22
23
  };
23
24
  export const SETUP_HELP_TEXT = [
24
25
  "hikoutei setup - bootstrap a Google Cloud project, service account, key, and",
25
- "spreadsheet for Hikoutei sync, then write a ready-to-use .env file.",
26
+ "a human-owned spreadsheet for Hikoutei sync, then write a ready-to-use .env file.",
26
27
  "",
27
- "Prerequisites: the gcloud CLI is installed and `gcloud auth login` has been",
28
- "run once (an active account is required).",
28
+ "Prerequisites: the gcloud CLI is installed and `gcloud auth login",
29
+ "--enable-gdrive-access` has been run once. Setup creates the spreadsheet as",
30
+ "the logged-in user and shares it with the service account as a writer, so the",
31
+ "active account must grant Drive access.",
29
32
  "",
30
33
  "Usage:",
31
34
  " hikoutei setup [options]",
@@ -41,10 +44,49 @@ export const SETUP_HELP_TEXT = [
41
44
  " the current directory).",
42
45
  " --yes Skip interactive confirmation (non-interactive",
43
46
  " mode).",
44
- " --dry-run Print the exact gcloud command sequence and",
45
- " simulated outcomes without executing anything.",
47
+ " --dry-run Print the exact command sequence and",
48
+ " simulated outcomes without executing anything",
49
+ " (read-only local path-safety checks only;",
50
+ " no subprocess, network, cloud, or file",
51
+ " mutations; the gcloud key create shows the",
52
+ " private staging placeholder",
53
+ " <private-key-staging-dir>/key.json — never the",
54
+ " final key path).",
46
55
  " -h, --help Show this help and exit.",
47
56
  "",
57
+ "Automatic setup runs on macOS and Linux. On Windows, non-dry-run setup",
58
+ "is refused before any subprocess, network, cloud, lock, checkpoint, key,",
59
+ "or file mutation (Windows cannot guarantee no-follow or owner-only ACL",
60
+ "semantics); manual setup remains available.",
61
+ "",
62
+ "Interrupted runs resume from .hikoutei-setup-state.json in the current",
63
+ "directory. A spreadsheet create whose outcome is unknown is reconciled by",
64
+ "its creation marker on the next run; setup never creates a second",
65
+ "spreadsheet. A create rejected up front (HTTP 400/403) with no matching",
66
+ "file rolls the checkpoint back to key_ready so a corrected rerun starts a",
67
+ "fresh marker. The service-account key is created under a write-ahead",
68
+ "contract: the user-managed key list is recorded as a baseline before the",
69
+ "single gcloud key create, and key_create_started/key_ready checkpoints",
70
+ "let a crashed run recover a staged or installed key instead of creating a",
71
+ "second one. Only the invocation that just persisted key_create_started",
72
+ "may issue the one key create; resumed runs are reconcile-only and poll",
73
+ "the key list plus staged/final evidence for up to two minutes (2, 4, 8,",
74
+ "16, 30, 30, 30 s) before failing with key_create_uncertain — the create",
75
+ "is never retried automatically. An unmatched user-managed key with no",
76
+ "local credential is never deleted automatically: setup fails with",
77
+ "key_create_uncertain and you inspect the key list in the Google Cloud",
78
+ "console before rerunning (verified-absent states require removing the",
79
+ "setup state file to reset the key checkpoint).",
80
+ "Reused keys are enforced to owner-only mode 600.",
81
+ "An exclusive lock directory (.hikoutei-setup-state.json.lock)",
82
+ "prevents concurrent runs and is never removed automatically: a leftover",
83
+ "lock directory (for example after a crash) requires manual removal only",
84
+ "when you are certain no setup is running.",
85
+ "Starting fresh requires removing or moving BOTH the checkpoint and the",
86
+ "service-account key file (or passing --project <id> to recover an",
87
+ "existing key); checkpointed or identity-matched cloud resources are",
88
+ "reused, and setup never deletes cloud resources.",
89
+ "",
48
90
  ].join("\n");
49
91
  /** True when the flag is a value flag; used to accept `--flag value` and `--flag=value`. */
50
92
  const VALUE_FLAGS = [
@@ -96,9 +138,31 @@ export function parseSetupArgs(argv) {
96
138
  }
97
139
  switch (flagName) {
98
140
  case SETUP_FLAGS.PROJECT:
141
+ // Strict GCP project id format (the canonical shared guard): an
142
+ // option-like or malformed value (for example `--project=--flag`)
143
+ // is rejected BEFORE it can reach gcloud, an API, or a file.
144
+ if (!isValidGcpProjectId(value)) {
145
+ return {
146
+ status: "invalid",
147
+ failure: setupFailure(SETUP_ERROR_CODES.INVALID_ARGS, `invalid value for ${flagName}: GCP project ids must start with a lowercase ` +
148
+ `letter and contain only lowercase letters, digits, and hyphens (6-30 characters)`),
149
+ };
150
+ }
99
151
  projectId = value;
100
152
  break;
101
153
  case SETUP_FLAGS.SA_NAME:
154
+ // Strict service-account name format (the canonical shared guard):
155
+ // an option-like or malformed value (for example
156
+ // `--sa-name=--flag`) is rejected before it can reach gcloud, an
157
+ // API, or a file.
158
+ if (!isValidServiceAccountName(value)) {
159
+ return {
160
+ status: "invalid",
161
+ failure: setupFailure(SETUP_ERROR_CODES.INVALID_ARGS, `invalid value for ${flagName}: service-account names must start with a ` +
162
+ `lowercase letter and contain only lowercase letters, digits, and hyphens ` +
163
+ `(6-30 characters)`),
164
+ };
165
+ }
102
166
  saName = value;
103
167
  break;
104
168
  case SETUP_FLAGS.SPREADSHEET_TITLE:
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAA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