@openwaggle/extension-sdk 0.0.0-bootstrap.0 → 0.1.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.
- package/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/agent-loop.d.ts +128 -0
- package/dist/agent-loop.js +47 -0
- package/dist/broker-validation.d.ts +17 -0
- package/dist/broker-validation.js +99 -0
- package/dist/broker.d.ts +193 -0
- package/dist/broker.js +81 -0
- package/dist/constants.d.ts +183 -0
- package/dist/constants.js +245 -0
- package/dist/context.d.ts +66 -0
- package/dist/context.js +49 -0
- package/dist/contribution-types.d.ts +21 -0
- package/dist/contribution-types.js +1 -0
- package/dist/core-types.d.ts +58 -0
- package/dist/core-types.js +1 -0
- package/dist/docs-validation.d.ts +3 -0
- package/dist/docs-validation.js +93 -0
- package/dist/docs.d.ts +231 -0
- package/dist/docs.js +85 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +10 -0
- package/dist/internal-validation.d.ts +4 -0
- package/dist/internal-validation.js +24 -0
- package/dist/json.d.ts +9 -0
- package/dist/json.js +3 -0
- package/dist/manifest-contributions.d.ts +380 -0
- package/dist/manifest-contributions.js +75 -0
- package/dist/manifest-primitives.d.ts +20 -0
- package/dist/manifest-primitives.js +118 -0
- package/dist/manifest.d.ts +303 -0
- package/dist/manifest.js +89 -0
- package/dist/openwaggle-sdk.d.ts +2 -0
- package/dist/openwaggle-sdk.js +127 -0
- package/dist/openwaggle-types.d.ts +111 -0
- package/dist/openwaggle-types.js +1 -0
- package/dist/openwaggle-validation.d.ts +12 -0
- package/dist/openwaggle-validation.js +135 -0
- package/dist/registry-types.d.ts +34 -0
- package/dist/registry-types.js +1 -0
- package/dist/runtime-sdk.d.ts +2 -0
- package/dist/runtime-sdk.js +19 -0
- package/dist/runtime-types.d.ts +19 -0
- package/dist/runtime-types.js +1 -0
- package/dist/runtime.d.ts +22 -0
- package/dist/runtime.js +22 -0
- package/dist/schema.d.ts +13 -0
- package/dist/schema.js +25 -0
- package/dist/sdk-types.d.ts +92 -0
- package/dist/sdk-types.js +1 -0
- package/dist/storage-sdk.d.ts +2 -0
- package/dist/storage-sdk.js +51 -0
- package/dist/storage-types.d.ts +40 -0
- package/dist/storage-types.js +1 -0
- package/dist/theme-data.d.ts +126 -0
- package/dist/theme-data.js +144 -0
- package/dist/theme-types.d.ts +61 -0
- package/dist/theme-types.js +1 -0
- package/dist/theme.d.ts +6 -0
- package/dist/theme.js +128 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.js +1 -0
- package/dist/ui-constants.d.ts +24 -0
- package/dist/ui-constants.js +22 -0
- package/dist/ui-stylesheet.d.ts +8 -0
- package/dist/ui-stylesheet.js +223 -0
- package/dist/ui.d.ts +6 -0
- package/dist/ui.js +16 -0
- package/dist-cjs/agent-loop.js +83 -0
- package/dist-cjs/broker-validation.js +109 -0
- package/dist-cjs/broker.js +120 -0
- package/dist-cjs/constants.js +248 -0
- package/dist-cjs/context.js +54 -0
- package/dist-cjs/contribution-types.js +2 -0
- package/dist-cjs/core-types.js +2 -0
- package/dist-cjs/docs-validation.js +97 -0
- package/dist-cjs/docs.js +121 -0
- package/dist-cjs/index.js +56 -0
- package/dist-cjs/internal-validation.js +30 -0
- package/dist-cjs/json.js +39 -0
- package/dist-cjs/manifest-contributions.js +111 -0
- package/dist-cjs/manifest-primitives.js +158 -0
- package/dist-cjs/manifest.js +140 -0
- package/dist-cjs/openwaggle-sdk.js +130 -0
- package/dist-cjs/openwaggle-types.js +2 -0
- package/dist-cjs/openwaggle-validation.js +148 -0
- package/dist-cjs/package.json +3 -0
- package/dist-cjs/registry-types.js +2 -0
- package/dist-cjs/runtime-sdk.js +22 -0
- package/dist-cjs/runtime-types.js +2 -0
- package/dist-cjs/runtime.js +61 -0
- package/dist-cjs/schema.js +61 -0
- package/dist-cjs/sdk-types.js +2 -0
- package/dist-cjs/storage-sdk.js +54 -0
- package/dist-cjs/storage-types.js +2 -0
- package/dist-cjs/theme-data.js +147 -0
- package/dist-cjs/theme-types.js +2 -0
- package/dist-cjs/theme.js +135 -0
- package/dist-cjs/types.js +2 -0
- package/dist-cjs/ui-constants.js +25 -0
- package/dist-cjs/ui-stylesheet.js +227 -0
- package/dist-cjs/ui.js +24 -0
- package/package.json +98 -8
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
2
|
+
import { isNonEmptyString, isRecord, isStringArray } from './internal-validation.js';
|
|
3
|
+
function isStringOrNull(value) {
|
|
4
|
+
return value === null || typeof value === 'string';
|
|
5
|
+
}
|
|
6
|
+
function isOptionalNonEmptyString(value) {
|
|
7
|
+
return value === undefined || isNonEmptyString(value);
|
|
8
|
+
}
|
|
9
|
+
function hasOpenWaggleResultBase(value, capability, method) {
|
|
10
|
+
return (isNonEmptyString(value.extensionId) &&
|
|
11
|
+
isNonEmptyString(value.contributionId) &&
|
|
12
|
+
value.capability === capability &&
|
|
13
|
+
value.method === method);
|
|
14
|
+
}
|
|
15
|
+
function isDocsDiscoveryDiagnostic(value) {
|
|
16
|
+
return (isRecord(value) &&
|
|
17
|
+
(value.severity === 'warning' || value.severity === 'error') &&
|
|
18
|
+
isNonEmptyString(value.code) &&
|
|
19
|
+
isNonEmptyString(value.message) &&
|
|
20
|
+
isOptionalNonEmptyString(value.path));
|
|
21
|
+
}
|
|
22
|
+
function isFirstPartyDocsTopicSummary(value) {
|
|
23
|
+
return (isRecord(value) &&
|
|
24
|
+
isNonEmptyString(value.topic) &&
|
|
25
|
+
(value.source === 'openwaggle' || value.source === 'pi') &&
|
|
26
|
+
isNonEmptyString(value.group) &&
|
|
27
|
+
isNonEmptyString(value.title) &&
|
|
28
|
+
isOptionalNonEmptyString(value.description) &&
|
|
29
|
+
isOptionalNonEmptyString(value.section) &&
|
|
30
|
+
typeof value.order === 'number' &&
|
|
31
|
+
isNonEmptyString(value.path) &&
|
|
32
|
+
isNonEmptyString(value.bundlePath) &&
|
|
33
|
+
isNonEmptyString(value.sourcePath) &&
|
|
34
|
+
isStringArray(value.aliases) &&
|
|
35
|
+
isStringArray(value.keywords) &&
|
|
36
|
+
isNonEmptyString(value.contentHash));
|
|
37
|
+
}
|
|
38
|
+
function isExtensionDocsPackageScopeView(value) {
|
|
39
|
+
return (isRecord(value) &&
|
|
40
|
+
(value.kind === 'global' || value.kind === 'project') &&
|
|
41
|
+
isNonEmptyString(value.label) &&
|
|
42
|
+
isOptionalNonEmptyString(value.projectPath));
|
|
43
|
+
}
|
|
44
|
+
function isExtensionDocsProvenance(value) {
|
|
45
|
+
return (isRecord(value) &&
|
|
46
|
+
isNonEmptyString(value.extensionId) &&
|
|
47
|
+
isStringOrNull(value.extensionName) &&
|
|
48
|
+
isStringOrNull(value.extensionVersion) &&
|
|
49
|
+
isExtensionDocsPackageScopeView(value.scope) &&
|
|
50
|
+
isNonEmptyString(value.packagePath) &&
|
|
51
|
+
isNonEmptyString(value.manifestPath) &&
|
|
52
|
+
isNonEmptyString(value.path) &&
|
|
53
|
+
isStringOrNull(value.packageContentHash) &&
|
|
54
|
+
(value.trust === 'trusted' || value.trust === 'untrusted' || value.trust === 'unknown') &&
|
|
55
|
+
(value.lifecycle === 'enabled' ||
|
|
56
|
+
value.lifecycle === 'disabled' ||
|
|
57
|
+
value.lifecycle === 'unavailable'));
|
|
58
|
+
}
|
|
59
|
+
function isExtensionDocsTopicSummary(value) {
|
|
60
|
+
return (isRecord(value) &&
|
|
61
|
+
isNonEmptyString(value.topic) &&
|
|
62
|
+
isNonEmptyString(value.localTopic) &&
|
|
63
|
+
isNonEmptyString(value.title) &&
|
|
64
|
+
isOptionalNonEmptyString(value.description) &&
|
|
65
|
+
isNonEmptyString(value.path) &&
|
|
66
|
+
isStringArray(value.aliases) &&
|
|
67
|
+
isStringArray(value.keywords) &&
|
|
68
|
+
isStringOrNull(value.contentHash) &&
|
|
69
|
+
isExtensionDocsProvenance(value.provenance) &&
|
|
70
|
+
Array.isArray(value.diagnostics) &&
|
|
71
|
+
value.diagnostics.every(isDocsDiscoveryDiagnostic));
|
|
72
|
+
}
|
|
73
|
+
function isDocsDiscoveryView(value) {
|
|
74
|
+
return (isRecord(value) &&
|
|
75
|
+
isNonEmptyString(value.generatedAt) &&
|
|
76
|
+
isNonEmptyString(value.bundlePath) &&
|
|
77
|
+
Array.isArray(value.firstPartyTopics) &&
|
|
78
|
+
value.firstPartyTopics.every(isFirstPartyDocsTopicSummary) &&
|
|
79
|
+
Array.isArray(value.extensionTopics) &&
|
|
80
|
+
value.extensionTopics.every(isExtensionDocsTopicSummary) &&
|
|
81
|
+
Array.isArray(value.diagnostics) &&
|
|
82
|
+
value.diagnostics.every(isDocsDiscoveryDiagnostic));
|
|
83
|
+
}
|
|
84
|
+
export function isDocsDiscoverResult(value) {
|
|
85
|
+
return (isRecord(value) &&
|
|
86
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.DOCS, OPENWAGGLE_EXTENSION_BROKER.METHOD.DISCOVER_DOCS) &&
|
|
87
|
+
isDocsDiscoveryView(value.docs));
|
|
88
|
+
}
|
|
89
|
+
export function isDocsResolveTopicResult(value) {
|
|
90
|
+
return (isRecord(value) &&
|
|
91
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.DOCS, OPENWAGGLE_EXTENSION_BROKER.METHOD.RESOLVE_DOCS_TOPIC) &&
|
|
92
|
+
(value.resolvedTopic === null || isFirstPartyDocsTopicSummary(value.resolvedTopic)));
|
|
93
|
+
}
|
package/dist/docs.d.ts
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import type { SchemaType } from './schema.js';
|
|
3
|
+
export declare const firstPartyDocTopicSchema: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
4
|
+
export declare const extensionDocsDiscoverPayloadSchema: Schema.Struct<{
|
|
5
|
+
projectPaths: Schema.optional<Schema.Array$<Schema.filter<typeof Schema.String>>>;
|
|
6
|
+
includeExtensions: Schema.optional<typeof Schema.Boolean>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const extensionDocsResolveTopicPayloadSchema: Schema.Struct<{
|
|
9
|
+
topic: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const docsDiscoveryDiagnosticSchema: Schema.Struct<{
|
|
12
|
+
severity: Schema.Literal<["warning", "error"]>;
|
|
13
|
+
code: Schema.filter<typeof Schema.String>;
|
|
14
|
+
message: Schema.filter<typeof Schema.String>;
|
|
15
|
+
path: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const firstPartyDocsTopicSummarySchema: Schema.Struct<{
|
|
18
|
+
topic: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
19
|
+
source: Schema.Literal<["openwaggle", "pi"]>;
|
|
20
|
+
group: Schema.filter<typeof Schema.String>;
|
|
21
|
+
title: Schema.filter<typeof Schema.String>;
|
|
22
|
+
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
23
|
+
section: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
24
|
+
order: typeof Schema.Number;
|
|
25
|
+
path: Schema.filter<typeof Schema.String>;
|
|
26
|
+
bundlePath: Schema.filter<typeof Schema.String>;
|
|
27
|
+
sourcePath: Schema.filter<typeof Schema.String>;
|
|
28
|
+
aliases: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
29
|
+
keywords: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
30
|
+
contentHash: Schema.filter<typeof Schema.String>;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const extensionDocsPackageScopeViewSchema: Schema.Struct<{
|
|
33
|
+
kind: Schema.Literal<["global", "project"]>;
|
|
34
|
+
label: Schema.filter<typeof Schema.String>;
|
|
35
|
+
projectPath: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const extensionDocsProvenanceSchema: Schema.Struct<{
|
|
38
|
+
extensionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
39
|
+
extensionName: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
40
|
+
extensionVersion: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
41
|
+
scope: Schema.Struct<{
|
|
42
|
+
kind: Schema.Literal<["global", "project"]>;
|
|
43
|
+
label: Schema.filter<typeof Schema.String>;
|
|
44
|
+
projectPath: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
45
|
+
}>;
|
|
46
|
+
packagePath: Schema.filter<typeof Schema.String>;
|
|
47
|
+
manifestPath: Schema.filter<typeof Schema.String>;
|
|
48
|
+
path: Schema.filter<typeof Schema.String>;
|
|
49
|
+
packageContentHash: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
50
|
+
trust: Schema.Literal<["trusted", "untrusted", "unknown"]>;
|
|
51
|
+
lifecycle: Schema.Literal<["enabled", "disabled", "unavailable"]>;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const extensionDocsTopicSummarySchema: Schema.Struct<{
|
|
54
|
+
topic: Schema.filter<typeof Schema.String>;
|
|
55
|
+
localTopic: Schema.filter<typeof Schema.String>;
|
|
56
|
+
title: Schema.filter<typeof Schema.String>;
|
|
57
|
+
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
58
|
+
path: Schema.filter<typeof Schema.String>;
|
|
59
|
+
aliases: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
60
|
+
keywords: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
61
|
+
contentHash: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
62
|
+
provenance: Schema.Struct<{
|
|
63
|
+
extensionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
64
|
+
extensionName: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
65
|
+
extensionVersion: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
66
|
+
scope: Schema.Struct<{
|
|
67
|
+
kind: Schema.Literal<["global", "project"]>;
|
|
68
|
+
label: Schema.filter<typeof Schema.String>;
|
|
69
|
+
projectPath: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
70
|
+
}>;
|
|
71
|
+
packagePath: Schema.filter<typeof Schema.String>;
|
|
72
|
+
manifestPath: Schema.filter<typeof Schema.String>;
|
|
73
|
+
path: Schema.filter<typeof Schema.String>;
|
|
74
|
+
packageContentHash: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
75
|
+
trust: Schema.Literal<["trusted", "untrusted", "unknown"]>;
|
|
76
|
+
lifecycle: Schema.Literal<["enabled", "disabled", "unavailable"]>;
|
|
77
|
+
}>;
|
|
78
|
+
diagnostics: Schema.Array$<Schema.Struct<{
|
|
79
|
+
severity: Schema.Literal<["warning", "error"]>;
|
|
80
|
+
code: Schema.filter<typeof Schema.String>;
|
|
81
|
+
message: Schema.filter<typeof Schema.String>;
|
|
82
|
+
path: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
83
|
+
}>>;
|
|
84
|
+
}>;
|
|
85
|
+
export declare const docsDiscoveryViewSchema: Schema.Struct<{
|
|
86
|
+
generatedAt: Schema.filter<typeof Schema.String>;
|
|
87
|
+
bundlePath: Schema.filter<typeof Schema.String>;
|
|
88
|
+
firstPartyTopics: Schema.Array$<Schema.Struct<{
|
|
89
|
+
topic: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
90
|
+
source: Schema.Literal<["openwaggle", "pi"]>;
|
|
91
|
+
group: Schema.filter<typeof Schema.String>;
|
|
92
|
+
title: Schema.filter<typeof Schema.String>;
|
|
93
|
+
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
94
|
+
section: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
95
|
+
order: typeof Schema.Number;
|
|
96
|
+
path: Schema.filter<typeof Schema.String>;
|
|
97
|
+
bundlePath: Schema.filter<typeof Schema.String>;
|
|
98
|
+
sourcePath: Schema.filter<typeof Schema.String>;
|
|
99
|
+
aliases: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
100
|
+
keywords: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
101
|
+
contentHash: Schema.filter<typeof Schema.String>;
|
|
102
|
+
}>>;
|
|
103
|
+
extensionTopics: Schema.Array$<Schema.Struct<{
|
|
104
|
+
topic: Schema.filter<typeof Schema.String>;
|
|
105
|
+
localTopic: Schema.filter<typeof Schema.String>;
|
|
106
|
+
title: Schema.filter<typeof Schema.String>;
|
|
107
|
+
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
108
|
+
path: Schema.filter<typeof Schema.String>;
|
|
109
|
+
aliases: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
110
|
+
keywords: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
111
|
+
contentHash: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
112
|
+
provenance: Schema.Struct<{
|
|
113
|
+
extensionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
114
|
+
extensionName: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
115
|
+
extensionVersion: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
116
|
+
scope: Schema.Struct<{
|
|
117
|
+
kind: Schema.Literal<["global", "project"]>;
|
|
118
|
+
label: Schema.filter<typeof Schema.String>;
|
|
119
|
+
projectPath: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
120
|
+
}>;
|
|
121
|
+
packagePath: Schema.filter<typeof Schema.String>;
|
|
122
|
+
manifestPath: Schema.filter<typeof Schema.String>;
|
|
123
|
+
path: Schema.filter<typeof Schema.String>;
|
|
124
|
+
packageContentHash: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
125
|
+
trust: Schema.Literal<["trusted", "untrusted", "unknown"]>;
|
|
126
|
+
lifecycle: Schema.Literal<["enabled", "disabled", "unavailable"]>;
|
|
127
|
+
}>;
|
|
128
|
+
diagnostics: Schema.Array$<Schema.Struct<{
|
|
129
|
+
severity: Schema.Literal<["warning", "error"]>;
|
|
130
|
+
code: Schema.filter<typeof Schema.String>;
|
|
131
|
+
message: Schema.filter<typeof Schema.String>;
|
|
132
|
+
path: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
133
|
+
}>>;
|
|
134
|
+
}>>;
|
|
135
|
+
diagnostics: Schema.Array$<Schema.Struct<{
|
|
136
|
+
severity: Schema.Literal<["warning", "error"]>;
|
|
137
|
+
code: Schema.filter<typeof Schema.String>;
|
|
138
|
+
message: Schema.filter<typeof Schema.String>;
|
|
139
|
+
path: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
140
|
+
}>>;
|
|
141
|
+
}>;
|
|
142
|
+
export declare const extensionDocsDiscoverResultSchema: Schema.Struct<{
|
|
143
|
+
extensionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
144
|
+
contributionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
145
|
+
capability: Schema.Literal<["openwaggle.docs"]>;
|
|
146
|
+
method: Schema.Literal<["discover-docs"]>;
|
|
147
|
+
docs: Schema.Struct<{
|
|
148
|
+
generatedAt: Schema.filter<typeof Schema.String>;
|
|
149
|
+
bundlePath: Schema.filter<typeof Schema.String>;
|
|
150
|
+
firstPartyTopics: Schema.Array$<Schema.Struct<{
|
|
151
|
+
topic: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
152
|
+
source: Schema.Literal<["openwaggle", "pi"]>;
|
|
153
|
+
group: Schema.filter<typeof Schema.String>;
|
|
154
|
+
title: Schema.filter<typeof Schema.String>;
|
|
155
|
+
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
156
|
+
section: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
157
|
+
order: typeof Schema.Number;
|
|
158
|
+
path: Schema.filter<typeof Schema.String>;
|
|
159
|
+
bundlePath: Schema.filter<typeof Schema.String>;
|
|
160
|
+
sourcePath: Schema.filter<typeof Schema.String>;
|
|
161
|
+
aliases: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
162
|
+
keywords: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
163
|
+
contentHash: Schema.filter<typeof Schema.String>;
|
|
164
|
+
}>>;
|
|
165
|
+
extensionTopics: Schema.Array$<Schema.Struct<{
|
|
166
|
+
topic: Schema.filter<typeof Schema.String>;
|
|
167
|
+
localTopic: Schema.filter<typeof Schema.String>;
|
|
168
|
+
title: Schema.filter<typeof Schema.String>;
|
|
169
|
+
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
170
|
+
path: Schema.filter<typeof Schema.String>;
|
|
171
|
+
aliases: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
172
|
+
keywords: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
173
|
+
contentHash: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
174
|
+
provenance: Schema.Struct<{
|
|
175
|
+
extensionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
176
|
+
extensionName: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
177
|
+
extensionVersion: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
178
|
+
scope: Schema.Struct<{
|
|
179
|
+
kind: Schema.Literal<["global", "project"]>;
|
|
180
|
+
label: Schema.filter<typeof Schema.String>;
|
|
181
|
+
projectPath: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
182
|
+
}>;
|
|
183
|
+
packagePath: Schema.filter<typeof Schema.String>;
|
|
184
|
+
manifestPath: Schema.filter<typeof Schema.String>;
|
|
185
|
+
path: Schema.filter<typeof Schema.String>;
|
|
186
|
+
packageContentHash: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
187
|
+
trust: Schema.Literal<["trusted", "untrusted", "unknown"]>;
|
|
188
|
+
lifecycle: Schema.Literal<["enabled", "disabled", "unavailable"]>;
|
|
189
|
+
}>;
|
|
190
|
+
diagnostics: Schema.Array$<Schema.Struct<{
|
|
191
|
+
severity: Schema.Literal<["warning", "error"]>;
|
|
192
|
+
code: Schema.filter<typeof Schema.String>;
|
|
193
|
+
message: Schema.filter<typeof Schema.String>;
|
|
194
|
+
path: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
195
|
+
}>>;
|
|
196
|
+
}>>;
|
|
197
|
+
diagnostics: Schema.Array$<Schema.Struct<{
|
|
198
|
+
severity: Schema.Literal<["warning", "error"]>;
|
|
199
|
+
code: Schema.filter<typeof Schema.String>;
|
|
200
|
+
message: Schema.filter<typeof Schema.String>;
|
|
201
|
+
path: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
202
|
+
}>>;
|
|
203
|
+
}>;
|
|
204
|
+
}>;
|
|
205
|
+
export declare const extensionDocsResolveTopicResultSchema: Schema.Struct<{
|
|
206
|
+
extensionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
207
|
+
contributionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
208
|
+
capability: Schema.Literal<["openwaggle.docs"]>;
|
|
209
|
+
method: Schema.Literal<["resolve-docs-topic"]>;
|
|
210
|
+
resolvedTopic: Schema.NullOr<Schema.Struct<{
|
|
211
|
+
topic: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
212
|
+
source: Schema.Literal<["openwaggle", "pi"]>;
|
|
213
|
+
group: Schema.filter<typeof Schema.String>;
|
|
214
|
+
title: Schema.filter<typeof Schema.String>;
|
|
215
|
+
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
216
|
+
section: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
217
|
+
order: typeof Schema.Number;
|
|
218
|
+
path: Schema.filter<typeof Schema.String>;
|
|
219
|
+
bundlePath: Schema.filter<typeof Schema.String>;
|
|
220
|
+
sourcePath: Schema.filter<typeof Schema.String>;
|
|
221
|
+
aliases: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
222
|
+
keywords: Schema.Array$<Schema.filter<typeof Schema.String>>;
|
|
223
|
+
contentHash: Schema.filter<typeof Schema.String>;
|
|
224
|
+
}>>;
|
|
225
|
+
}>;
|
|
226
|
+
export type ExtensionDocsDiscoverPayload = SchemaType<typeof extensionDocsDiscoverPayloadSchema>;
|
|
227
|
+
export type ExtensionDocsResolveTopicPayload = SchemaType<typeof extensionDocsResolveTopicPayloadSchema>;
|
|
228
|
+
export type ExtensionDocsDiscoverResult = SchemaType<typeof extensionDocsDiscoverResultSchema>;
|
|
229
|
+
export type ExtensionDocsResolveTopicResult = SchemaType<typeof extensionDocsResolveTopicResultSchema>;
|
|
230
|
+
export type ExtensionDocsDiscoveryView = SchemaType<typeof docsDiscoveryViewSchema>;
|
|
231
|
+
export type FirstPartyDocsTopicSummary = SchemaType<typeof firstPartyDocsTopicSummarySchema>;
|
package/dist/docs.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { OPENWAGGLE_EXTENSION, OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
3
|
+
import { extensionContributionIdSchema, extensionIdSchema } from './manifest.js';
|
|
4
|
+
const nonEmptyStringSchema = Schema.String.pipe(Schema.minLength(1));
|
|
5
|
+
const EXTENSION_TOPIC_PREFIX = 'extension:';
|
|
6
|
+
export const firstPartyDocTopicSchema = nonEmptyStringSchema.pipe(Schema.filter((value) => !value.startsWith(EXTENSION_TOPIC_PREFIX) ||
|
|
7
|
+
'Extension docs topics must be resolved through extension docs discovery.'));
|
|
8
|
+
export const extensionDocsDiscoverPayloadSchema = Schema.Struct({
|
|
9
|
+
projectPaths: Schema.optional(Schema.Array(nonEmptyStringSchema)),
|
|
10
|
+
includeExtensions: Schema.optional(Schema.Boolean),
|
|
11
|
+
});
|
|
12
|
+
export const extensionDocsResolveTopicPayloadSchema = Schema.Struct({
|
|
13
|
+
topic: firstPartyDocTopicSchema,
|
|
14
|
+
});
|
|
15
|
+
export const docsDiscoveryDiagnosticSchema = Schema.Struct({
|
|
16
|
+
severity: Schema.Literal('warning', 'error'),
|
|
17
|
+
code: nonEmptyStringSchema,
|
|
18
|
+
message: nonEmptyStringSchema,
|
|
19
|
+
path: Schema.optional(nonEmptyStringSchema),
|
|
20
|
+
});
|
|
21
|
+
export const firstPartyDocsTopicSummarySchema = Schema.Struct({
|
|
22
|
+
topic: firstPartyDocTopicSchema,
|
|
23
|
+
source: Schema.Literal('openwaggle', 'pi'),
|
|
24
|
+
group: nonEmptyStringSchema,
|
|
25
|
+
title: nonEmptyStringSchema,
|
|
26
|
+
description: Schema.optional(nonEmptyStringSchema),
|
|
27
|
+
section: Schema.optional(nonEmptyStringSchema),
|
|
28
|
+
order: Schema.Number,
|
|
29
|
+
path: nonEmptyStringSchema,
|
|
30
|
+
bundlePath: nonEmptyStringSchema,
|
|
31
|
+
sourcePath: nonEmptyStringSchema,
|
|
32
|
+
aliases: Schema.Array(nonEmptyStringSchema),
|
|
33
|
+
keywords: Schema.Array(nonEmptyStringSchema),
|
|
34
|
+
contentHash: nonEmptyStringSchema,
|
|
35
|
+
});
|
|
36
|
+
export const extensionDocsPackageScopeViewSchema = Schema.Struct({
|
|
37
|
+
kind: Schema.Literal(OPENWAGGLE_EXTENSION.SCOPE.GLOBAL_KIND, OPENWAGGLE_EXTENSION.SCOPE.PROJECT_KIND),
|
|
38
|
+
label: nonEmptyStringSchema,
|
|
39
|
+
projectPath: Schema.optional(nonEmptyStringSchema),
|
|
40
|
+
});
|
|
41
|
+
export const extensionDocsProvenanceSchema = Schema.Struct({
|
|
42
|
+
extensionId: extensionIdSchema,
|
|
43
|
+
extensionName: Schema.NullOr(nonEmptyStringSchema),
|
|
44
|
+
extensionVersion: Schema.NullOr(nonEmptyStringSchema),
|
|
45
|
+
scope: extensionDocsPackageScopeViewSchema,
|
|
46
|
+
packagePath: nonEmptyStringSchema,
|
|
47
|
+
manifestPath: nonEmptyStringSchema,
|
|
48
|
+
path: nonEmptyStringSchema,
|
|
49
|
+
packageContentHash: Schema.NullOr(nonEmptyStringSchema),
|
|
50
|
+
trust: Schema.Literal('trusted', 'untrusted', 'unknown'),
|
|
51
|
+
lifecycle: Schema.Literal('enabled', 'disabled', 'unavailable'),
|
|
52
|
+
});
|
|
53
|
+
export const extensionDocsTopicSummarySchema = Schema.Struct({
|
|
54
|
+
topic: nonEmptyStringSchema,
|
|
55
|
+
localTopic: nonEmptyStringSchema,
|
|
56
|
+
title: nonEmptyStringSchema,
|
|
57
|
+
description: Schema.optional(nonEmptyStringSchema),
|
|
58
|
+
path: nonEmptyStringSchema,
|
|
59
|
+
aliases: Schema.Array(nonEmptyStringSchema),
|
|
60
|
+
keywords: Schema.Array(nonEmptyStringSchema),
|
|
61
|
+
contentHash: Schema.NullOr(nonEmptyStringSchema),
|
|
62
|
+
provenance: extensionDocsProvenanceSchema,
|
|
63
|
+
diagnostics: Schema.Array(docsDiscoveryDiagnosticSchema),
|
|
64
|
+
});
|
|
65
|
+
export const docsDiscoveryViewSchema = Schema.Struct({
|
|
66
|
+
generatedAt: nonEmptyStringSchema,
|
|
67
|
+
bundlePath: nonEmptyStringSchema,
|
|
68
|
+
firstPartyTopics: Schema.Array(firstPartyDocsTopicSummarySchema),
|
|
69
|
+
extensionTopics: Schema.Array(extensionDocsTopicSummarySchema),
|
|
70
|
+
diagnostics: Schema.Array(docsDiscoveryDiagnosticSchema),
|
|
71
|
+
});
|
|
72
|
+
export const extensionDocsDiscoverResultSchema = Schema.Struct({
|
|
73
|
+
extensionId: extensionIdSchema,
|
|
74
|
+
contributionId: extensionContributionIdSchema,
|
|
75
|
+
capability: Schema.Literal(OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.DOCS),
|
|
76
|
+
method: Schema.Literal(OPENWAGGLE_EXTENSION_BROKER.METHOD.DISCOVER_DOCS),
|
|
77
|
+
docs: docsDiscoveryViewSchema,
|
|
78
|
+
});
|
|
79
|
+
export const extensionDocsResolveTopicResultSchema = Schema.Struct({
|
|
80
|
+
extensionId: extensionIdSchema,
|
|
81
|
+
contributionId: extensionContributionIdSchema,
|
|
82
|
+
capability: Schema.Literal(OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.DOCS),
|
|
83
|
+
method: Schema.Literal(OPENWAGGLE_EXTENSION_BROKER.METHOD.RESOLVE_DOCS_TOPIC),
|
|
84
|
+
resolvedTopic: Schema.NullOr(firstPartyDocsTopicSummarySchema),
|
|
85
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './agent-loop.js';
|
|
2
|
+
export type * from './broker.js';
|
|
3
|
+
export { createExtensionBrokerSdk, createExtensionBrokerSdkFromInvoke, extensionCapabilityAuditEntrySchema, extensionInvokeErrorSchema, extensionInvokeFailureSchema, extensionInvokeInputSchema, extensionInvokeResultSchema, extensionInvokeScopeSchema, extensionInvokeSuccessSchema, toInvokeInput, } from './broker.js';
|
|
4
|
+
export { OPENWAGGLE_EXTENSION, OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
5
|
+
export type * from './context.js';
|
|
6
|
+
export { createNoopExtensionSurfaceSdk, createOpenWaggleExtensionSharedModules, createOpenWaggleExtensionSurfaceContext, } from './context.js';
|
|
7
|
+
export * from './docs.js';
|
|
8
|
+
export { type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, jsonPrimitiveSchema, jsonValueSchema, } from './json.js';
|
|
9
|
+
export * from './manifest.js';
|
|
10
|
+
export { createRuntimeContributionSdk, extensionRuntimeRegisterContributionResultSchema, extensionRuntimeUnregisterContributionResultSchema, } from './runtime.js';
|
|
11
|
+
export type * from './theme.js';
|
|
12
|
+
export { createOpenWaggleExtensionTheme, extensionThemeCssVariableEntries, isOpenWaggleExtensionTheme, OPENWAGGLE_EXTENSION_THEME_CSS_VARIABLES, } from './theme.js';
|
|
13
|
+
export type * from './types.js';
|
|
14
|
+
export type * from './ui.js';
|
|
15
|
+
export { createOpenWaggleExtensionUiStylesheet, extensionThemeCssVariableDeclarations, OPENWAGGLE_EXTENSION_UI_ATTRIBUTES, OPENWAGGLE_EXTENSION_UI_CLASS_NAMES, openWaggleExtensionClassName, } from './ui.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './agent-loop.js';
|
|
2
|
+
export { createExtensionBrokerSdk, createExtensionBrokerSdkFromInvoke, extensionCapabilityAuditEntrySchema, extensionInvokeErrorSchema, extensionInvokeFailureSchema, extensionInvokeInputSchema, extensionInvokeResultSchema, extensionInvokeScopeSchema, extensionInvokeSuccessSchema, toInvokeInput, } from './broker.js';
|
|
3
|
+
export { OPENWAGGLE_EXTENSION, OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
4
|
+
export { createNoopExtensionSurfaceSdk, createOpenWaggleExtensionSharedModules, createOpenWaggleExtensionSurfaceContext, } from './context.js';
|
|
5
|
+
export * from './docs.js';
|
|
6
|
+
export { jsonPrimitiveSchema, jsonValueSchema, } from './json.js';
|
|
7
|
+
export * from './manifest.js';
|
|
8
|
+
export { createRuntimeContributionSdk, extensionRuntimeRegisterContributionResultSchema, extensionRuntimeUnregisterContributionResultSchema, } from './runtime.js';
|
|
9
|
+
export { createOpenWaggleExtensionTheme, extensionThemeCssVariableEntries, isOpenWaggleExtensionTheme, OPENWAGGLE_EXTENSION_THEME_CSS_VARIABLES, } from './theme.js';
|
|
10
|
+
export { createOpenWaggleExtensionUiStylesheet, extensionThemeCssVariableDeclarations, OPENWAGGLE_EXTENSION_UI_ATTRIBUTES, OPENWAGGLE_EXTENSION_UI_CLASS_NAMES, openWaggleExtensionClassName, } from './ui.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function isRecord(value: unknown): value is Readonly<Record<string, unknown>>;
|
|
2
|
+
export declare function isNonEmptyString(value: unknown): value is string;
|
|
3
|
+
export declare function isStringArray(value: unknown): value is readonly string[];
|
|
4
|
+
export declare function isJsonValue(value: unknown): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function isRecord(value) {
|
|
2
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
3
|
+
}
|
|
4
|
+
export function isNonEmptyString(value) {
|
|
5
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
6
|
+
}
|
|
7
|
+
export function isStringArray(value) {
|
|
8
|
+
return Array.isArray(value) && value.every((item) => typeof item === 'string');
|
|
9
|
+
}
|
|
10
|
+
export function isJsonValue(value) {
|
|
11
|
+
if (value === null ||
|
|
12
|
+
typeof value === 'string' ||
|
|
13
|
+
typeof value === 'boolean' ||
|
|
14
|
+
typeof value === 'number') {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(value)) {
|
|
18
|
+
return value.every(isJsonValue);
|
|
19
|
+
}
|
|
20
|
+
if (!isRecord(value)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return Object.values(value).every(isJsonValue);
|
|
24
|
+
}
|
package/dist/json.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
3
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
4
|
+
export interface JsonObject {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
}
|
|
7
|
+
export type JsonArray = JsonValue[];
|
|
8
|
+
export declare const jsonPrimitiveSchema: Schema.Union<[typeof Schema.String, typeof Schema.Number, typeof Schema.Boolean, typeof Schema.Null]>;
|
|
9
|
+
export declare const jsonValueSchema: Schema.Schema<JsonValue>;
|
package/dist/json.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
export const jsonPrimitiveSchema = Schema.Union(Schema.String, Schema.Number, Schema.Boolean, Schema.Null);
|
|
3
|
+
export const jsonValueSchema = Schema.suspend(() => Schema.Union(jsonPrimitiveSchema, Schema.mutable(Schema.Array(jsonValueSchema)), Schema.mutable(Schema.Record({ key: Schema.String, value: jsonValueSchema }))));
|