@skrr-ai/cli 0.1.81 → 0.1.83

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 (32) hide show
  1. package/dist/base-command.d.ts +16 -0
  2. package/dist/base-command.js +124 -9
  3. package/dist/commands/followups/checkin.js +1 -1
  4. package/dist/commands/login.js +10 -0
  5. package/dist/commands/logout.js +4 -0
  6. package/dist/commands/store/installs.js +6 -1
  7. package/dist/lib/auth-storage.d.ts +5 -0
  8. package/dist/lib/auth-storage.js +8 -0
  9. package/dist/lib/config.d.ts +8 -0
  10. package/dist/lib/credential-resolver.js +7 -1
  11. package/dist/lib/daemonBroker.d.ts +35 -0
  12. package/dist/lib/daemonBroker.js +191 -11
  13. package/dist/lib/daemonBrokerRefusal.d.ts +14 -0
  14. package/dist/lib/daemonBrokerRefusal.js +18 -1
  15. package/dist/lib/first-party-harness-broker.d.ts +2 -0
  16. package/dist/lib/first-party-harness-broker.js +77 -3
  17. package/dist/lib/harness-context.d.ts +8 -0
  18. package/dist/lib/harness-context.js +55 -0
  19. package/dist/lib/login.js +4 -1
  20. package/dist/lib/refresh.js +4 -0
  21. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  22. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -2
  23. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +25 -0
  24. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +35 -1
  25. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  26. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  27. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +25 -0
  28. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +33 -0
  29. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  30. package/dist/node_modules/@skrr-ai/data-provider/index.js +3856 -3801
  31. package/oclif.manifest.json +19574 -19574
  32. package/package.json +2 -2
@@ -40,7 +40,8 @@
40
40
  * serve that case: a deny-list with a hole is not a deny-list.
41
41
  */
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.LOOPBACK_NO_PROXY_HOSTS = exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = exports.SENSITIVE_ENV_NAME_TOKENS = exports.SENSITIVE_ENV_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = void 0;
43
+ exports.LOOPBACK_NO_PROXY_HOSTS = exports.DAEMON_CHILD_ENV = exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = exports.SENSITIVE_ENV_NAME_TOKENS = exports.SENSITIVE_ENV_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = void 0;
44
+ exports.isDaemonChildEnv = isDaemonChildEnv;
44
45
  exports.sanitizeSpawnEnv = sanitizeSpawnEnv;
45
46
  exports.envHasProxy = envHasProxy;
46
47
  exports.withLoopbackNoProxy = withLoopbackNoProxy;
@@ -154,7 +155,40 @@ exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = new Set([
154
155
  // engine) must keep it to detect they already run as the workload uid. Not
155
156
  // a secret — it authorizes nothing without the matching real uid.
156
157
  'SKRR_WORKLOAD_UID',
158
+ // OSK-13254 — "this process descends from a skrrd agent/tool spawn". It only
159
+ // ever REMOVES authority (a `skrr` that sees it borrows from the daemon and
160
+ // never reads or writes a stored CLI session), so it must survive every later
161
+ // re-sanitization: a Bash tool that runs `skrr code`, whose engine runs `skrr`,
162
+ // is still the agent's process. See `DAEMON_CHILD_ENV` below.
163
+ 'SKRR_DAEMON_CHILD',
157
164
  ]);
