@formspec/analysis 0.1.0-alpha.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.
Files changed (53) hide show
  1. package/README.md +14 -0
  2. package/dist/__tests__/comment-syntax.test.d.ts +2 -0
  3. package/dist/__tests__/comment-syntax.test.d.ts.map +1 -0
  4. package/dist/__tests__/compiler-signatures.test.d.ts +2 -0
  5. package/dist/__tests__/compiler-signatures.test.d.ts.map +1 -0
  6. package/dist/__tests__/cursor-context.test.d.ts +2 -0
  7. package/dist/__tests__/cursor-context.test.d.ts.map +1 -0
  8. package/dist/__tests__/file-snapshots.test.d.ts +2 -0
  9. package/dist/__tests__/file-snapshots.test.d.ts.map +1 -0
  10. package/dist/__tests__/helpers.d.ts +7 -0
  11. package/dist/__tests__/helpers.d.ts.map +1 -0
  12. package/dist/__tests__/semantic-protocol.test.d.ts +2 -0
  13. package/dist/__tests__/semantic-protocol.test.d.ts.map +1 -0
  14. package/dist/__tests__/semantic-targets.test.d.ts +2 -0
  15. package/dist/__tests__/semantic-targets.test.d.ts.map +1 -0
  16. package/dist/__tests__/tag-registry.test.d.ts +2 -0
  17. package/dist/__tests__/tag-registry.test.d.ts.map +1 -0
  18. package/dist/__tests__/tag-value-parser.test.d.ts +2 -0
  19. package/dist/__tests__/tag-value-parser.test.d.ts.map +1 -0
  20. package/dist/__tests__/ts-binding.test.d.ts +2 -0
  21. package/dist/__tests__/ts-binding.test.d.ts.map +1 -0
  22. package/dist/analysis.d.ts +812 -0
  23. package/dist/comment-syntax.d.ts +43 -0
  24. package/dist/comment-syntax.d.ts.map +1 -0
  25. package/dist/compiler-signatures.d.ts +100 -0
  26. package/dist/compiler-signatures.d.ts.map +1 -0
  27. package/dist/cursor-context.d.ts +89 -0
  28. package/dist/cursor-context.d.ts.map +1 -0
  29. package/dist/file-snapshots.d.ts +18 -0
  30. package/dist/file-snapshots.d.ts.map +1 -0
  31. package/dist/index.cjs +3582 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.d.ts +20 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +3497 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/path-target.d.ts +11 -0
  38. package/dist/path-target.d.ts.map +1 -0
  39. package/dist/semantic-protocol.d.ts +234 -0
  40. package/dist/semantic-protocol.d.ts.map +1 -0
  41. package/dist/semantic-targets.d.ts +86 -0
  42. package/dist/semantic-targets.d.ts.map +1 -0
  43. package/dist/source-bindings.d.ts +21 -0
  44. package/dist/source-bindings.d.ts.map +1 -0
  45. package/dist/tag-registry.d.ts +46 -0
  46. package/dist/tag-registry.d.ts.map +1 -0
  47. package/dist/tag-value-parser.d.ts +20 -0
  48. package/dist/tag-value-parser.d.ts.map +1 -0
  49. package/dist/ts-binding.d.ts +28 -0
  50. package/dist/ts-binding.d.ts.map +1 -0
  51. package/dist/workspace-runtime.d.ts +15 -0
  52. package/dist/workspace-runtime.d.ts.map +1 -0
  53. package/package.json +42 -0
