@sayknow-cli/utils 0.7.17 → 0.7.20

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@sayknow-cli/utils",
4
- "version": "0.7.17",
4
+ "version": "0.7.20",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://sayknow-cli.com",
7
7
  "author": "jaybeyond",
@@ -31,7 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@sayknow-cli/natives": "0.7.17",
34
+ "@sayknow-cli/natives": "0.7.20",
35
35
  "beautiful-mermaid": "^1.1.3",
36
36
  "handlebars": "^4.7.9",
37
37
  "winston": "^3.19.0",
package/src/async.ts CHANGED
@@ -5,6 +5,8 @@
5
5
  */
6
6
  export function withTimeout<T>(promise: Promise<T>, ms: number, message: string, signal?: AbortSignal): Promise<T> {
7
7
  if (signal?.aborted) {
8
+ // The operation has already started, even when cancellation wins immediately.
9
+ void promise.catch(() => {});
8
10
  const reason = signal.reason instanceof Error ? signal.reason : new Error("Aborted");
9
11
  return Promise.reject(reason);
10
12
  }
package/src/env.ts CHANGED
@@ -309,17 +309,24 @@ function resolveLiveCredentialEnvValue(name: string): string | undefined {
309
309
  * control socket directory and the session-root registry. The harness reads both
310
310
  * from the process environment after this module loads, so a project `.env` must
311
311
  * not point either at a path the repository controls.
312
+ * `HINDSIGHT_API_URL` selects the Hindsight server. Project settings already
313
+ * cannot redirect that host. The client reads this process environment, so a
314
+ * project `.env` value is removed here and is not copied back. A launching-shell
315
+ * value that differs from the project declaration is kept, including loopback.
312
316
  */
313
317
  const PROJECT_DENIED_ENV_NAMES = [
314
318
  "NODE_TLS_REJECT_UNAUTHORIZED",
315
319
  "SKC_HARNESS_SOCKET_DIR",
316
320
  "SKC_HARNESS_ROOT_REGISTRY_DIR",
321
+ "HINDSIGHT_API_URL",
317
322
  ] as const;
318
323
 
319
324
  // Bun may have loaded cwd/.env before JS runs. Drop a value the project declares
320
325
  // (same provenance rule as the credential snapshot) and never copy it below.
321
326
  // Removing `NODE_TLS_REJECT_UNAUTHORIZED` restores verification: Bun reads that
322
- // switch per TLS connection. The same drop covers the harness directory names.
327
+ // switch per TLS connection. The same drop covers the harness directory names
328
+ // and `HINDSIGHT_API_URL`, so a later spawn that inherits this environment
329
+ // cannot see the rejected project value.
323
330
  // A quoted escape is dynamic even when the line parser did not store a value.
324
331
  for (const name of PROJECT_DENIED_ENV_NAMES) {
325
332
  const key = canonicalEnvKey(name);
package/src/prompt.ts CHANGED
@@ -139,7 +139,8 @@ export function format(content: string, options: PromptFormatOptions = {}): stri
139
139
  const topLevelTags: string[] = [];
140
140
 
141
141
  for (let i = 0; i < lines.length; i++) {
142
- let line = lines[i].trimEnd();
142
+ // 끝의 일반 공백만 자른다. 탭은 요약 안 코드(Makefile, 들여쓴 블록)에 의미가 있어 보존한다.
143
+ let line = lines[i].replace(/ +$/, "");
143
144
  let trimmedStart = line.trimStart();
144
145
  if (trimmedStart.startsWith("```") || trimmedStart.startsWith("~~~")) {
145
146
  inCodeBlock = !inCodeBlock;