@stripe/extensibility-tool-utils 0.6.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 (105) hide show
  1. package/LICENSE.md +19 -0
  2. package/dist/cli/cli-ux.d.ts +30 -0
  3. package/dist/cli/cli-ux.d.ts.map +1 -0
  4. package/dist/cli/context.d.ts +24 -0
  5. package/dist/cli/context.d.ts.map +1 -0
  6. package/dist/cli/guards.d.ts +24 -0
  7. package/dist/cli/guards.d.ts.map +1 -0
  8. package/dist/cli/index.d.ts +6 -0
  9. package/dist/cli/index.d.ts.map +1 -0
  10. package/dist/cli/output-path.d.ts +11 -0
  11. package/dist/cli/output-path.d.ts.map +1 -0
  12. package/dist/extensibility-tool-utils-alpha.d.ts +383 -0
  13. package/dist/extensibility-tool-utils-beta.d.ts +383 -0
  14. package/dist/extensibility-tool-utils-internal.d.ts +1866 -0
  15. package/dist/extensibility-tool-utils-public.d.ts +383 -0
  16. package/dist/file-editor/assertions/index.d.ts +68 -0
  17. package/dist/file-editor/assertions/index.d.ts.map +1 -0
  18. package/dist/file-editor/document.d.ts +107 -0
  19. package/dist/file-editor/document.d.ts.map +1 -0
  20. package/dist/file-editor/errors.d.ts +66 -0
  21. package/dist/file-editor/errors.d.ts.map +1 -0
  22. package/dist/file-editor/facades/api-extractor.d.ts +34 -0
  23. package/dist/file-editor/facades/api-extractor.d.ts.map +1 -0
  24. package/dist/file-editor/facades/brands.d.ts +45 -0
  25. package/dist/file-editor/facades/brands.d.ts.map +1 -0
  26. package/dist/file-editor/facades/package-json.d.ts +55 -0
  27. package/dist/file-editor/facades/package-json.d.ts.map +1 -0
  28. package/dist/file-editor/facades/stripe-app-manifest.d.ts +62 -0
  29. package/dist/file-editor/facades/stripe-app-manifest.d.ts.map +1 -0
  30. package/dist/file-editor/facades/tsconfig-options.d.ts +76 -0
  31. package/dist/file-editor/facades/tsconfig-options.d.ts.map +1 -0
  32. package/dist/file-editor/facades/tsconfig.d.ts +43 -0
  33. package/dist/file-editor/facades/tsconfig.d.ts.map +1 -0
  34. package/dist/file-editor/fingerprint.d.ts +39 -0
  35. package/dist/file-editor/fingerprint.d.ts.map +1 -0
  36. package/dist/file-editor/formats/adapter.d.ts +29 -0
  37. package/dist/file-editor/formats/adapter.d.ts.map +1 -0
  38. package/dist/file-editor/formats/detect.d.ts +9 -0
  39. package/dist/file-editor/formats/detect.d.ts.map +1 -0
  40. package/dist/file-editor/formats/index.d.ts +13 -0
  41. package/dist/file-editor/formats/index.d.ts.map +1 -0
  42. package/dist/file-editor/formats/jsonc.d.ts +14 -0
  43. package/dist/file-editor/formats/jsonc.d.ts.map +1 -0
  44. package/dist/file-editor/formats/yaml.d.ts +11 -0
  45. package/dist/file-editor/formats/yaml.d.ts.map +1 -0
  46. package/dist/file-editor/index.d.ts +42 -0
  47. package/dist/file-editor/index.d.ts.map +1 -0
  48. package/dist/file-editor/pointer.d.ts +74 -0
  49. package/dist/file-editor/pointer.d.ts.map +1 -0
  50. package/dist/file-editor/schema.d.ts +72 -0
  51. package/dist/file-editor/schema.d.ts.map +1 -0
  52. package/dist/file-editor/state/fs-manifest.d.ts +30 -0
  53. package/dist/file-editor/state/fs-manifest.d.ts.map +1 -0
  54. package/dist/file-editor/state/in-memory.d.ts +5 -0
  55. package/dist/file-editor/state/in-memory.d.ts.map +1 -0
  56. package/dist/file-editor/state/store.d.ts +19 -0
  57. package/dist/file-editor/state/store.d.ts.map +1 -0
  58. package/dist/file-editor/transaction.d.ts +60 -0
  59. package/dist/file-editor/transaction.d.ts.map +1 -0
  60. package/dist/file-editor/types.d.ts +131 -0
  61. package/dist/file-editor/types.d.ts.map +1 -0
  62. package/dist/file-editor/util/atomic-write.d.ts +7 -0
  63. package/dist/file-editor/util/atomic-write.d.ts.map +1 -0
  64. package/dist/file-editor/util/diff.d.ts +20 -0
  65. package/dist/file-editor/util/diff.d.ts.map +1 -0
  66. package/dist/file-editor/value-at-pointer.d.ts +46 -0
  67. package/dist/file-editor/value-at-pointer.d.ts.map +1 -0
  68. package/dist/index.cjs +2967 -0
  69. package/dist/index.d.ts +26 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +2847 -0
  72. package/dist/logging/create-logger.d.ts +29 -0
  73. package/dist/logging/create-logger.d.ts.map +1 -0
  74. package/dist/logging/index.d.ts +10 -0
  75. package/dist/logging/index.d.ts.map +1 -0
  76. package/dist/logging/levels.d.ts +21 -0
  77. package/dist/logging/levels.d.ts.map +1 -0
  78. package/dist/naming/inflection.d.ts +15 -0
  79. package/dist/naming/inflection.d.ts.map +1 -0
  80. package/dist/naming/metadata-policy.d.ts +35 -0
  81. package/dist/naming/metadata-policy.d.ts.map +1 -0
  82. package/dist/naming/stripe-api-case.d.ts +9 -0
  83. package/dist/naming/stripe-api-case.d.ts.map +1 -0
  84. package/dist/naming/types.d.ts +11 -0
  85. package/dist/naming/types.d.ts.map +1 -0
  86. package/dist/naming/validate.d.ts +6 -0
  87. package/dist/naming/validate.d.ts.map +1 -0
  88. package/dist/templates/filesystem-fs.d.ts +20 -0
  89. package/dist/templates/filesystem-fs.d.ts.map +1 -0
  90. package/dist/templates/generator.d.ts +305 -0
  91. package/dist/templates/generator.d.ts.map +1 -0
  92. package/dist/templates/in-memory-fs.d.ts +44 -0
  93. package/dist/templates/in-memory-fs.d.ts.map +1 -0
  94. package/dist/templates/index.d.ts +28 -0
  95. package/dist/templates/index.d.ts.map +1 -0
  96. package/dist/templates/simple-templates.d.ts +75 -0
  97. package/dist/templates/simple-templates.d.ts.map +1 -0
  98. package/dist/templates/template-manager.d.ts +54 -0
  99. package/dist/templates/template-manager.d.ts.map +1 -0
  100. package/dist/templates/types.d.ts +87 -0
  101. package/dist/templates/types.d.ts.map +1 -0
  102. package/dist/tsconfig.build.tsbuildinfo +1 -0
  103. package/dist/workspace-versions.d.ts +30 -0
  104. package/dist/workspace-versions.d.ts.map +1 -0
  105. package/package.json +60 -0
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Standard Schema v1 — a library-agnostic validator interface implemented by
3
+ * Zod v4, Valibot, ArkType, Effect Schema, and others. By accepting this
4
+ * interface we remain independent of any particular schema library.
5
+ *
6
+ * This module reproduces the tiny interface locally (no runtime dep).
7
+ *
8
+ * @see https://standardschema.dev
9
+ * @see https://github.com/standard-schema/standard-schema
10
+ */
11
+ /** @internal */
12
+ export declare namespace _StandardSchemaV1 {
13
+ /** @internal */
14
+ interface Props<Input = unknown, Output = Input> {
15
+ readonly version: 1;
16
+ readonly vendor: string;
17
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
18
+ readonly types?: Types<Input, Output> | undefined;
19
+ }
20
+ /** @internal */
21
+ type Result<Output> = SuccessResult<Output> | FailureResult;
22
+ /** @internal */
23
+ interface SuccessResult<Output> {
24
+ readonly value: Output;
25
+ readonly issues?: undefined;
26
+ }
27
+ /** @internal */
28
+ interface FailureResult {
29
+ readonly issues: readonly Issue[];
30
+ }
31
+ /** @internal */
32
+ interface Issue {
33
+ readonly message: string;
34
+ readonly path?: readonly (PropertyKey | PathSegment)[] | undefined;
35
+ }
36
+ /** @internal */
37
+ interface PathSegment {
38
+ readonly key: PropertyKey;
39
+ }
40
+ /** @internal */
41
+ interface Types<Input = unknown, Output = Input> {
42
+ readonly input: Input;
43
+ readonly output: Output;
44
+ }
45
+ /** Extract the inferred input type. */
46
+ /** @internal */
47
+ type InferInput<S extends _StandardSchemaV1> = NonNullable<S['~standard']['types']>['input'];
48
+ /** Extract the inferred output type. */
49
+ /** @internal */
50
+ type InferOutput<S extends _StandardSchemaV1> = NonNullable<S['~standard']['types']>['output'];
51
+ }
52
+ /** @internal */
53
+ export interface _StandardSchemaV1<Input = unknown, Output = Input> {
54
+ readonly '~standard': _StandardSchemaV1.Props<Input, Output>;
55
+ }
56
+ /**
57
+ * Validate a value against a Standard Schema. Awaits the validator if it
58
+ * returns a promise. Returns the parsed value on success, throws on failure
59
+ * with a formatted message.
60
+ */
61
+ /** @internal */
62
+ export declare function _validateWithSchema<S extends _StandardSchemaV1>(schema: S, value: unknown): Promise<_StandardSchemaV1.InferOutput<S>>;
63
+ /** Non-throwing variant returning the Standard Schema result directly. */
64
+ /** @internal */
65
+ export declare function _tryValidateWithSchema<S extends _StandardSchemaV1>(schema: S, value: unknown): Promise<_StandardSchemaV1.Result<_StandardSchemaV1.InferOutput<S>>>;
66
+ /** Error thrown by {@link _validateWithSchema}. */
67
+ /** @internal */
68
+ export declare class _SchemaValidationError extends Error {
69
+ readonly issues: readonly _StandardSchemaV1.Issue[];
70
+ constructor(message: string, issues: readonly _StandardSchemaV1.Issue[]);
71
+ }
72
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/file-editor/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gBAAgB;AAEhB,yBAAiB,iBAAiB,CAAC;IACjC,gBAAgB;IAChB,UAAiB,KAAK,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,KAAK;QACpD,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAGhF,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;KACnD;IAED,gBAAgB;IAChB,KAAY,MAAM,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC;IAEnE,gBAAgB;IAChB,UAAiB,aAAa,CAAC,MAAM;QACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;KAC7B;IAED,gBAAgB;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0EAA0E;AAC1E,gBAAgB;AAChB,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,iBAAiB,EAChE,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAErE;AAED,mDAAmD;AACnD,gBAAgB;AAChB,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,SAAgB,MAAM,EAAE,SAAS,iBAAiB,CAAC,KAAK,EAAE,CAAC;gBAExC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,iBAAiB,CAAC,KAAK,EAAE;CAK/E"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Filesystem-backed state store. Persists all records in a single JSON
3
+ * manifest file (default `.file-editor/state.json` under `rootDir`). Records
4
+ * are keyed by their path relative to `rootDir` so that moving the project
5
+ * directory on disk does not invalidate fingerprints.
6
+ */
7
+ import type { _StateRecord } from '../types.js';
8
+ import type { _StateStore } from './store.js';
9
+ /** @internal */
10
+ export interface _FsCentralManifestStoreOptions {
11
+ /** Root directory under which relative keys are computed. Default: `process.cwd()`. */
12
+ readonly rootDir?: string;
13
+ /** Manifest filename relative to `rootDir`. Default: `.file-editor/state.json`. */
14
+ readonly filename?: string;
15
+ /**
16
+ * If true, the manifest retains the full text of each managed file as of
17
+ * its last write, enabling three-way diffing via `_Conflict.base`.
18
+ * Off by default to limit disk usage.
19
+ */
20
+ readonly keepBaseSnapshots?: boolean;
21
+ }
22
+ /** @internal */
23
+ export interface Manifest {
24
+ readonly version: 1;
25
+ readonly records: Record<string, _StateRecord>;
26
+ }
27
+ /** Filesystem-backed manifest store. Safe for concurrent reads; single-writer. */
28
+ /** @internal */
29
+ export declare function _FsCentralManifestStore(options?: _FsCentralManifestStoreOptions): _StateStore;
30
+ //# sourceMappingURL=fs-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs-manifest.d.ts","sourceRoot":"","sources":["../../../src/file-editor/state/fs-manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,gBAAgB;AAChB,MAAM,WAAW,8BAA8B;IAC7C,uFAAuF;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED,gBAAgB;AAChB,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAChD;AAED,kFAAkF;AAClF,gBAAgB;AAChB,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,8BAAmC,GAC3C,WAAW,CAwEb"}
@@ -0,0 +1,5 @@
1
+ import type { _StateStore } from './store.js';
2
+ /** Process-local, non-persistent state store. Useful for tests and dry-runs. */
3
+ /** @internal */
4
+ export declare function _InMemoryStateStore(): _StateStore;
5
+ //# sourceMappingURL=in-memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../../src/file-editor/state/in-memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,gFAAgF;AAChF,gBAAgB;AAChB,wBAAgB,mBAAmB,IAAI,WAAW,CAoBjD"}
@@ -0,0 +1,19 @@
1
+ import type { _StateRecord } from '../types.js';
2
+ /**
3
+ * Persistence contract for drift-detection state: one record per managed file,
4
+ * keyed by absolute path. Library ships {@link _InMemoryStateStore} and
5
+ * {@link _FsCentralManifestStore}; callers may implement their own (SQLite,
6
+ * remote cache, etc.).
7
+ */
8
+ /** @internal */
9
+ export interface _StateStore {
10
+ read(absolutePath: string): Promise<_StateRecord | null>;
11
+ write(absolutePath: string, record: _StateRecord): Promise<void>;
12
+ delete(absolutePath: string): Promise<void>;
13
+ /** Optional enumeration for maintenance/GC tasks. */
14
+ list?(): Promise<readonly {
15
+ path: string;
16
+ record: _StateRecord;
17
+ }[]>;
18
+ }
19
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/file-editor/state/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;GAKG;AACH,gBAAgB;AAChB,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACzD,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,qDAAqD;IACrD,IAAI,CAAC,IAAI,OAAO,CAAC,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,YAAY,CAAA;KAAE,EAAE,CAAC,CAAC;CACrE"}
@@ -0,0 +1,60 @@
1
+ import { type _Document } from './document.js';
2
+ import type { _StateStore } from './state/store.js';
3
+ import type { _Conflict, _ConflictPolicy, _ConflictResolver, _ConfirmationPolicy, _Diagnostic, _Format, _WriteConfirm } from './types.js';
4
+ /** Options common to opening documents inside a transaction. */
5
+ /** @internal */
6
+ export interface _TransactionOptions {
7
+ readonly format?: _Format;
8
+ readonly stateStore?: _StateStore;
9
+ readonly onConflict?: _ConflictResolver;
10
+ readonly confirmWrite?: _WriteConfirm;
11
+ readonly confirmationPolicy?: _ConfirmationPolicy;
12
+ readonly toolId?: string;
13
+ readonly toolVersion?: string;
14
+ }
15
+ /** Options supplied at {@link _Transaction.commit} time. */
16
+ /** @internal */
17
+ export interface _CommitOptions {
18
+ readonly defaultPolicy?: _ConflictPolicy;
19
+ }
20
+ /** Full report of a (dry-run or actual) commit. */
21
+ /** @internal */
22
+ export interface _CommitReport {
23
+ readonly written: readonly {
24
+ readonly path: string;
25
+ readonly bytesBefore: number;
26
+ readonly bytesAfter: number;
27
+ readonly unifiedDiff: string;
28
+ }[];
29
+ readonly skipped: readonly {
30
+ readonly path: string;
31
+ readonly reason: 'no-change' | 'conflict-skipped' | 'write-skipped' | 'schema-invalid';
32
+ }[];
33
+ readonly conflicts: readonly _Conflict[];
34
+ readonly diagnostics: readonly _Diagnostic[];
35
+ }
36
+ /** An editing session spanning one or more documents. */
37
+ /** @internal */
38
+ export declare class _Transaction {
39
+ private readonly documents;
40
+ private readonly options;
41
+ constructor(options?: _TransactionOptions);
42
+ /** Open or return the cached document for a path. Memoized per transaction. */
43
+ open(absolutePath: string): Promise<_Document>;
44
+ /** @internal — register a document that was opened externally (e.g. via a façade). */
45
+ adopt(doc: _Document): void;
46
+ /** Drop all staged edits across every document in the transaction. */
47
+ rollback(): void;
48
+ /** Plan without writing. Invokes `onConflict`/`confirmWrite` as a real commit would. */
49
+ dryRun(options?: _CommitOptions): Promise<_CommitReport>;
50
+ /** Apply staged edits to disk. */
51
+ commit(options?: _CommitOptions): Promise<_CommitReport>;
52
+ private run;
53
+ }
54
+ /** Begin a new transaction. */
55
+ /** @internal */
56
+ export declare function _beginTransaction(options?: _TransactionOptions): _Transaction;
57
+ /** One-off open helper. Use a {@link _Transaction} for multi-file work. */
58
+ /** @internal */
59
+ export declare function _openDocument(absolutePath: string, options?: _TransactionOptions): Promise<_Document>;
60
+ //# sourceMappingURL=transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../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AAgB,CAAC;KACtB,EAAE,CAAC;IACJ,QAAQ,CAAC,SAAS,EAAE,SAAS,SAAS,EAAE,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,SAAS,WAAW,EAAE,CAAC;CAC9C;AAED,yDAAyD;AACzD,gBAAgB;AAChB,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgC;IAC1D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;gBAE3B,OAAO,GAAE,mBAAwB;IAIpD,+EAA+E;IAClE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAS3D,sFAAsF;IAC/E,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI;IAIlC,sEAAsE;IAC/D,QAAQ,IAAI,IAAI;IAIvB,wFAAwF;IAC3E,MAAM,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;IAIzE,kCAAkC;IACrB,MAAM,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;YAI3D,GAAG;CA+HlB;AAiHD,+BAA+B;AAC/B,gBAAgB;AAChB,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,mBAAwB,GAAG,YAAY,CAEjF;AAED,2EAA2E;AAC3E,gBAAgB;AAChB,wBAAsB,aAAa,CACjC,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,SAAS,CAAC,CAGpB"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Shared types for the structured config editor.
3
+ *
4
+ * @see https://datatracker.ietf.org/doc/html/rfc6901 — JSON Pointer
5
+ */
6
+ /** Supported document formats. */
7
+ /** @internal */
8
+ export type _Format = 'json' | 'jsonc' | 'yaml';
9
+ /**
10
+ * A JSON Pointer string as defined by RFC 6901.
11
+ *
12
+ * Examples: `""` (whole doc), `"/dependencies/lodash"`,
13
+ * `"/compilerOptions/paths/@scope~1pkg/0"`.
14
+ */
15
+ /** @internal */
16
+ export type _JsonPointer = string;
17
+ /** Diagnostic severity. */
18
+ /** @internal */
19
+ export type _Severity = 'error' | 'warning' | 'info';
20
+ /** A single finding produced by an assertion or commit flow. */
21
+ /** @internal */
22
+ export interface _Diagnostic {
23
+ readonly path: string;
24
+ readonly pointer: _JsonPointer;
25
+ readonly code: string;
26
+ readonly severity: _Severity;
27
+ readonly message: string;
28
+ readonly expected?: unknown;
29
+ readonly actual?: unknown;
30
+ }
31
+ /** A staged mutation, before it is serialized and written. */
32
+ /** @internal */
33
+ export interface _PendingEdit {
34
+ readonly kind: 'set' | 'addIfMissing' | 'updateIfPresent' | 'remove' | 'merge' | 'arrayAppend' | 'arrayUpsert';
35
+ readonly pointer: _JsonPointer;
36
+ readonly value?: unknown;
37
+ readonly updater?: (current: unknown) => unknown;
38
+ readonly arrayKey?: (element: unknown) => unknown;
39
+ readonly mergeOptions?: _MergeOptions;
40
+ readonly conflictPolicy?: _ConflictPolicy;
41
+ readonly guard?: (docValue: unknown) => boolean;
42
+ }
43
+ /** Policy for handling on-disk drift at commit time. */
44
+ /** @internal */
45
+ export type _ConflictPolicy = 'error' | 'skip' | 'overwrite' | 'ask';
46
+ /** When the `confirmWrite` hook should be invoked. */
47
+ /** @internal */
48
+ export type _ConfirmationPolicy = 'never' | 'on-conflict' | 'always';
49
+ /** Merge-operation options. */
50
+ /** @internal */
51
+ export interface _MergeOptions {
52
+ /** Array merge strategy. Default: `"replace"`. */
53
+ readonly arrays?: 'replace' | 'concat' | 'concatUnique';
54
+ /** Whether to recurse into nested objects. Default: `true`. */
55
+ readonly deep?: boolean;
56
+ }
57
+ /** Result of resolving a conflict. */
58
+ /** @internal */
59
+ export type _ConflictResolution = 'overwrite' | 'skip' | 'abort';
60
+ /** Result of a write-confirmation request. */
61
+ /** @internal */
62
+ export type _WriteDecision = 'write' | 'skip' | 'abort';
63
+ /** Reason the library is requesting a write. */
64
+ /** @internal */
65
+ export type _WriteReason = 'new-file' | 'update' | 'conflict';
66
+ /** Describes a detected drift event. */
67
+ /** @internal */
68
+ export interface _Conflict {
69
+ readonly path: string;
70
+ /** Text the library intended to write. */
71
+ readonly ours: string;
72
+ /** Current on-disk text. */
73
+ readonly theirs: string;
74
+ /** Text at last recorded write, if retained. */
75
+ readonly base: string | null;
76
+ readonly lastWriteAt: string | null;
77
+ readonly lastWriteTool: string | null;
78
+ }
79
+ /** Structured representation of a unified-diff hunk. */
80
+ /** @internal */
81
+ export interface _DiffHunk {
82
+ readonly oldStart: number;
83
+ readonly oldLines: number;
84
+ readonly newStart: number;
85
+ readonly newLines: number;
86
+ readonly lines: readonly _DiffLine[];
87
+ }
88
+ /** A single diff line within a hunk. */
89
+ /** @internal */
90
+ export interface _DiffLine {
91
+ readonly kind: 'context' | 'add' | 'del';
92
+ readonly text: string;
93
+ readonly oldLineNo: number | null;
94
+ readonly newLineNo: number | null;
95
+ }
96
+ /** Payload handed to the caller-supplied `confirmWrite` hook. */
97
+ /** @internal */
98
+ export interface _WriteRequest {
99
+ readonly path: string;
100
+ readonly format: _Format;
101
+ readonly reason: _WriteReason;
102
+ readonly currentText: string | null;
103
+ readonly nextText: string;
104
+ readonly unifiedDiff: string;
105
+ readonly hunks: readonly _DiffHunk[];
106
+ readonly conflict: _Conflict | null;
107
+ }
108
+ /** @internal */
109
+ export type _ConflictResolver = (c: _Conflict) => Promise<_ConflictResolution>;
110
+ /** @internal */
111
+ export type _WriteConfirm = (req: _WriteRequest) => Promise<_WriteDecision>;
112
+ /** Record kept in the state store for each managed file. */
113
+ /** @internal */
114
+ export interface _StateRecord {
115
+ readonly fingerprint: string;
116
+ readonly rawSha256: string;
117
+ readonly writtenAt: string;
118
+ readonly toolId: string | null;
119
+ readonly toolVersion: string | null;
120
+ readonly format: _Format;
121
+ readonly baseText?: string;
122
+ }
123
+ /** Format-specific metadata discovered while parsing. */
124
+ /** @internal */
125
+ export interface _FormatMeta {
126
+ readonly indent: string;
127
+ readonly eol: '\n' | '\r\n';
128
+ readonly hasFinalNewline: boolean;
129
+ readonly hasBom: boolean;
130
+ }
131
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/file-editor/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kCAAkC;AAClC,gBAAgB;AAChB,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,gBAAgB;AAChB,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,2BAA2B;AAC3B,gBAAgB;AAChB,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,gEAAgE;AAChE,gBAAgB;AAChB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,8DAA8D;AAC9D,gBAAgB;AAChB,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EACT,KAAK,GACL,cAAc,GACd,iBAAiB,GACjB,QAAQ,GACR,OAAO,GACP,aAAa,GACb,aAAa,CAAC;IAClB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,O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AgB;AAChB,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAE5E,4DAA4D;AAC5D,gBAAgB;AAChB,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,yDAAyD;AACzD,gBAAgB;AAChB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Write text to `path` atomically via a temp file + rename. Parent directories
3
+ * are created on demand.
4
+ */
5
+ /** @internal */
6
+ export declare function _atomicWriteText(path: string, text: string): Promise<void>;
7
+ //# sourceMappingURL=atomic-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atomic-write.d.ts","sourceRoot":"","sources":["../../../src/file-editor/util/atomic-write.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,gBAAgB;AAChB,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYhF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Unified-diff computation. Implements a classic LCS-based line diff and
3
+ * emits either a plain-text _unified-diff string or structured
4
+ * {@link _DiffHunk}s that callers can render themselves.
5
+ */
6
+ import type { _DiffHunk } from '../types.js';
7
+ /** @internal */
8
+ export interface _DiffOptions {
9
+ /** Number of context lines to include around each hunk. Default: 3. */
10
+ readonly context?: number;
11
+ readonly fileNameA?: string;
12
+ readonly fileNameB?: string;
13
+ }
14
+ /** Produce a _unified-diff string (`--- a / +++ b` headers and `@@` _hunks). */
15
+ /** @internal */
16
+ export declare function _unified(a: string, b: string, opts?: _DiffOptions): string;
17
+ /** Produce structured diff _hunks (for custom TUI rendering). */
18
+ /** @internal */
19
+ export declare function _hunks(a: string, b: string, opts?: _DiffOptions): _DiffHunk[];
20
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/file-editor/util/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,aAAa,CAAC;AAExD,gBAAgB;AAChB,MAAM,WAAW,YAAY;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,gFAAgF;AAChF,gBAAgB;AAChB,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,YAAiB,GAAG,MAAM,CAiB9E;AAED,iEAAiE;AACjE,gBAAgB;AAChB,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,YAAiB,GAAG,SAAS,EAAE,CAMjF"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Type-level arithmetic for resolving the value type at a JSON Pointer,
3
+ * given a known schema type.
4
+ *
5
+ * `_ValueAtPointer<T, P>` walks `T` segment-by-segment along the decoded
6
+ * _pointer string `P` and yields the value type at that location. For
7
+ * unknown or structurally impossible paths it falls back to `unknown`,
8
+ * so a typed `set(_pointer, value)` signature rejects values that couldn't
9
+ * possibly belong at that location.
10
+ *
11
+ * This entire module is *types only* at runtime — zero code is emitted.
12
+ *
13
+ * @see https://datatracker.ietf.org/doc/html/rfc6901
14
+ */
15
+ /** Unescape a single reference token per RFC 6901 (§4). */
16
+ /** @internal */
17
+ export type _UnescapeToken<S extends string> = S extends `${infer H}~1${infer T}` ? `${H}/${_UnescapeToken<T>}` : S extends `${infer H}~0${infer T}` ? `${H}~${_UnescapeToken<T>}` : S;
18
+ /** Split a JSON Pointer string into its decoded reference tokens. */
19
+ /** @internal */
20
+ export type _SplitPointer<P extends string> = P extends '' ? [] : P extends `/${infer Rest}` ? _SplitRest<Rest> : never;
21
+ /** @internal */
22
+ export type _SplitRest<S extends string> = S extends `${infer Head}/${infer Tail}` ? [_UnescapeToken<Head>, ..._SplitRest<Tail>] : [_UnescapeToken<S>];
23
+ /**
24
+ * Walk a schema type `T` along a sequence of reference tokens `S`,
25
+ * yielding the value type at that location (or `unknown` for structurally
26
+ * impossible paths).
27
+ * @internal
28
+ */
29
+ export type _ValueAtSegments<T, S extends readonly string[]> = S extends readonly [] ? T : S extends readonly [infer First extends string, ...infer Rest extends string[]] ? _StepInto<T, First, Rest> : unknown;
30
+ /** @internal */
31
+ export type _StepInto<T, First extends string, Rest extends readonly string[]> = T extends readonly [unknown, ...unknown[]] ? First extends keyof T ? _ValueAtSegments<NonNullable<T[First]>, Rest> : unknown : T extends readonly (infer E)[] ? First extends `${number}` ? _ValueAtSegments<E, Rest> : unknown : T extends object ? First extends keyof T ? _ValueAtSegments<NonNullable<T[First]>, Rest> : string extends keyof T ? _ValueAtSegments<NonNullable<T[keyof T & string]>, Rest> : unknown : unknown;
32
+ /**
33
+ * Given a schema type `T` and a JSON Pointer string literal `P`, the value
34
+ * type at the _pointer's location. Empty _pointer yields `T` itself.
35
+ *
36
+ * When `T` is `unknown` the arithmetic collapses to `unknown`, so the
37
+ * generic `_Document<unknown>` transparently accepts any value.
38
+ * @internal
39
+ */
40
+ export type _ValueAtPointer<T, P extends string> = _IsUnknown<T> extends true ? unknown : _ValueAtSegments<T, _SplitPointer<P>>;
41
+ /**
42
+ * `true` iff `T` is exactly `unknown` (not `any`, not `never`).
43
+ * @internal
44
+ */
45
+ export type _IsUnknown<T> = unknown extends T ? [T] extends [null | undefined] ? false : T extends unknown ? [unknown] extends [T] ? true : false : false : false;
46
+ //# sourceMappingURL=value-at-pointer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-at-pointer.d.ts","sourceRoot":"","sources":["../../src/file-editor/value-at-pointer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,2DAA2D;AAC3D,gBAAgB;AAChB,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC,EAAE,GAC7E,GAAG,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE,GAC3B,CAAC,SAAS,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC,EAAE,GAChC,GAAG,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE,GAC3B,CAAC,CAAC;AAER,qEAAqE;AACrE,gBAAgB;AAChB,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,EAAE,GACtD,EAAE,GACF,CAAC,SAAS,IAAI,MAAM,IAAI,EAAE,GACxB,UAAU,CAAC,IAAI,CAAC,GAChB,KAAK,CAAC;AAEZ,gBAAgB;AAChB,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,IAAI,IAAI,MAAM,IAAI,EAAE,GAC9E,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,IAAI,CAA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