165
+ /**
166
+ * OSK-13254 — the marker the daemon stamps on every agent- or tool-driven child
167
+ * (`daemon/src/env-sanitize.ts`, `daemon/src/terminal/agent-terminal-env.ts`).
168
+ *
169
+ * A `skrr` that sees it is a borrower: it redeems short-lived tokens from the
170
+ * daemon's loopback broker, never adopts a CLI refresh session of its own, and
171
+ * never reads the person's stored one (`cli/src/lib/harness-context.ts`). A
172
+ * person's own terminal — including the web terminal, which is a human surface
173
+ * (`humanTerminalEnv`) — does not carry it.
174
+ *
175
+ * The marker can only take authority away, so a process that forges it hurts
176
+ * nobody but itself. On a laptop it is POLICY, not a boundary: a same-uid child
177
+ * that deletes it can do whatever the person's own shell can. Where a uid
178
+ * boundary exists (Dedicated Runtime, identity-split Hosted Machines), the
179
+ * guest descriptor already offers only the access-token mode, so a durable CLI
180
+ * family cannot be minted there whatever the environment says.
181
+ */
182
+ exports.DAEMON_CHILD_ENV = 'SKRR_DAEMON_CHILD';
183
+ /**
184
+ * True when `env` carries the daemon-child marker with ANY non-empty value.
185
+ * Deliberately no "0 means off": the marker only narrows authority, so the
186
+ * one value that could switch it off is the one a request-carried environment
187
+ * would forge.
188
+ */
189
+ function isDaemonChildEnv(env) {
190
+ return Boolean(env[exports.DAEMON_CHILD_ENV]?.trim());
191
+ }
158
192
  /**
159
193
  * Build a sanitized snapshot of the parent's own env for a spawned
160
194
  * child, stripping credentials and library-injection vectors while
@@ -35,7 +35,7 @@ export { ensureMachineDaemonId, legacyDaemonUuids, __resetCachedDaemonIdForTest,
35
35
  export { PAIR_AAD_PREFIX, PAIR_AAD_MAX_LEN, PAIR_BUNDLE_MAX_BASE64_LEN, PAIR_NONCE_LEN, PAIR_PUBKEY_LEN, PAIR_SECRET_LEN, PairBundleError, assemblePairBundleBase64, base64ToUint8Array as pairBase64ToUint8Array, base64UrlToUint8Array as pairBase64UrlToUint8Array, buildPairAad, buildPairUrl, generatePairKeyPair, openPairBundleBase64, parsePairBundle, parsePairPlaintext, parsePairUrl, uint8ArrayToBase64 as pairUint8ArrayToBase64, uint8ArrayToBase64Url as pairUint8ArrayToBase64Url, type AssembleBundleOptions as PairAssembleBundleOptions, type OpenBundleOptions as PairOpenBundleOptions, type PairBundle, type PairBundleErrorCode, type PairKeyPair, type PairPlaintextV1, type PairUrlFields, } from './daemonPair.js';
36
36
  export { HARNESS_TIERS, getHarnessTier, credentialPolicyForTier, tierPermitsConfiguredAutoMode, type HarnessTrustTier, type CredentialDeliveryPolicy, type CredentialMode, } from './harnessTrust.js';
37
37
  export { HARNESSES_LOADING_CLAUDE_SKILLS_LAYOUT, claudeSkillsLayoutEvidence, harnessLoadsClaudeSkillsLayout, } from './harnessSkillLayout.js';
38
- export { sanitizeSpawnEnv, SENSITIVE_ENV_VARS, SENSITIVE_ENV_PREFIXES, SENSITIVE_ENV_SUFFIXES, SENSITIVE_ENV_NAME_TOKENS, SENSITIVE_ENV_PREFIX_EXCEPTIONS, LOOPBACK_NO_PROXY_HOSTS, envHasProxy, withLoopbackNoProxy, } from './spawnEnv.js';
38
+ export { sanitizeSpawnEnv, SENSITIVE_ENV_VARS, SENSITIVE_ENV_PREFIXES, SENSITIVE_ENV_SUFFIXES, SENSITIVE_ENV_NAME_TOKENS, SENSITIVE_ENV_PREFIX_EXCEPTIONS, DAEMON_CHILD_ENV, isDaemonChildEnv, LOOPBACK_NO_PROXY_HOSTS, envHasProxy, withLoopbackNoProxy, } from './spawnEnv.js';
39
39
  export { loopbackFetch, assertLoopbackHttpUrl, isLoopbackHostname, isLoopbackAddress, LoopbackTargetRefusedError, LOOPBACK_DEFAULT_MAX_BODY_BYTES, type LoopbackFetch, type LoopbackFetchInit, } from './loopbackHttp.js';
40
40
  export { CONFIG_DIR_NAME, LEGACY_CONFIG_DIR_NAMES, NATIVE_ID_PREFIX, LEGACY_NATIVE_ID_PREFIXES, DEFAULT_BINARY_NAME, } from './localIdentity.js';
41
41
  export { findLegacyLocalState, describeLegacyState, type LegacyStateFinding, type LegacyStateReport, } from './legacyStatePreflight.js';
@@ -149,7 +149,7 @@ export { HARNESSES_LOADING_CLAUDE_SKILLS_LAYOUT, claudeSkillsLayoutEvidence, har
149
149
  // spawns the SAME engine and did not). `daemon/src/env-sanitize.ts` re-exports
150
150
  // these so its own importers are unchanged, and keeps `filterCustomEnv` — that
151
151
  // governs SERVER-PROVIDED env, which no other process is handed.
152
- export { sanitizeSpawnEnv, SENSITIVE_ENV_VARS, SENSITIVE_ENV_PREFIXES, SENSITIVE_ENV_SUFFIXES, SENSITIVE_ENV_NAME_TOKENS, SENSITIVE_ENV_PREFIX_EXCEPTIONS, LOOPBACK_NO_PROXY_HOSTS, envHasProxy, withLoopbackNoProxy, } from './spawnEnv.js';
152
+ export { sanitizeSpawnEnv, SENSITIVE_ENV_VARS, SENSITIVE_ENV_PREFIXES, SENSITIVE_ENV_SUFFIXES, SENSITIVE_ENV_NAME_TOKENS, SENSITIVE_ENV_PREFIX_EXCEPTIONS, DAEMON_CHILD_ENV, isDaemonChildEnv, LOOPBACK_NO_PROXY_HOSTS, envHasProxy, withLoopbackNoProxy, } from './spawnEnv.js';
153
153
  // OSK-12134 — the one proxy-free client for loopback HTTP. Bun's fetch (and
154
154
  // Node's under NODE_USE_ENV_PROXY) sends 127.0.0.1 requests to HTTP_PROXY,
155
155
  // credentials and all; every loopback caller goes through this instead.
@@ -77,6 +77,31 @@ export declare const SENSITIVE_ENV_SUFFIXES: readonly string[];
77
77
  export declare const SENSITIVE_ENV_NAME_TOKENS: readonly string[];
78
78
  /** Specific names to keep — the prefix sweeps are broad on purpose. */
