sim 2.2.33-preview.319.1 → 2.2.33-preview.320.1

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.
@@ -59,7 +59,13 @@ export declare function checkWorkflowDir(dir: string, catalog: BlockCatalog, opt
59
59
  }): Promise<{
60
60
  findings: CheckFinding[];
61
61
  entry: string;
62
+ unlisted: UnlistedCounts;
62
63
  }>;
64
+ /** Findings a check counts but does not list: those the compile's caps left out. */
65
+ interface UnlistedCounts {
66
+ errors: number;
67
+ warnings: number;
68
+ }
63
69
  /**
64
70
  * Prints a check's findings and result, and exits 1 on any error. The findings are bounded as the
65
71
  * server bounds an answer of the same source (`bound`, the workflow answer's by default), while
@@ -68,6 +74,7 @@ export declare function checkWorkflowDir(dir: string, catalog: BlockCatalog, opt
68
74
  export declare function reportCheck(output: Parameters<typeof printProtocolResult>[0], findings: CheckFinding[], result: Record<string, unknown>, options?: {
69
75
  verbose?: boolean;
70
76
  bound?: AnswerBound;
77
+ unlisted?: UnlistedCounts;
71
78
  }): void;
72
79
  /** The catalog a cache read found, or a refusal naming `get`, the command that caches one. */
73
80
  export declare function cachedOrRefuse(catalog: BlockCatalog | null, workspaceId: string, get: string): BlockCatalog;
@@ -2,7 +2,7 @@
2
2
  * The command lock of a source directory (`.sim/command.lock`): held while a command reads and
3
3
  * rewrites the directory, so two commands on it never interleave their writes.
4
4
  */
5
- import type { Stats } from 'node:fs';
5
+ import { type Stats } from 'node:fs';
6
6
  /**
7
7
  * Held while a command reads and rewrites a source directory, so two commands on one directory
8
8
  * (an agent and a person, two terminals) never interleave their writes: each file moves into
@@ -51,18 +51,20 @@ export declare function assertPrintedSourcePaths(files: Record<string, string>):
51
51
  export declare function assertSendableCodeFiles(files: Record<string, string>): void;
52
52
  /**
53
53
  * A path inside the source directory, normalized (`./functions/x.js` → `functions/x.js`), or
54
- * `null` for an absolute path, a drive letter or a `..` escape.
54
+ * `null` for an absolute path, a drive letter, a `..` escape or a NUL byte (which no file name
55
+ * holds, so the compile refuses the path as `E_CODE_FILE_PATH`).
55
56
  */
56
57
  export declare function sourceRelativePath(path: string): string | null;
57
58
  /** Every `codeFile` a lock records, as source-relative paths. */
58
59
  export declare function lockCodeFiles(lock: unknown): Set<string>;
59
60
  /**
60
- * The function files a write leaves behind: named by the lock the directory held (so the CLI
61
- * wrote them), no longer named by the new lock, and not being written now. A file the person
62
- * added and no lock ever named is never pruned, nor is an entry that is no code file (such as
63
- * `functions/`), whose removal would take the whole folder.
61
+ * The function files a write leaves behind: named by the lock the directory held, recorded as
62
+ * written by the CLI (`recorded`, the written record's paths relative to the same directory), no
63
+ * longer named by the new lock, and not being written now. A file the CLI never wrote is never
64
+ * pruned, even when a hand-edited lock names it (say as a trigger's `codeFile`), nor is an entry
65
+ * that is no code file (such as `functions/`), whose removal would take the whole folder.
64
66
  */
65
- export declare function orphanedCodeFiles(previousLock: unknown, nextLock: unknown, written: Iterable<string>): string[];
67
+ export declare function orphanedCodeFiles(previousLock: unknown, nextLock: unknown, written: Iterable<string>, recorded: Readonly<Record<string, string>>): string[];
66
68
  /**
67
69
  * The files of a stored write's answer the CLI may write: every one {@link isPrintedSourcePath}
68
70
  * accepts. The write is already stored, so a path refused here is left as it is on disk (it is
@@ -29,6 +29,8 @@ export interface StatusReport<Plan> extends SourceStatus {
29
29
  server: ServerCheck;
30
30
  /** Why the server was not checked, or what it left unchecked. */
31
31
  note?: string;
32
+ /** Files in the directory no source names, which applying never sends. */
33
+ unnamed?: string[];
32
34
  plan: Plan | null;
33
35
  next: NextStep | null;
34
36
  }
@@ -8,6 +8,15 @@ import type { ApplyWorkflowSourceBody, GetWorkflowSourceResponse } from '../../g
8
8
  import type { OperationClient } from '../../runtime/called-operations';
9
9
  import { type SourceTree, type SourceTreeProfile } from './source-tree';
10
10
  type SourceBase = ApplyWorkflowSourceBody['base'];
11
+ /**
12
+ * The function-code files the source can reference: every `codeFile(…)` call the entry file makes,
13
+ * found by parsing it as compile does (an aliased import or spacing before the parenthesis still
14
+ * counts; a comment or string that spells one does not), plus every `codeFile` the lock records,
15
+ * limited to `.js`, `.py` and `.sh` files inside the directory. Only those are sent, so a
16
+ * reference to any other file never uploads it; the server reports a referenced file that is
17
+ * missing or of another kind.
18
+ */
19
+ export declare function codeFilePaths(entry: string | null, lock: unknown): string[];
11
20
  /**
12
21
  * The base an apply sends, refused when it is not the named workflow's: a directory written for
13
22
  * one workflow and applied to another would replace that workflow's draft with a stranger's
@@ -103,6 +103,11 @@ export interface WorkspaceSubmission {
103
103
  base?: ApplyWorkspaceSourceBody['base'];
104
104
  /** Files under a kind folder that are not sent: hidden names and unsupported characters. */
105
105
  ignored: string[];
106
+ /**
107
+ * Files under a workflow folder's `functions/` that neither its `workflow.ts` nor its lock names:
108
+ * never sent, as a workflow directory's apply never sends them.
109
+ */
110
+ unnamed: string[];
106
111
  /** The blobs this read hashed or reused a recorded digest for, with their stats. */
107
112
  hashed: ReadonlyMap<string, StatDigest>;
108
113
  }
@@ -6078,6 +6078,7 @@ export type GetSourceCatalogResponse = {
6078
6078
  } | {
6079
6079
  opaque: true;
6080
6080
  };
6081
+ optionsVary?: true;
6081
6082
  hidden?: boolean;
6082
6083
  readOnly?: boolean;
6083
6084
  password?: boolean;
@@ -6240,6 +6241,7 @@ export type GetSourceCatalogResponse = {
6240
6241
  } | {
6241
6242
  opaque: true;
6242
6243
  };
6244
+ optionsVary?: true;
6243
6245
  hidden?: boolean;
6244
6246
  readOnly?: boolean;
6245
6247
  password?: boolean;
@@ -6359,6 +6361,7 @@ export type GetSourceCatalogResponse = {
6359
6361
  } | {
6360
6362
  opaque: true;
6361
6363
  };
6364
+ optionsVary?: true;
6362
6365
  hidden?: boolean;
6363
6366
  readOnly?: boolean;
6364
6367
  password?: boolean;