@jini-ai/plugins 0.7.3-next.1 → 0.7.3-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/host/capability-tools.d.ts +1 -0
- package/dist/host/capability-tools.js +4 -4
- package/dist/host/manifest.js +2 -2
- package/dist/host/node/discovery.js +1 -1
- package/dist/host/node/install.js +2 -2
- package/dist/host/node/runtime-contracts.d.ts +1 -0
- package/dist/host/ports.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -289,6 +289,7 @@ export interface PluginCapabilitySourceDeps {
|
|
|
289
289
|
export interface PluginCapabilityToolsRequired<TPost extends PluginCapabilityPost, TDraft, TFamily extends string> {
|
|
290
290
|
/** @agent-note Namespace passed to `readPluginIdentity` for the discovery terms. */
|
|
291
291
|
readonly identityNamespace: string;
|
|
292
|
+
readonly legacyIdentityNamespace?: string | undefined;
|
|
292
293
|
/** The host SDK's before-save hook id (the same id its `PluginSdkBinding.hookIds` admits and its
|
|
293
294
|
* invocation binding receives as `beforeSaveHook`).
|
|
294
295
|
* @agent-note Second-host rule: required, no default. A tier-2 plugin whose manifest `hooks`
|
|
@@ -56,8 +56,8 @@ function decodeFieldValue(value) {
|
|
|
56
56
|
* @param _optional Reserved; pass `{}`.
|
|
57
57
|
*/
|
|
58
58
|
export function createPluginCapabilityTools(required, _optional = {}) {
|
|
59
|
-
const { identityNamespace, beforeSaveHook, text, catalog, access, executableAccess, approvalFamily, toPreviewDraft } = required;
|
|
60
|
-
const host = { identityNamespace, beforeSaveHook, text, catalog, access, executableAccess, approvalFamily, toPreviewDraft };
|
|
59
|
+
const { identityNamespace, legacyIdentityNamespace, beforeSaveHook, text, catalog, access, executableAccess, approvalFamily, toPreviewDraft } = required;
|
|
60
|
+
const host = { identityNamespace, legacyIdentityNamespace, beforeSaveHook, text, catalog, access, executableAccess, approvalFamily, toPreviewDraft };
|
|
61
61
|
return {
|
|
62
62
|
loadSources: (deps) => loadEnabledPluginCapabilityToolSources(host, deps),
|
|
63
63
|
buildRegistrations: (args) => buildPluginCapabilityToolRegistrations(host, args),
|
|
@@ -98,8 +98,8 @@ function buildFieldSources(host, manifest) {
|
|
|
98
98
|
* call it and what an empty result means.
|
|
99
99
|
*/
|
|
100
100
|
function buildCapabilityToolDescription(host, manifest, fields) {
|
|
101
|
-
const { identityNamespace, beforeSaveHook, text } = host;
|
|
102
|
-
const identity = readPluginIdentity({ manifest: manifest, name: manifest.id, namespace: identityNamespace });
|
|
101
|
+
const { identityNamespace, legacyIdentityNamespace, beforeSaveHook, text } = host;
|
|
102
|
+
const identity = readPluginIdentity({ manifest: manifest, name: manifest.id, namespace: identityNamespace, legacyNamespace: legacyIdentityNamespace });
|
|
103
103
|
const fieldText = fields.map((field) => field.description).join(" ") + text.discovery({ terms: [identity.id, ...identity.keywords, ...identity.provides].join(" ") });
|
|
104
104
|
if (runsFreshFor(manifest, beforeSaveHook)) {
|
|
105
105
|
return text.freshDescription({ pluginName: manifest.name, fieldText });
|
package/dist/host/manifest.js
CHANGED
|
@@ -374,7 +374,7 @@ export function validateManifest(required, _optional = {}) {
|
|
|
374
374
|
const { errors: idErrors, id } = validateId(raw, folderName, builtInIds, required.coreOwnerName);
|
|
375
375
|
const errors = [
|
|
376
376
|
...validateKeys(raw),
|
|
377
|
-
...validatePluginIdentity({ manifest: raw, namespace: required.identityNamespace }).errors.map(message => ({ code: "PLUGIN_IDENTITY_INVALID", file: null, message })),
|
|
377
|
+
...validatePluginIdentity({ manifest: raw, namespace: required.identityNamespace, legacyNamespace: required.legacyIdentityNamespace }).errors.map(message => ({ code: "PLUGIN_IDENTITY_INVALID", file: null, message })),
|
|
378
378
|
...idErrors,
|
|
379
379
|
...validateIdentityFields(raw),
|
|
380
380
|
...validateEngine(raw),
|
|
@@ -388,7 +388,7 @@ export function validateManifest(required, _optional = {}) {
|
|
|
388
388
|
...required.declarativeContentTypes.validateManifest({ manifest: raw }).errors,
|
|
389
389
|
];
|
|
390
390
|
const warnings = errors.length === 0
|
|
391
|
-
? readPluginIdentity({ manifest: raw, name: id, namespace: required.identityNamespace }).warnings
|
|
391
|
+
? readPluginIdentity({ manifest: raw, name: id, namespace: required.identityNamespace, legacyNamespace: required.legacyIdentityNamespace }).warnings
|
|
392
392
|
: [];
|
|
393
393
|
return { errors, warnings };
|
|
394
394
|
}
|
|
@@ -289,7 +289,7 @@ export async function discoverPlugins(required, optional = {}) {
|
|
|
289
289
|
return records.map(record => {
|
|
290
290
|
if (record.status !== "valid" || !record.manifest)
|
|
291
291
|
return record;
|
|
292
|
-
const identity = readPluginIdentity({ manifest: record.manifest, name: record.id, namespace: required.identityNamespace });
|
|
292
|
+
const identity = readPluginIdentity({ manifest: record.manifest, name: record.id, namespace: required.identityNamespace, legacyNamespace: required.legacyIdentityNamespace });
|
|
293
293
|
if (!qualifiedIds.has(identity.id)) {
|
|
294
294
|
qualifiedIds.add(identity.id);
|
|
295
295
|
return { ...record, warnings: identity.warnings };
|
|
@@ -185,7 +185,7 @@ function validatePackage(files, deps) {
|
|
|
185
185
|
return candidate;
|
|
186
186
|
}
|
|
187
187
|
function identityOf(manifest, deps, name = manifest.id) {
|
|
188
|
-
return readPluginIdentity({ manifest: manifest, name, namespace: deps.identityNamespace });
|
|
188
|
+
return readPluginIdentity({ manifest: manifest, name, namespace: deps.identityNamespace, legacyNamespace: deps.legacyIdentityNamespace });
|
|
189
189
|
}
|
|
190
190
|
function assertIdentityFree(candidate, installed) {
|
|
191
191
|
try {
|
|
@@ -250,7 +250,7 @@ async function readInstalledIdentity(required) {
|
|
|
250
250
|
if (!manifestInfo.isFile() || manifestInfo.isSymbolicLink())
|
|
251
251
|
fail("PLUGIN_PACKAGE_UNSAFE", "Installed plugin manifests must not be links.");
|
|
252
252
|
const installedManifest = JSON.parse(await scan.readFile(manifestPath, "utf8"));
|
|
253
|
-
return readPluginIdentity({ manifest: installedManifest, name: localId, namespace: deps.identityNamespace });
|
|
253
|
+
return readPluginIdentity({ manifest: installedManifest, name: localId, namespace: deps.identityNamespace, legacyNamespace: deps.legacyIdentityNamespace });
|
|
254
254
|
}
|
|
255
255
|
catch (error) {
|
|
256
256
|
if (error instanceof PluginInstallError)
|
|
@@ -121,6 +121,7 @@ export interface PluginRuntimeHostBinding {
|
|
|
121
121
|
readonly declarativeContentTypes: DeclarativeContentTypesPort;
|
|
122
122
|
readonly coreOwnerName: string;
|
|
123
123
|
readonly identityNamespace: string;
|
|
124
|
+
readonly legacyIdentityNamespace?: string;
|
|
124
125
|
readonly localInstallDisabledMessage: string;
|
|
125
126
|
readonly tierPolicy: PluginTierPolicy;
|
|
126
127
|
readonly archiveReader: ArchiveReaderPort;
|
package/dist/host/ports.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export interface DeclarativeContentTypesPort {
|
|
|
76
76
|
export interface ManifestHostPorts<H extends HookPoints = HookPoints> {
|
|
77
77
|
/** Host-owned namespace containing publisher id/provides in persisted manifest extensions. */
|
|
78
78
|
readonly identityNamespace: string;
|
|
79
|
+
readonly legacyIdentityNamespace?: string;
|
|
79
80
|
readonly pluginSdkBinding: PluginSdkBinding<H>;
|
|
80
81
|
readonly capabilityVocabulary: readonly string[];
|
|
81
82
|
readonly declarativeContentTypes: DeclarativeContentTypesPort;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/plugins",
|
|
3
|
-
"version": "0.7.3-next.
|
|
3
|
+
"version": "0.7.3-next.2",
|
|
4
4
|
"description": "Host-independent extension glue and site-plugin runtime with injected SDK, trust, archive and storage ports.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"registry": "https://registry.npmjs.org"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@jini-ai/core": "^0.7.3-next.
|
|
86
|
+
"@jini-ai/core": "^0.7.3-next.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"semver": "^7.6.2",
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
"semver": "^7.6.2",
|
|
94
94
|
"@types/semver": "^7.5.8",
|
|
95
95
|
"kysely": "^0.29.6",
|
|
96
|
-
"@jini-ai/
|
|
97
|
-
"@jini-ai/
|
|
98
|
-
"@jini-ai/
|
|
96
|
+
"@jini-ai/platform": "^0.7.3-next.2",
|
|
97
|
+
"@jini-ai/core": "^0.7.3-next.2",
|
|
98
|
+
"@jini-ai/db": "0.7.3-next.2"
|
|
99
99
|
},
|
|
100
100
|
"peerDependenciesMeta": {
|
|
101
101
|
"semver": {
|