79
79
  export declare const SENSITIVE_ENV_PREFIX_EXCEPTIONS: ReadonlySet<string>;
80
+ /**
81
+ * OSK-13254 — the marker the daemon stamps on every agent- or tool-driven child
82
+ * (`daemon/src/env-sanitize.ts`, `daemon/src/terminal/agent-terminal-env.ts`).
83
+ *
84
+ * A `skrr` that sees it is a borrower: it redeems short-lived tokens from the
85
+ * daemon's loopback broker, never adopts a CLI refresh session of its own, and
86
+ * never reads the person's stored one (`cli/src/lib/harness-context.ts`). A
87
+ * person's own terminal — including the web terminal, which is a human surface
88
+ * (`humanTerminalEnv`) — does not carry it.
89
+ *
90
+ * The marker can only take authority away, so a process that forges it hurts
91
+ * nobody but itself. On a laptop it is POLICY, not a boundary: a same-uid child
92
+ * that deletes it can do whatever the person's own shell can. Where a uid
93
+ * boundary exists (Dedicated Runtime, identity-split Hosted Machines), the
94
+ * guest descriptor already offers only the access-token mode, so a durable CLI
95
+ * family cannot be minted there whatever the environment says.
96
+ */
97
+ export declare const DAEMON_CHILD_ENV = "SKRR_DAEMON_CHILD";
98
+ /**
99
+ * True when `env` carries the daemon-child marker with ANY non-empty value.
100
+ * Deliberately no "0 means off": the marker only narrows authority, so the
101
+ * one value that could switch it off is the one a request-carried environment
102
+ * would forge.
103
+ */
104
+ export declare function isDaemonChildEnv(env: Readonly<Record<string, string | undefined>>): boolean;
80
105
  /**
81
106
  * Build a sanitized snapshot of the parent's own env for a spawned
82
107
  * child, stripping credentials and library-injection vectors while
@@ -148,7 +148,40 @@ export const SENSITIVE_ENV_PREFIX_EXCEPTIONS = new Set([
148
148
  // engine) must keep it to detect they already run as the workload uid. Not
149
149
  // a secret — it authorizes nothing without the matching real uid.
150
150
  'SKRR_WORKLOAD_UID',
151
+ // OSK-13254 — "this process descends from a skrrd agent/tool spawn". It only
152
+ // ever REMOVES authority (a `skrr` that sees it borrows from the daemon and
153
+ // never reads or writes a stored CLI session), so it must survive every later
154
+ // re-sanitization: a Bash tool that runs `skrr code`, whose engine runs `skrr`,
155
+ // is still the agent's process. See `DAEMON_CHILD_ENV` below.
156
+ 'SKRR_DAEMON_CHILD',
151
157
  ]);
158
+ /**
159
+ * OSK-13254 — the marker the daemon stamps on every agent- or tool-driven child
160
+ * (`daemon/src/env-sanitize.ts`, `daemon/src/terminal/agent-terminal-env.ts`).
161
+ *
162
+ * A `skrr` that sees it is a borrower: it redeems short-lived tokens from the
163
+ * daemon's loopback broker, never adopts a CLI refresh session of its own, and
164
+ * never reads the person's stored one (`cli/src/lib/harness-context.ts`). A
165
+ * person's own terminal — including the web terminal, which is a human surface
166
+ * (`humanTerminalEnv`) — does not carry it.
167
+ *
168
+ * The marker can only take authority away, so a process that forges it hurts
169
+ * nobody but itself. On a laptop it is POLICY, not a boundary: a same-uid child
170
+ * that deletes it can do whatever the person's own shell can. Where a uid
171
+ * boundary exists (Dedicated Runtime, identity-split Hosted Machines), the
172
+ * guest descriptor already offers only the access-token mode, so a durable CLI
173
+ * family cannot be minted there whatever the environment says.
174
+ */
175
+ export const DAEMON_CHILD_ENV = 'SKRR_DAEMON_CHILD';
176
+ /**
177
+ * True when `env` carries the daemon-child marker with ANY non-empty value.
178
+ * Deliberately no "0 means off": the marker only narrows authority, so the
179
+ * one value that could switch it off is the one a request-carried environment
180
+ * would forge.
181
+ */
182
+ export function isDaemonChildEnv(env) {
183
+ return Boolean(env[DAEMON_CHILD_ENV]?.trim());
184
+ }
152
185
  /**
153
186
  * Build a sanitized snapshot of the parent's own env for a spawned
154
187
  * child, stripping credentials and library-injection vectors while
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrr-ai/auth-core",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "main": "dist/cjs/index.js",
5
5
  "types": "dist/esm/index.d.ts",
6
6
  "exports": {