@nanobpm/nano-ide-ext-types 1.1.0 → 1.3.0

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 (2) hide show
  1. package/dist/index.d.ts +86 -0
  2. package/package.json +12 -4
package/dist/index.d.ts CHANGED
@@ -20,6 +20,12 @@ export interface Toolchain {
20
20
  * When set, the supervisor prefers the active one (pinned →
21
21
  * `default: true` → first) over the flat `run`/`compile`. */
22
22
  runConfigs?: RunConfig[];
23
+ /** Official install instructions for this toolchain, surfaced in the IDE
24
+ * config panel when the `detect` probe fails (e.g. the Rust toolchain page). */
25
+ installUrl?: string;
26
+ /** One-line, actionable hint shown when the toolchain is missing (e.g.
27
+ * "`cargo` was not found. Install the Rust toolchain…"). */
28
+ installHint?: string;
23
29
  }
24
30
  /**
25
31
  * One named run/compile combo a pack exposes — e.g. an example that swaps
@@ -63,10 +69,86 @@ export interface ThemeSpec {
63
69
  /** Design-token name -> CSS colour. Unknown keys are ignored by the host. */
64
70
  tokens: Partial<Record<ThemeTokenKey, string>>;
65
71
  }
72
+ /**
73
+ * IntelliSense data a lang pack ships for the console's Monaco editor. The
74
+ * console has a real language service only for TypeScript/JavaScript (Monaco's
75
+ * built-in TS worker); every other language gets tokenisation only. A pack can
76
+ * light up completion, hover, and signature help for its `monacoLang` by
77
+ * shipping this curated data — no in-browser language server required. The host
78
+ * registers one provider per `monacoLang` and feeds it every pack's entries.
79
+ */
80
+ export interface LangIntellisense {
81
+ /** Monaco language id these entries apply to (e.g. "csharp", "rust"). */
82
+ monacoLang: string;
83
+ /** Extra characters that reopen the completion popup (e.g. ["."]). The word
84
+ * character set always triggers completion; add member-access dots etc. */
85
+ triggerCharacters?: string[];
86
+ /** Completion items offered in files of this language. */
87
+ completions?: CompletionSpec[];
88
+ /** Hover cards keyed by the exact symbol under the cursor. */
89
+ hovers?: HoverSpec[];
90
+ /** Signature-help entries shown while typing a call's arguments. */
91
+ signatures?: SignatureSpec[];
92
+ }
93
+ /**
94
+ * Monaco `CompletionItemKind` names a pack may use. The listed names are the
95
+ * commonly-emitted ones and exist only as authoring hints — the real authority
96
+ * is the host's kind→Monaco mapping, which renders any unknown value as
97
+ * `Value`. The union is intentionally open (`string & {}`) because the mapping
98
+ * lives in a separate repo (the console), so a closed set here can't be
99
+ * compile-time reconciled with it and would only drift; keeping it open means a
100
+ * new generator-emitted kind never breaks consumers of this package.
101
+ */
102
+ export type CompletionKind = "keyword" | "snippet" | "function" | "method" | "constructor" | "class" | "struct" | "interface" | "enum" | "module" | "property" | "field" | "variable" | "constant" | "value" | (string & {});
103
+ /** One completion item. `insertText` defaults to `label`. */
104
+ export interface CompletionSpec {
105
+ /** Text shown in the completion list. */
106
+ label: string;
107
+ /** Icon/category. Defaults to "value" when omitted. */
108
+ kind?: CompletionKind;
109
+ /** Text inserted on accept. Defaults to `label`. */
110
+ insertText?: string;
111
+ /** When true, `insertText` is a Monaco snippet (`${1:name}` placeholders). */
112
+ snippet?: boolean;
113
+ /** Short right-aligned signature/type (e.g. the return type). */
114
+ detail?: string;
115
+ /** Markdown documentation shown in the details flyout. */
116
+ documentation?: string;
117
+ }
118
+ /** A hover card: shown when the pointer rests on `symbol`. */
119
+ export interface HoverSpec {
120
+ /** Exact identifier that triggers this hover (whole-word match). */
121
+ symbol: string;
122
+ /** Markdown rendered in the hover card. */
123
+ contents: string;
124
+ }
125
+ /** One function/method signature surfaced by signature help. */
126
+ export interface SignatureSpec {
127
+ /** Identifier that, when followed by `(`, triggers this help (e.g.
128
+ * "CreateProcessInstanceAsync"). */
129
+ trigger: string;
130
+ /** Full signature line shown in the popup. */
131
+ label: string;
132
+ /** Markdown documentation for the call. */
133
+ documentation?: string;
134
+ /** Ordered parameters; the active one is highlighted by comma position. */
135
+ parameters?: SignatureParam[];
136
+ }
137
+ /** One parameter within a {@link SignatureSpec}. */
138
+ export interface SignatureParam {
139
+ /** Parameter label as it appears in the signature (e.g. "id: string"). */
140
+ label: string;
141
+ /** Markdown documentation for this parameter. */
142
+ documentation?: string;
143
+ }
66
144
  export interface ExtManifest {
67
145
  id: string;
68
146
  kind: ExtKind;
69
147
  displayName: string;
148
+ /** Optional pack icon: an inline SVG XML string (preferred; use single-quoted
149
+ * attributes so it nests in JSON) or a data:/http: URL. Lang packs supply this
150
+ * so the console can badge project cards with a language icon. */
151
+ icon?: string;
70
152
  fileTypes?: FileType[];
71
153
  templates?: TemplateSpec[];
72
154
  toolchain?: Toolchain;
@@ -83,6 +165,10 @@ export interface ExtManifest {
83
165
  summary?: string;
84
166
  /** theme packs: the console colour themes this pack contributes. */
85
167
  themes?: ThemeSpec[];
168
+ /** lang packs: curated IntelliSense (completion/hover/signature) for the
169
+ * pack's languages, since the console has no in-browser language server for
170
+ * anything but TypeScript. One entry per `monacoLang`. */
171
+ intellisense?: LangIntellisense[];
86
172
  /** Built-in packs set this; published packs omit it. */
87
173
  builtin?: boolean;
88
174
  }
package/package.json CHANGED
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "name": "@nanobpm/nano-ide-ext-types",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "TypeScript types for the nano-ide.ext.json extension manifest (ADR 0007).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
- "publishConfig": { "access": "public" },
8
- "repository": { "type": "git", "url": "https://github.com/jwulf/nano-ide.git", "directory": "packages/ext-types" },
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/jwulf/nano-ide.git",
13
+ "directory": "packages/ext-types"
14
+ },
9
15
  "main": "./dist/index.js",
10
16
  "types": "./dist/index.d.ts",
11
- "files": ["dist"],
17
+ "files": [
18
+ "dist"
19
+ ],
12
20
  "scripts": {
13
21
  "build": "tsc -p tsconfig.json",
14
22
  "typecheck": "tsc --noEmit"