@intentic/extension-api 1.15.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Artur Kurowski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @intentic/extension-api
2
+
3
+ The **extension-author contract** for the intentic app — the one SDK an extension programs against, and the
4
+ only package (with `@intentic/extension-ui`) an extension is allowed to depend on besides
5
+ `@intentic/sandbox-contract`. Published to npm; it must stay free of app internals and must **not** pull in
6
+ `@intentic/sandbox-contract` (that would invert the boundary). See the extension system in
7
+ [ARCHITECTURE.md](../../ARCHITECTURE.md) for how the host loads and gates extensions.
8
+
9
+ ## What's here
10
+
11
+ - **[manifest.ts](src/manifest.ts)** — the `intentic-extension.json` schema. The manifest is the **approval
12
+ + gating surface**: the install dialog shows exactly the declared contribution points, and the host
13
+ refuses any runtime registration (view, command, viewer, setting, process…) the approved manifest never
14
+ declared. Contribution points: `views`, `viewers`, `commands`, `settings`, `processes`, `agent`,
15
+ `environment`, `connectors`, `listener`, `bin`, plus the `permissions.sandbox` route allowlist. Identity
16
+ is derived, never declared — `extensionIdOf(manifest) = ${publisher}.${name}`.
17
+ - **[api.ts](src/api.ts)** — `IntenticApi`, the host surface delivered to `activate(api, context)`. There is
18
+ no ambient global; everything an extension registers is a `Disposable` pushed onto
19
+ `context.subscriptions`, so deactivation unwinds it.
20
+ - **[facts.ts](src/facts.ts)** — the stable **detection** vocabulary (`RepoFacts`, `CapabilityFacts`) a
21
+ view's `detect()` reads to decide when to activate. This is *not* the data plane.
22
+ - **[stream.ts](src/stream.ts)**, **[version.ts](src/version.ts)** — SSE/ndjson helpers and the host API
23
+ version (`engines.intentic` is checked against it before activation).
24
+
25
+ ## The data plane
26
+
27
+ An extension talks to the daemon over `api.sandbox.request/json(path)` — an authenticated transport (auth is
28
+ injected host-side; the bundle never sees a token). **Its reach is not unrestricted:** every path is matched
29
+ against the extension's manifest `permissions.sandbox` allowlist and an undeclared route throws. Responses
30
+ are `sandbox-contract` schemas, parsed at the call site (`Schema.parse(await api.sandbox.json(path))`) — the
31
+ in-repo, compiled-together design means a wire change is a compiler error fixed atomically, so there is no
32
+ separate "stable data API" to promote. `facts.ts` stays the stable surface only for *detection*.
33
+
34
+ ## Authoring an extension
35
+
36
+ `activate(api, context)` registers contributions and returns; `deactivate` is optional. A UI extension also
37
+ ships a prebuilt single-file ESM `entry` bundle (built with `vue` and `@intentic/extension-api` external).
38
+ The five UI extensions under [`_extensions/`](../../_extensions) are the working templates; start from one.
package/dist/api.d.ts ADDED
@@ -0,0 +1,84 @@
1
+ import type { Component } from "vue";
2
+ import type { CapabilityFacts, RepoFacts } from "./facts.js";
3
+ export interface Disposable {
4
+ dispose(): void;
5
+ }
6
+ export interface Activation {
7
+ readonly key: string;
8
+ readonly title: string;
9
+ readonly icon?: string | undefined;
10
+ readonly repo?: string | undefined;
11
+ readonly props?: Record<string, unknown> | undefined;
12
+ }
13
+ export interface ViewRegistration {
14
+ readonly id: string;
15
+ readonly label: string;
16
+ readonly surface: "rail" | "directory";
17
+ readonly detect: (repos: readonly RepoFacts[], capabilities: readonly CapabilityFacts[]) => Activation[];
18
+ readonly fallback?: true | undefined;
19
+ readonly view: () => Promise<Component>;
20
+ }
21
+ export interface ViewerRegistration {
22
+ readonly id: string;
23
+ readonly component: () => Promise<Component>;
24
+ }
25
+ export type SettingValue = string | number | boolean;
26
+ export interface ProcessStatus {
27
+ readonly name: string;
28
+ readonly running: boolean;
29
+ readonly port?: number | undefined;
30
+ readonly previewUrl?: string | undefined;
31
+ }
32
+ export interface IntenticApi {
33
+ readonly apiVersion: string;
34
+ readonly views: {
35
+ register(view: ViewRegistration): Disposable;
36
+ };
37
+ readonly viewers: {
38
+ register(viewer: ViewerRegistration): Disposable;
39
+ };
40
+ readonly commands: {
41
+ register(command: string, handler: (...args: unknown[]) => unknown): Disposable;
42
+ execute(command: string, ...args: unknown[]): Promise<unknown>;
43
+ };
44
+ readonly settings: {
45
+ get(key: string): SettingValue | undefined;
46
+ set(key: string, value: SettingValue): Promise<void>;
47
+ onDidChange(listener: (key: string) => void): Disposable;
48
+ };
49
+ readonly sandbox: {
50
+ request(path: string, init?: RequestInit): Promise<Response>;
51
+ json<T>(path: string, init?: RequestInit): Promise<T>;
52
+ reachable(): boolean;
53
+ key(...parts: readonly string[]): readonly unknown[];
54
+ origin(): string | undefined;
55
+ };
56
+ readonly workspace: {
57
+ repos(): readonly RepoFacts[];
58
+ capabilities(): readonly CapabilityFacts[];
59
+ onDidChange(listener: () => void): Disposable;
60
+ };
61
+ readonly processes: {
62
+ status(name: string): Promise<ProcessStatus>;
63
+ start(name: string): Promise<void>;
64
+ stop(name: string): Promise<void>;
65
+ };
66
+ readonly terminal: {
67
+ open(session: string): void;
68
+ setOpen(open: boolean): void;
69
+ };
70
+ readonly navigate: (path: string) => void;
71
+ readonly theme: {
72
+ mode(): "light" | "dark";
73
+ onDidChange(listener: (mode: "light" | "dark") => void): Disposable;
74
+ };
75
+ }
76
+ export interface ExtensionContext {
77
+ readonly extensionId: string;
78
+ readonly subscriptions: Disposable[];
79
+ }
80
+ export interface ExtensionModule {
81
+ activate(api: IntenticApi, context: ExtensionContext): void | Promise<void>;
82
+ deactivate?(): void | Promise<void>;
83
+ }
84
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM7D,MAAM,WAAW,UAAU;IACvB,OAAO,IAAI,IAAI,CAAC;CACnB;AAID,MAAM,WAAW,UAAU;IAEvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAGnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CACxD;AAID,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAGpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IAGvC,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,YAAY,EAAE,SAAS,eAAe,EAAE,KAAK,UAAU,EAAE,CAAC;IAEzG,QAAQ,CAAC,QAAQ,C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AI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE;QACZ,IAAI,IAAI,OAAO,GAAG,MAAM,CAAC;QACzB,WAAW,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,GAAG,UAAU,CAAC;KACvE,CAAC;CACL;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,aAAa,EAAE,UAAU,EAAE,CAAC;CACxC;AAID,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC"}
package/dist/api.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ export interface RepoFacts {
2
+ readonly repo: string;
3
+ readonly role?: "intent" | "desired-state" | "app" | undefined;
4
+ readonly hasPanel: boolean;
5
+ readonly deployConfig: boolean;
6
+ readonly desiredState: boolean;
7
+ readonly directoryUi: boolean;
8
+ readonly monorepo: boolean;
9
+ readonly vitest: boolean;
10
+ }
11
+ export interface CapabilityFacts {
12
+ readonly id: string;
13
+ readonly kind: string;
14
+ readonly config: Readonly<Record<string, string | number | boolean>>;
15
+ }
16
+ //# sourceMappingURL=facts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facts.d.ts","sourceRoot":"","sources":["../src/facts.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,eAAe,GAAG,KAAK,GAAG,SAAS,CAAC;IAE/D,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC5B;AAID,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CACxE"}
package/dist/facts.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=facts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facts.js","sourceRoot":"","sources":["../src/facts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export * from "./api.js";
2
+ export * from "./facts.js";
3
+ export * from "./manifest.js";
4
+ export * from "./permissions.js";
5
+ export * from "./stream.js";
6
+ export * from "./version.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export * from "./api.js";
2
+ export * from "./facts.js";
3
+ export * from "./manifest.js";
4
+ export * from "./permissions.js";
5
+ export * from "./stream.js";
6
+ export * from "./version.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,232 @@
1
+ import { z } from "zod";
2
+ export declare const ViewContributionSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ label: z.ZodString;
5
+ surface: z.ZodEnum<{
6
+ rail: "rail";
7
+ directory: "directory";
8
+ }>;
9
+ }, z.core.$strip>;
10
+ export type ViewContribution = z.infer<typeof ViewContributionSchema>;
11
+ export declare const ViewerContributionSchema: z.ZodObject<{
12
+ id: z.ZodString;
13
+ extensions: z.ZodArray<z.ZodString>;
14
+ fetch: z.ZodEnum<{
15
+ text: "text";
16
+ blob: "blob";
17
+ }>;
18
+ }, z.core.$strip>;
19
+ export type ViewerContribution = z.infer<typeof ViewerContributionSchema>;
20
+ export declare const CommandContributionSchema: z.ZodObject<{
21
+ command: z.ZodString;
22
+ title: z.ZodString;
23
+ icon: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>;
25
+ export type CommandContribution = z.infer<typeof CommandContributionSchema>;
26
+ export declare const SettingContributionSchema: z.ZodObject<{
27
+ key: z.ZodString;
28
+ type: z.ZodEnum<{
29
+ string: "string";
30
+ number: "number";
31
+ boolean: "boolean";
32
+ enum: "enum";
33
+ }>;
34
+ title: z.ZodString;
35
+ description: z.ZodOptional<z.ZodString>;
36
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
37
+ enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
38
+ secret: z.ZodOptional<z.ZodBoolean>;
39
+ env: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ export type SettingContribution = z.infer<typeof SettingContributionSchema>;
42
+ export declare const ProcessContributionSchema: z.ZodObject<{
43
+ name: z.ZodString;
44
+ command: z.ZodString;
45
+ cwd: z.ZodOptional<z.ZodString>;
46
+ port: z.ZodOptional<z.ZodLiteral<"auto">>;
47
+ preview: z.ZodOptional<z.ZodBoolean>;
48
+ autoStart: z.ZodOptional<z.ZodBoolean>;
49
+ }, z.core.$strip>;
50
+ export type ProcessContribution = z.infer<typeof ProcessContributionSchema>;
51
+ export declare const AgentContributionSchema: z.ZodObject<{
52
+ path: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>;
54
+ export type AgentContribution = z.infer<typeof AgentContributionSchema>;
55
+ export declare const ListenerContributionSchema: z.ZodObject<{
56
+ provider: z.ZodString;
57
+ eventTypes: z.ZodArray<z.ZodString>;
58
+ }, z.core.$strip>;
59
+ export type ListenerContribution = z.infer<typeof ListenerContributionSchema>;
60
+ export declare const EnvironmentContributionSchema: z.ZodObject<{
61
+ fragment: z.ZodString;
62
+ }, z.core.$strip>;
63
+ export type EnvironmentContribution = z.infer<typeof EnvironmentContributionSchema>;
64
+ export declare const ConnectorFieldSchema: z.ZodObject<{
65
+ key: z.ZodString;
66
+ label: z.ZodString;
67
+ placeholder: z.ZodOptional<z.ZodString>;
68
+ secret: z.ZodOptional<z.ZodBoolean>;
69
+ optional: z.ZodOptional<z.ZodBoolean>;
70
+ multiline: z.ZodOptional<z.ZodBoolean>;
71
+ default: z.ZodOptional<z.ZodString>;
72
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
73
+ value: z.ZodString;
74
+ label: z.ZodString;
75
+ }, z.core.$strip>>>;
76
+ when: z.ZodOptional<z.ZodObject<{
77
+ key: z.ZodString;
78
+ value: z.ZodString;
79
+ }, z.core.$strip>>;
80
+ }, z.core.$strip>;
81
+ export type ConnectorField = z.infer<typeof ConnectorFieldSchema>;
82
+ export declare const ConnectorContributionSchema: z.ZodObject<{
83
+ provider: z.ZodString;
84
+ kind: z.ZodLiteral<"cli">;
85
+ catalog: z.ZodObject<{
86
+ name: z.ZodString;
87
+ logo: z.ZodOptional<z.ZodString>;
88
+ description: z.ZodString;
89
+ category: z.ZodString;
90
+ hint: z.ZodOptional<z.ZodString>;
91
+ guide: z.ZodOptional<z.ZodObject<{
92
+ url: z.ZodOptional<z.ZodString>;
93
+ urlFromField: z.ZodOptional<z.ZodString>;
94
+ path: z.ZodOptional<z.ZodString>;
95
+ linkLabel: z.ZodOptional<z.ZodString>;
96
+ scopes: z.ZodOptional<z.ZodString>;
97
+ steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ }, z.core.$strip>>;
99
+ }, z.core.$strip>;
100
+ fields: z.ZodArray<z.ZodObject<{
101
+ key: z.ZodString;
102
+ label: z.ZodString;
103
+ placeholder: z.ZodOptional<z.ZodString>;
104
+ secret: z.ZodOptional<z.ZodBoolean>;
105
+ optional: z.ZodOptional<z.ZodBoolean>;
106
+ multiline: z.ZodOptional<z.ZodBoolean>;
107
+ default: z.ZodOptional<z.ZodString>;
108
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
+ value: z.ZodString;
110
+ label: z.ZodString;
111
+ }, z.core.$strip>>>;
112
+ when: z.ZodOptional<z.ZodObject<{
113
+ key: z.ZodString;
114
+ value: z.ZodString;
115
+ }, z.core.$strip>>;
116
+ }, z.core.$strip>>;
117
+ env: z.ZodRecord<z.ZodString, z.ZodString>;
118
+ skill: z.ZodString;
119
+ fragment: z.ZodOptional<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export type ConnectorContribution = z.infer<typeof ConnectorContributionSchema>;
122
+ export declare const ExtensionManifestSchema: z.ZodObject<{
123
+ publisher: z.ZodString;
124
+ name: z.ZodString;
125
+ version: z.ZodString;
126
+ engines: z.ZodObject<{
127
+ intentic: z.ZodString;
128
+ }, z.core.$strip>;
129
+ entry: z.ZodOptional<z.ZodString>;
130
+ permissions: z.ZodOptional<z.ZodObject<{
131
+ sandbox: z.ZodArray<z.ZodString>;
132
+ }, z.core.$strip>>;
133
+ contributes: z.ZodOptional<z.ZodObject<{
134
+ views: z.ZodOptional<z.ZodArray<z.ZodObject<{
135
+ id: z.ZodString;
136
+ label: z.ZodString;
137
+ surface: z.ZodEnum<{
138
+ rail: "rail";
139
+ directory: "directory";
140
+ }>;
141
+ }, z.core.$strip>>>;
142
+ viewers: z.ZodOptional<z.ZodArray<z.ZodObject<{
143
+ id: z.ZodString;
144
+ extensions: z.ZodArray<z.ZodString>;
145
+ fetch: z.ZodEnum<{
146
+ text: "text";
147
+ blob: "blob";
148
+ }>;
149
+ }, z.core.$strip>>>;
150
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
151
+ command: z.ZodString;
152
+ title: z.ZodString;
153
+ icon: z.ZodOptional<z.ZodString>;
154
+ }, z.core.$strip>>>;
155
+ settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
156
+ key: z.ZodString;
157
+ type: z.ZodEnum<{
158
+ string: "string";
159
+ number: "number";
160
+ boolean: "boolean";
161
+ enum: "enum";
162
+ }>;
163
+ title: z.ZodString;
164
+ description: z.ZodOptional<z.ZodString>;
165
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
166
+ enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
167
+ secret: z.ZodOptional<z.ZodBoolean>;
168
+ env: z.ZodOptional<z.ZodString>;
169
+ }, z.core.$strip>>>;
170
+ processes: z.ZodOptional<z.ZodArray<z.ZodObject<{
171
+ name: z.ZodString;
172
+ command: z.ZodString;
173
+ cwd: z.ZodOptional<z.ZodString>;
174
+ port: z.ZodOptional<z.ZodLiteral<"auto">>;
175
+ preview: z.ZodOptional<z.ZodBoolean>;
176
+ autoStart: z.ZodOptional<z.ZodBoolean>;
177
+ }, z.core.$strip>>>;
178
+ agent: z.ZodOptional<z.ZodObject<{
179
+ path: z.ZodOptional<z.ZodString>;
180
+ }, z.core.$strip>>;
181
+ environment: z.ZodOptional<z.ZodObject<{
182
+ fragment: z.ZodString;
183
+ }, z.core.$strip>>;
184
+ connectors: z.ZodOptional<z.ZodArray<z.ZodObject<{
185
+ provider: z.ZodString;
186
+ kind: z.ZodLiteral<"cli">;
187
+ catalog: z.ZodObject<{
188
+ name: z.ZodString;
189
+ logo: z.ZodOptional<z.ZodString>;
190
+ description: z.ZodString;
191
+ category: z.ZodString;
192
+ hint: z.ZodOptional<z.ZodString>;
193
+ guide: z.ZodOptional<z.ZodObject<{
194
+ url: z.ZodOptional<z.ZodString>;
195
+ urlFromField: z.ZodOptional<z.ZodString>;
196
+ path: z.ZodOptional<z.ZodString>;
197
+ linkLabel: z.ZodOptional<z.ZodString>;
198
+ scopes: z.ZodOptional<z.ZodString>;
199
+ steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
200
+ }, z.core.$strip>>;
201
+ }, z.core.$strip>;
202
+ fields: z.ZodArray<z.ZodObject<{
203
+ key: z.ZodString;
204
+ label: z.ZodString;
205
+ placeholder: z.ZodOptional<z.ZodString>;
206
+ secret: z.ZodOptional<z.ZodBoolean>;
207
+ optional: z.ZodOptional<z.ZodBoolean>;
208
+ multiline: z.ZodOptional<z.ZodBoolean>;
209
+ default: z.ZodOptional<z.ZodString>;
210
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
211
+ value: z.ZodString;
212
+ label: z.ZodString;
213
+ }, z.core.$strip>>>;
214
+ when: z.ZodOptional<z.ZodObject<{
215
+ key: z.ZodString;
216
+ value: z.ZodString;
217
+ }, z.core.$strip>>;
218
+ }, z.core.$strip>>;
219
+ env: z.ZodRecord<z.ZodString, z.ZodString>;
220
+ skill: z.ZodString;
221
+ fragment: z.ZodOptional<z.ZodString>;
222
+ }, z.core.$strip>>>;
223
+ listener: z.ZodOptional<z.ZodObject<{
224
+ provider: z.ZodString;
225
+ eventTypes: z.ZodArray<z.ZodString>;
226
+ }, z.core.$strip>>;
227
+ bin: z.ZodOptional<z.ZodString>;
228
+ }, z.core.$strip>>;
229
+ }, z.core.$strip>;
230
+ export type ExtensionManifest = z.infer<typeof ExtensionManifestSchema>;
231
+ export declare const extensionIdOf: (manifest: Pick<ExtensionManifest, "publisher" | "name">) => string;
232
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,sBAAsB;;;;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAMtE,eAAO,MAAM,wBAAwB;;;;;;;iBAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG1E,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAO5E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;iBAYpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAK5E,eAAO,MAAM,yBAAyB;;;;;;;iBAOpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAK5E,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAQxE,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAM9E,eAAO,MAAM,6BAA6B;;iBAKxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAKpF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;iBAU/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAOlE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwClC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE,eAAO,MAAM,aAAa,GAAI,UAAU,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,MAAM,CAAC,KAAG,MAAkD,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { z } from "zod";
2
+ export const ViewContributionSchema = z.object({
3
+ id: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
4
+ label: z.string().min(1),
5
+ surface: z.enum(["rail", "directory"]),
6
+ });
7
+ export const ViewerContributionSchema = z.object({
8
+ id: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
9
+ extensions: z.array(z.string().regex(/^[a-z0-9]+$/)).min(1),
10
+ fetch: z.enum(["text", "blob"]),
11
+ });
12
+ export const CommandContributionSchema = z.object({
13
+ command: z.string().regex(/^[a-z0-9][a-z0-9-]*(\.[a-z0-9][a-z0-9-]*)+$/),
14
+ title: z.string().min(1),
15
+ icon: z.string().optional(),
16
+ });
17
+ export const SettingContributionSchema = z.object({
18
+ key: z.string().regex(/^[a-z0-9][a-zA-Z0-9-]*$/),
19
+ type: z.enum(["boolean", "string", "number", "enum"]),
20
+ title: z.string().min(1),
21
+ description: z.string().optional(),
22
+ default: z.union([z.string(), z.number(), z.boolean()]).optional(),
23
+ enum: z.array(z.string()).optional(),
24
+ secret: z.boolean().optional(),
25
+ env: z
26
+ .string()
27
+ .regex(/^[A-Z][A-Z0-9_]*$/)
28
+ .optional(),
29
+ });
30
+ export const ProcessContributionSchema = z.object({
31
+ name: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
32
+ command: z.string().min(1),
33
+ cwd: z.string().optional(),
34
+ port: z.literal("auto").optional(),
35
+ preview: z.boolean().optional(),
36
+ autoStart: z.boolean().optional(),
37
+ });
38
+ export const AgentContributionSchema = z.object({
39
+ path: z.string().optional(),
40
+ });
41
+ export const ListenerContributionSchema = z.object({
42
+ provider: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
43
+ eventTypes: z.array(z.string().regex(/^[a-z0-9][a-z0-9_]*$/)).min(1),
44
+ });
45
+ export const EnvironmentContributionSchema = z.object({
46
+ fragment: z
47
+ .string()
48
+ .min(1)
49
+ .refine((value) => !value.split("/").includes(".."), { message: "fragment must stay inside the checkout" }),
50
+ });
51
+ export const ConnectorFieldSchema = z.object({
52
+ key: z.string().regex(/^[a-zA-Z][a-zA-Z0-9]*$/),
53
+ label: z.string().min(1),
54
+ placeholder: z.string().optional(),
55
+ secret: z.boolean().optional(),
56
+ optional: z.boolean().optional(),
57
+ multiline: z.boolean().optional(),
58
+ default: z.string().optional(),
59
+ options: z.array(z.object({ value: z.string(), label: z.string() })).optional(),
60
+ when: z.object({ key: z.string(), value: z.string() }).optional(),
61
+ });
62
+ export const ConnectorContributionSchema = z.object({
63
+ provider: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
64
+ kind: z.literal("cli"),
65
+ catalog: z.object({
66
+ name: z.string().min(1),
67
+ logo: z.string().optional(),
68
+ description: z.string().min(1),
69
+ category: z.string().min(1),
70
+ hint: z.string().optional(),
71
+ guide: z
72
+ .object({
73
+ url: z.string().optional(),
74
+ urlFromField: z.string().optional(),
75
+ path: z.string().optional(),
76
+ linkLabel: z.string().optional(),
77
+ scopes: z.string().optional(),
78
+ steps: z.array(z.string()).optional(),
79
+ })
80
+ .optional(),
81
+ }),
82
+ fields: z.array(ConnectorFieldSchema).min(1),
83
+ env: z.record(z.string().regex(/^[A-Z][A-Z0-9_]*$/), z.string()),
84
+ skill: z.string().min(1),
85
+ fragment: z.string().min(1).optional(),
86
+ });
87
+ export const ExtensionManifestSchema = z.object({
88
+ publisher: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
89
+ name: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
90
+ version: z.string().min(1),
91
+ engines: z.object({ intentic: z.string().min(1) }),
92
+ entry: z
93
+ .string()
94
+ .min(1)
95
+ .refine((value) => !value.split("/").includes(".."), { message: "entry must stay inside the checkout" })
96
+ .optional(),
97
+ permissions: z.object({ sandbox: z.array(z.string()) }).optional(),
98
+ contributes: z
99
+ .object({
100
+ views: z.array(ViewContributionSchema).optional(),
101
+ viewers: z.array(ViewerContributionSchema).optional(),
102
+ commands: z.array(CommandContributionSchema).optional(),
103
+ settings: z.array(SettingContributionSchema).optional(),
104
+ processes: z.array(ProcessContributionSchema).optional(),
105
+ agent: AgentContributionSchema.optional(),
106
+ environment: EnvironmentContributionSchema.optional(),
107
+ connectors: z.array(ConnectorContributionSchema).optional(),
108
+ listener: ListenerContributionSchema.optional(),
109
+ bin: z
110
+ .string()
111
+ .min(1)
112
+ .refine((value) => !value.split("/").includes(".."), { message: "bin must stay inside the checkout" })
113
+ .optional(),
114
+ })
115
+ .optional(),
116
+ });
117
+ export const extensionIdOf = (manifest) => `${manifest.publisher}.${manifest.name}`;
118
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"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2
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,mBAAmB,GAAI,aAAa,SAAS,MAAM,EAAE,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM,KAAG,OAOlG,CAAC"}
@@ -0,0 +1,21 @@
1
+ const escapeRegExp = (literal) => literal.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2
+ const compile = (entry) => {
3
+ const spaceIndex = entry.indexOf(" ");
4
+ if (spaceIndex < 0) {
5
+ throw new Error(`invalid sandbox permission "${entry}" — expected "<METHOD> <path-glob>", e.g. "GET /panels"`);
6
+ }
7
+ const method = entry.slice(0, spaceIndex).trim().toUpperCase();
8
+ const glob = entry.slice(spaceIndex + 1).trim();
9
+ const source = `^${glob.split("*").map(escapeRegExp).join("[^/]+")}$`;
10
+ const regex = new RegExp(source);
11
+ return { method, test: (path) => regex.test(path) };
12
+ };
13
+ export const sandboxRouteAllowed = (permissions, method, path) => {
14
+ const route = path.split("?")[0] ?? path;
15
+ const wanted = method.toUpperCase();
16
+ return permissions.some((entry) => {
17
+ const compiled = compile(entry);
18
+ return compiled.method === wanted && compiled.test(route);
19
+ });
20
+ };
21
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAKA,MAAM,YAAY,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AASjG,MAAM,OAAO,GAAG,CAAC,KAAa,EAAiB,EAAE;IAC7C,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,+BAA+B,KAAK,yDAAyD,CAAC,CAAC;IACnH,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/D,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;IACtE,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACxD,CAAC,CAAC;AAIF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,WAA8B,EAAE,MAAc,EAAE,IAAY,EAAW,EAAE;IACzG,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC,MAAM,KAAK,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function readDaemonStream(body: ReadableStream<Uint8Array>): AsyncGenerator<Record<string, unknown>>;
2
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AA+DA,wBAAuB,gBAAgB,CAAC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAmBjH"}
package/dist/stream.js ADDED
@@ -0,0 +1,69 @@
1
+ const SSE_IDLE_MS = 120_000;
2
+ async function* sseFrames(body) {
3
+ const reader = body.getReader();
4
+ const decoder = new TextDecoder();
5
+ let buffer = "";
6
+ try {
7
+ for (;;) {
8
+ let timer;
9
+ const idle = new Promise((resolve) => {
10
+ timer = setTimeout(() => resolve("idle"), SSE_IDLE_MS);
11
+ });
12
+ const result = await Promise.race([reader.read(), idle]);
13
+ clearTimeout(timer);
14
+ if (result === "idle") {
15
+ return;
16
+ }
17
+ const { done, value } = result;
18
+ if (done) {
19
+ break;
20
+ }
21
+ buffer += decoder.decode(value, { stream: true });
22
+ let separator = buffer.indexOf("\n\n");
23
+ while (separator !== -1) {
24
+ yield buffer.slice(0, separator);
25
+ buffer = buffer.slice(separator + 2);
26
+ separator = buffer.indexOf("\n\n");
27
+ }
28
+ }
29
+ }
30
+ finally {
31
+ await reader.cancel().catch(() => { });
32
+ }
33
+ }
34
+ const dataOf = (frame) => {
35
+ const line = frame.split("\n").find((entry) => entry.startsWith("data:"));
36
+ if (line === undefined) {
37
+ return undefined;
38
+ }
39
+ const payload = line.slice(5).trim();
40
+ if (payload.length === 0) {
41
+ return undefined;
42
+ }
43
+ try {
44
+ return JSON.parse(payload);
45
+ }
46
+ catch {
47
+ return undefined;
48
+ }
49
+ };
50
+ export async function* readDaemonStream(body) {
51
+ for await (const frame of sseFrames(body)) {
52
+ const parsed = dataOf(frame);
53
+ if (typeof parsed !== "object" || parsed === null) {
54
+ continue;
55
+ }
56
+ const record = parsed;
57
+ const isError = frame
58
+ .split("\n")
59
+ .find((line) => line.startsWith("event:"))
60
+ ?.slice(6)
61
+ .trim() === "error";
62
+ if (isError) {
63
+ yield { kind: "error", message: typeof record["message"] === "string" ? record["message"] : "Provisioning failed." };
64
+ continue;
65
+ }
66
+ yield record;
67
+ }
68
+ }
69
+ //# sourceMappingURL=stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.js","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,GAAG,OAAO,CAAC;AAI5B,KAAK,SAAS,CAAC,CAAC,SAAS,CAAC,IAAgC;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC;QACD,SAAS,CAAC;YACN,IAAI,KAAoC,CAAC;YACzC,MAAM,IAAI,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;gBACzC,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;YAC3D,CAAC,CAAC,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;YACzD,YAAY,CAAC,KAAM,CAAC,CAAC;YACrB,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACpB,OAAO;YACX,CAAC;YACD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;YAC/B,IAAI,IAAI,EAAE,CAAC;gBACP,MAAM;YACV,CAAC;YACD,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,IAAI,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACvC,OAAO,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;gBACtB,MAAM,MAAM,CAA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b,CAAC;QACD,MAAM,MAAM,GAAG,MAAiC,CAAC;QACjD,MAAM,OAAO,GACT,KAAK;aACA,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAC1C,EAAE,KAAK,CAAC,CAAC,CAAC;aACT,IAAI,EAAE,KAAK,OAAO,CAAC;QAC5B,IAAI,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,sBAAsB,EAAE,CAAC;YACrH,SAAS;QACb,CAAC;QACD,MAAM,MAAM,CAAC;IACjB,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const extensionApiVersion = "0.2.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const extensionApiVersion = "0.2.0";
2
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@intentic/extension-api",
3
+ "version": "1.15.1",
4
+ "description": "The versioned public API intentic extensions compile against — manifest schema, detection facts and the host API",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://gitlab.com/radarsu/intentic.git",
10
+ "directory": "_libs/extension-api"
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "registry": "https://registry.npmjs.org/"
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": {
23
+ "@intentic/src": "./src/index.ts",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "require": {
27
+ "@intentic/src": "./src/index.ts",
28
+ "default": "./dist/index.js"
29
+ }
30
+ }
31
+ },
32
+ "dependencies": {
33
+ "tslib": "2.8.1",
34
+ "zod": "4.4.3"
35
+ },
36
+ "peerDependencies": {
37
+ "vue": "^3.5.0"
38
+ },
39
+ "devDependencies": {
40
+ "typescript": "5.9.3",
41
+ "vue": "3.5.39",
42
+ "@intentic/tsconfig": "0.0.0"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc",
46
+ "watch": "tsc --build --watch"
47
+ }
48
+ }