@@ -0,0 +1,43 @@
1
+ import type { PathTarget } from "@formspec/core";
2
+ import { type ExtensionTagSource } from "./tag-registry.js";
3
+ export interface CommentSourceSpan {
4
+ readonly start: number;
5
+ readonly end: number;
6
+ }
7
+ export type CommentSpan = CommentSourceSpan;
8
+ export interface ParsedCommentTargetSpecifier {
9
+ readonly rawText: string;
10
+ readonly valid: boolean;
11
+ readonly kind: "path" | "member" | "variant" | "ambiguous";
12
+ readonly fullSpan: CommentSourceSpan;
13
+ readonly colonSpan: CommentSourceSpan;
14
+ readonly span: CommentSourceSpan;
15
+ readonly path: PathTarget | null;
16
+ }
17
+ export interface ParsedCommentTag {
18
+ readonly rawTagName: string;
19
+ readonly normalizedTagName: string;
20
+ readonly recognized: boolean;
21
+ readonly fullSpan: CommentSourceSpan;
22
+ readonly tagNameSpan: CommentSourceSpan;
23
+ readonly payloadSpan: CommentSourceSpan | null;
24
+ readonly colonSpan: CommentSourceSpan | null;
25
+ readonly target: ParsedCommentTargetSpecifier | null;
26
+ readonly argumentSpan: CommentSourceSpan | null;
27
+ readonly argumentText: string;
28
+ }
29
+ export interface ParsedCommentBlock {
30
+ readonly commentText: string;
31
+ readonly offset: number;
32
+ readonly tags: readonly ParsedCommentTag[];
33
+ }
34
+ export interface ParseCommentSyntaxOptions {
35
+ readonly offset?: number;
36
+ readonly extensions?: readonly ExtensionTagSource[];
37
+ }
38
+ export declare function parseCommentBlock(commentText: string, options?: ParseCommentSyntaxOptions): ParsedCommentBlock;
39
+ export declare function parseTagSyntax(rawTagName: string, payloadText: string, options?: Omit<ParseCommentSyntaxOptions, "offset">): ParsedCommentTag;
40
+ export declare function sliceCommentSpan(commentText: string, span: CommentSpan, options?: {
41
+ readonly offset?: number;
42
+ }): string;
43
+ //# sourceMappingURL=comment-syntax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-syntax.d.ts","sourceRoot":"","sources":["../src/comment-syntax.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE5C,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;IAC3D,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,IAAI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B,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC,MAAM,CAGR"}
@@ -0,0 +1,100 @@
1
+ import { type ExtensionTagSource, type FormSpecPlacement, type TagDefinition, type TagSignature } from "./tag-registry.js";
2
+ /**
3
+ * Target kinds that can be represented in a synthetic compiler call.
4
+ *
5
+ * This intentionally excludes `"none"`, because a missing target is modeled by
6
+ * omitting the synthetic target argument entirely.
7
+ */
8
+ export type SyntheticTagTargetKind = "path" | "member" | "variant";
9
+ /**
10
+ * A normalized target argument that can be lowered into a synthetic helper
11
+ * call for compiler-backed validation.
12
+ */
13
+ export interface SyntheticTagTargetSpecifier {
14
+ readonly kind: SyntheticTagTargetKind;
15
+ readonly text: string;
16
+ }
17
+ /**
18
+ * Inputs required to lower a parsed FormSpec tag into a synthetic TypeScript
19
+ * helper call.
20
+ *
21
+ * `hostType` and `subjectType` are trusted snippets of TypeScript type syntax
22
+ * supplied by the caller. They are embedded into an in-memory synthetic source
23
+ * file and are never executed.
24
+ */
25
+ export interface LowerSyntheticTagApplicationOptions {
26
+ readonly tagName: string;
27
+ readonly placement: FormSpecPlacement;
28
+ readonly hostType: string;
29
+ readonly subjectType: string;
30
+ readonly target?: SyntheticTagTargetSpecifier | null;
31
+ readonly argumentExpression?: string | null;
32
+ readonly extensions?: readonly ExtensionTagSource[];
33
+ }
34
+ /**
35
+ * Result of lowering a tag application into the synthetic call representation
36
+ * used for compiler-backed validation.
37
+ */
38
+ export interface LoweredSyntheticTagApplication {
39
+ readonly definition: TagDefinition;
40
+ readonly matchingSignatures: readonly TagSignature[];
41
+ readonly callExpression: string;
42
+ }
43
+ /**
44
+ * A simplified TypeScript diagnostic surfaced from the synthetic compiler pass.
45
+ */
46
+ export interface SyntheticCompilerDiagnostic {
47
+ readonly code: number;
48
+ readonly message: string;
49
+ }
50
+ /**
51
+ * Options for running the TypeScript checker against a synthetic tag call.
52
+ */
53
+ export interface CheckSyntheticTagApplicationOptions extends LowerSyntheticTagApplicationOptions {
54
+ readonly supportingDeclarations?: readonly string[];
55
+ }
56
+ /**
57
+ * Result of checking a lowered synthetic tag application with the TypeScript
58
+ * compiler.
59
+ */
60
+ export interface SyntheticTagCheckResult {
61
+ readonly sourceText: string;
62
+ readonly diagnostics: readonly SyntheticCompilerDiagnostic[];
63
+ }
64
+ /**
65
+ * Filters a tag definition's overloads down to the ones that apply to the
66
+ * requested placement and synthetic target form.
67
+ *
68
+ * This is the overload-selection primitive used by both the lowering phase
69
+ * and cursor-aware tooling that wants to show only the currently-applicable
70
+ * signatures for a tag.
71
+ */
72
+ export declare function getMatchingTagSignatures(definition: TagDefinition, placement: FormSpecPlacement, targetKind: SyntheticTagTargetKind | null): readonly TagSignature[];
73
+ /**
74
+ * Builds the synthetic helper declarations used to validate FormSpec tag
75
+ * applications through the TypeScript checker.
76
+ *
77
+ * The returned string is a virtual `.d.ts`-style prelude that declares the
78
+ * `__formspec.*` helper namespace together with context, path, member, and
79
+ * variant helper types. It is intended to be embedded into an in-memory
80
+ * TypeScript program, never emitted to disk.
81
+ */
82
+ export declare function buildSyntheticHelperPrelude(extensions?: readonly ExtensionTagSource[]): string;
83
+ /**
84
+ * Lowers a normalized tag application into a synthetic helper call.
85
+ *
86
+ * The caller is responsible for supplying trusted `hostType` and `subjectType`
87
+ * snippets that are valid TypeScript type syntax in the generated synthetic
88
+ * program. This function does not sanitize those snippets; it only assembles
89
+ * the helper call and selects the matching overload metadata.
90
+ */
91
+ export declare function lowerTagApplicationToSyntheticCall(options: LowerSyntheticTagApplicationOptions): LoweredSyntheticTagApplication;
92
+ /**
93
+ * Runs the TypeScript checker against a lowered synthetic tag application.
94
+ *
95
+ * This is the compiler-backed validation entrypoint used by FormSpec analysis
96
+ * to verify placement, target binding, and argument compatibility without
97
+ * requiring comment tags themselves to be valid TypeScript syntax.
98
+ */
99
+ export declare function checkSyntheticTagApplication(options: CheckSyntheticTagApplicationOptions): SyntheticTagCheckResult;
100
+ //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WAAW,mCAAoC,SAAQ,mCAAmC;IAC9F,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrD;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAC9D;AAuOD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,aAAa,EACzB,SAAS,EAAE,iBAAiB,EAC5B,UAAU,EAAE,sBAAsB,GAAG,IAAI,GACxC,SAAS,YAAY,EAAE,CAKzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,CAW9F;AAED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,mCAAmC,GAC3C,8BAA8B,CAsChC;AA2CD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,mCAAmC,GAC3C,uBAAuB,CAqCzB"}
@@ -0,0 +1,89 @@
1
+ import { type ParsedCommentBlock, type ParsedCommentTag } from "./comment-syntax.js";
2
+ import type * as ts from "typescript";
3
+ import { type ExtensionTagSource, type FormSpecPlacement, type FormSpecTargetKind, type TagDefinition, type TagSignature } from "./tag-registry.js";
4
+ export interface EnclosingDocComment {
5
+ readonly text: string;
6
+ readonly start: number;
7
+ readonly end: number;
8
+ readonly parsed: ParsedCommentBlock;
9
+ }
10
+ export interface CommentCursorTarget {
11
+ readonly kind: "tag-name" | "colon" | "target" | "argument";
12
+ readonly tag: ParsedCommentTag;
13
+ }
14
+ export type CommentCompletionContext = {
15
+ readonly kind: "tag-name";
16
+ readonly prefix: string;
17
+ } | {
18
+ readonly kind: "target";
19
+ readonly tag: ParsedCommentTag;
20
+ } | {
21
+ readonly kind: "argument";
22
+ readonly tag: ParsedCommentTag;
23
+ } | {
24
+ readonly kind: "none";
25
+ };
26
+ export interface CommentSemanticContextOptions {
27
+ readonly extensions?: readonly ExtensionTagSource[];
28
+ readonly placement?: FormSpecPlacement | null;
29
+ readonly checker?: ts.TypeChecker;
30
+ readonly subjectType?: ts.Type;
31
+ }
32
+ export interface CommentTagSemanticContext {
33
+ readonly tag: ParsedCommentTag;
34
+ readonly tagDefinition: TagDefinition | null;
35
+ readonly placement: FormSpecPlacement | null;
36
+ readonly signatures: readonly TagSignature[];
37
+ readonly supportedTargets: readonly FormSpecTargetKind[];
38
+ readonly targetCompletions: readonly string[];
39
+ readonly compatiblePathTargets: readonly string[];
40
+ readonly valueLabels: readonly string[];
41
+ readonly tagHoverMarkdown: string | null;
42
+ readonly targetHoverMarkdown: string | null;
43
+ readonly argumentHoverMarkdown: string | null;
44
+ }
45
+ export type SemanticCommentCompletionContext = {
46
+ readonly kind: "tag-name";
47
+ readonly prefix: string;
48
+ readonly availableTags: readonly TagDefinition[];
49
+ } | {
50
+ readonly kind: "target";
51
+ readonly semantic: CommentTagSemanticContext;
52
+ } | {
53
+ readonly kind: "argument";
54
+ readonly semantic: CommentTagSemanticContext;
55
+ readonly valueLabels: readonly string[];
56
+ } | {
57
+ readonly kind: "none";
58
+ };
59
+ export interface CommentHoverInfo {
60
+ readonly kind: "tag-name" | "target" | "argument";
61
+ readonly markdown: string;
62
+ }
63
+ export declare function getCommentTagSemanticContext(tag: ParsedCommentTag, options?: CommentSemanticContextOptions): CommentTagSemanticContext;
64
+ export declare function findEnclosingDocComment(documentText: string, offset: number, options?: {
65
+ readonly extensions?: readonly ExtensionTagSource[];
66
+ }): EnclosingDocComment | null;
67
+ export declare function findCommentTagAtOffset(documentText: string, offset: number, options?: {
68
+ readonly extensions?: readonly ExtensionTagSource[];
69
+ }): ParsedCommentTag | null;
70
+ export declare function getCommentCursorTargetAtOffset(documentText: string, offset: number, options?: {
71
+ readonly extensions?: readonly ExtensionTagSource[];
72
+ }): CommentCursorTarget | null;
73
+ export declare function getTagCompletionPrefixAtOffset(documentText: string, offset: number): string | null;
74
+ export declare function getCommentCompletionContextAtOffset(documentText: string, offset: number, options?: {
75
+ readonly extensions?: readonly ExtensionTagSource[];
76
+ }): CommentCompletionContext;
77
+ /**
78
+ * Resolves the completion context at a document offset, upgrading syntax-only
79
+ * results with placement/type-aware semantics when TypeScript binding data is
80
+ * available.
81
+ */
82
+ export declare function getSemanticCommentCompletionContextAtOffset(documentText: string, offset: number, options?: CommentSemanticContextOptions): SemanticCommentCompletionContext;
83
+ /**
84
+ * Returns hover information for the comment token under the given document
85
+ * offset, including semantic target/argument help when binding data is
86
+ * available.
87
+ */
88
+ export declare function getCommentHoverInfoAtOffset(documentText: string, offset: number, options?: CommentSemanticContextOptions): CommentHoverInfo | null;
89
+ //# sourceMappingURL=cursor-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor-context.d.ts","sourceRoot":"","sources":["../src/cursor-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC5D,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;C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G,IAAI,CAOzB;AAED,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,GAChE,mBAAmB,GAAG,IAAI,CAyC5B;AAED,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,CA2Bf;AAED,wBAAgB,mCAAmC,CACjD,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,GAChE,wBAAwB,CA2B1B;AAED;;;;GAIG;AACH,wBAAgB,2CAA2C,CACzD,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,6BAA6B,GACtC,gCAAgC,CAgClC;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,6BAA6B,GACtC,gBAAgB,GAAG,IAAI,CAqCzB"}
@@ -0,0 +1,18 @@
1
+ import * as ts from "typescript";
2
+ import { type FormSpecAnalysisFileSnapshot } from "./semantic-protocol.js";
3
+ import type { ExtensionTagSource } from "./tag-registry.js";
4
+ /**
5
+ * Options used when building a serializable, editor-oriented snapshot for a
6
+ * TypeScript source file.
7
+ */
8
+ export interface BuildFormSpecAnalysisFileSnapshotOptions {
9
+ readonly checker: ts.TypeChecker;
10
+ readonly extensions?: readonly ExtensionTagSource[];
11
+ }
12
+ /**
13
+ * Builds a transport-safe snapshot of every FormSpec-bearing doc comment in a
14
+ * source file, including semantic hover/completion context and file-local
15
+ * diagnostics.
16
+ */
17
+ export declare function buildFormSpecAnalysisFileSnapshot(sourceFile: ts.SourceFile, options: BuildFormSpecAnalysisFileSnapshotOptions): FormSpecAnalysisFileSnapshot;
18
+ //# sourceMappingURL=file-snapshots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-snapshots.d.ts","sourceRoot":"","sources":["../src/file-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAQjC,OAAO,EAKL,KAAK,4BAA4B,EAClC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,mBAAmB,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,wCAAwC;IACvD,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACrD;AA6ND;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,OAAO,EAAE,wCAAwC,GAChD,4BAA4B,CAkE9B"}