@noodleseed/one 0.164.0 → 0.165.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/dist/commands/solutions-coordination.d.ts +5 -0
- package/dist/commands/solutions-coordination.d.ts.map +1 -0
- package/dist/commands/solutions-coordination.js +94 -0
- package/dist/commands/solutions-coordination.js.map +1 -0
- package/dist/commands/solutions-ops.d.ts.map +1 -1
- package/dist/commands/solutions-ops.js +8 -4
- package/dist/commands/solutions-ops.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +2 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +3 -3
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +2 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +4 -1
- package/node_modules/@noodle-borg/assistant-gateway/dist/embed-store.d.ts +4 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/in-memory-embed-store.d.ts +4 -0
- package/node_modules/@noodle-borg/assistant-gateway/dist/in-memory-embed-store.js +6 -2
- package/node_modules/@noodle-borg/authoring/dist/config.d.ts +8 -2
- package/node_modules/@noodle-borg/authoring/dist/config.js +28 -1
- package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +37 -0
- package/node_modules/@noodle-borg/authoring/dist/connectors.js +4 -0
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js +1 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-flags.js +83 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solutions.js +70 -92
- package/node_modules/@noodle-borg/compiler/dist/artifact/operation-ref.d.ts +2 -0
- package/node_modules/@noodle-borg/compiler/dist/artifact/version.d.ts +4 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/version.js +4 -1
- package/node_modules/@noodle-borg/compiler/dist/catalog/types.d.ts +7 -0
- package/node_modules/@noodle-borg/compiler/dist/errors.d.ts +1 -1
- package/node_modules/@noodle-borg/compiler/dist/fulfilment-emit.js +15 -2
- package/node_modules/@noodle-borg/compiler/dist/nested-operations.js +71 -0
- package/node_modules/@noodle-borg/compute/dist/code-connector.js +14 -2
- package/node_modules/@noodle-borg/compute/dist/deterministic-helpers.js +138 -0
- package/node_modules/@noodle-borg/compute/dist/quickjs-engine.js +48 -0
- package/node_modules/@noodle-borg/compute/dist/sandbox-eval.js +39 -5
- package/node_modules/@noodle-borg/compute/dist/worker-entry.js +7 -0
- package/node_modules/@noodle-borg/compute/dist/worker-pool.js +14 -3
- package/node_modules/@noodle-borg/connector-defs/dist/compile-http.js +31 -2
- package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/compile.js +20 -0
- package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts +84 -0
- package/node_modules/@noodle-borg/connector-defs/dist/schema.js +44 -1
- package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts +7 -0
- package/node_modules/@noodle-borg/connector-http/dist/http-connector.js +34 -6
- package/node_modules/@noodle-borg/connector-http/dist/http-response.d.ts +8 -1
- package/node_modules/@noodle-borg/connector-http/dist/http-response.js +19 -10
- package/node_modules/@noodle-borg/connector-http/dist/index.d.ts +1 -1
- package/node_modules/@noodle-borg/runtime/dist/connector/types.d.ts +7 -1
- package/node_modules/@noodle-borg/runtime/dist/connector-snapshot.js +8 -0
- package/node_modules/@noodle-borg/runtime/dist/execute.d.ts +2 -0
- package/node_modules/@noodle-borg/runtime/dist/index.d.ts +1 -0
- package/node_modules/@noodle-borg/runtime/dist/nested-operation-host.js +25 -0
- package/node_modules/@noodle-borg/runtime/dist/operation-coordination-execution.js +50 -0
- package/node_modules/@noodle-borg/runtime/dist/operation-coordination.d.ts +34 -0
- package/node_modules/@noodle-borg/runtime/dist/operation-evidence.d.ts +4 -0
- package/node_modules/@noodle-borg/runtime/dist/operation-execution.js +173 -94
- package/node_modules/@noodle-borg/service/dist/application-activity.js +152 -18
- package/node_modules/@noodle-borg/service/dist/application-runtime-target.js +15 -2
- package/node_modules/@noodle-borg/service/dist/business-information/definition-resolver.js +19 -0
- package/node_modules/@noodle-borg/service/dist/business-information/in-memory-store.js +1 -1
- package/node_modules/@noodle-borg/service/dist/business-information/managed-solution-blueprints.js +7 -0
- package/node_modules/@noodle-borg/service/dist/business-information/managed-solution-executable.js +11 -1
- package/node_modules/@noodle-borg/service/dist/business-information/model.js +2 -2
- package/node_modules/@noodle-borg/service/dist/business-information/portable.js +1 -1
- package/node_modules/@noodle-borg/service/dist/business-information/profiles.js +37 -1
- package/node_modules/@noodle-borg/service/dist/credential-binding-index.js +19 -1
- package/node_modules/@noodle-borg/service/dist/deployment-execution.js +1 -1
- package/node_modules/@noodle-borg/service/dist/operation-coordination.js +185 -0
- package/node_modules/@noodle-borg/service/dist/operation-evidence.js +3 -1
- package/node_modules/@noodle-borg/service/dist/routes/business-information-activity.js +48 -53
- package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +2 -1
- package/node_modules/@noodle-borg/service/dist/routes/business-information-installation.js +51 -17
- package/node_modules/@noodle-borg/service/dist/routes/business-information-paths.js +6 -4
- package/node_modules/@noodle-borg/service/dist/routes/business-information-staff.js +4 -3
- package/node_modules/@noodle-borg/service/dist/routes/business-information.js +11 -6
- package/node_modules/@noodle-borg/service/dist/routes/deploy-public-embed.js +7 -2
- package/node_modules/@noodle-borg/service/dist/service.js +2 -1
- package/node_modules/@noodle-borg/service/dist/solution-installation-activation.js +58 -3
- package/node_modules/@noodle-borg/wire-contracts/dist/business-information.d.ts +52 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/business-information.js +6 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +1 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.js +1 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/operation-coordination.d.ts +59 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/operation-coordination.js +51 -0
- package/package.json +1 -1
|
@@ -3,8 +3,9 @@ import { readJsonBody, sendJson } from '@noodle-borg/transport-http';
|
|
|
3
3
|
import { BusinessInvitationCreateRequestSchema, BusinessInvitationRevokeRequestSchema, formatWireError, } from '@noodle-borg/wire-contracts';
|
|
4
4
|
import { hashToken } from '../oauth/tokens.js';
|
|
5
5
|
import { requireIdentity, requireInstallationPermission, } from './business-information.js';
|
|
6
|
+
import { installationProjection } from './business-information-installation.js';
|
|
6
7
|
import { parseBusinessPaging } from './business-information-request.js';
|
|
7
|
-
import { grantToWire,
|
|
8
|
+
import { grantToWire, invitationToWire } from './business-information-wire.js';
|
|
8
9
|
const HOUR_MS = 60 * 60 * 1_000;
|
|
9
10
|
export async function handleMySolutionInstallations(req, res, deps) {
|
|
10
11
|
if (req.method !== 'GET')
|
|
@@ -28,7 +29,7 @@ export async function handleMySolutionInstallations(req, res, deps) {
|
|
|
28
29
|
sendJson(res, 200, {
|
|
29
30
|
ok: true,
|
|
30
31
|
data: {
|
|
31
|
-
installations: visible.map(({ installation, grant }) =>
|
|
32
|
+
installations: await Promise.all(visible.map(({ installation, grant }) => installationProjection(installation, grant.role, identity, deps))),
|
|
32
33
|
...(joined.length > limit && visible.at(-1) !== undefined
|
|
33
34
|
? { nextCursor: encodeDiscoveryCursor(visible.at(-1)) }
|
|
34
35
|
: {}),
|
|
@@ -186,7 +187,7 @@ export async function handleBusinessInvitationAccept(req, res, rawToken, deps) {
|
|
|
186
187
|
sendJson(res, 201, {
|
|
187
188
|
ok: true,
|
|
188
189
|
data: {
|
|
189
|
-
installation:
|
|
190
|
+
installation: await installationProjection(installation, result.grant.role, identity, deps),
|
|
190
191
|
grant: grantToWire(result.grant),
|
|
191
192
|
},
|
|
192
193
|
});
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { readJsonBody, sendJson } from '@noodle-borg/transport-http';
|
|
2
2
|
import { BusinessGrantCreateRequestSchema, formatWireError, ManagedRecordCreateRequestSchema, ManagedRecordMutationRequestSchema, ManagedRecordStatusSchema, SolutionInstallationCreateRequestSchema, SolutionInstallationIntakeRequestSchema, } from '@noodle-borg/wire-contracts';
|
|
3
3
|
import { admitBusinessMutation, admitBusinessTarget, authorizeBusinessApi, } from '../business-api-admission.js';
|
|
4
|
+
import { resolveInstallDefinition } from '../business-information/definition-resolver.js';
|
|
4
5
|
import { BUILT_IN_SOLUTION_PROFILES, businessGrantAllows, MANAGED_SOLUTION_PROFILE_KEYS, PayloadValidationError, validateCollectionEnabled, } from '../business-information/portable.js';
|
|
5
6
|
import { sendForbidden } from '../http-util.js';
|
|
6
7
|
import { loadExternalRecord, sendExternalRecordPage, sourceBindingKey, unsupportedExternalOperation, } from './business-information-external.js';
|
|
7
|
-
import {
|
|
8
|
+
import { installationProjection, retryInstallationActivation, stableInstallationId, } from './business-information-installation.js';
|
|
8
9
|
import { createNativeRecord } from './business-information-record-create.js';
|
|
9
10
|
import { cursorRequest, sendNativeRecordActivity } from './business-information-record-reads.js';
|
|
10
11
|
import { expectedRevision, mutationPermission, parseNativeRecordQuery, parseBusinessPaging as parsePaging, requestIdempotencyKey, } from './business-information-request.js';
|
|
11
|
-
import { collectionToWire, externalRecordToWire, grantToWire,
|
|
12
|
+
import { collectionToWire, externalRecordToWire, grantToWire, profileToWire, recordDetailToWire, recordToWire, } from './business-information-wire.js';
|
|
12
13
|
import { canManageMembers } from './org-admin.js';
|
|
13
14
|
export function handleSolutionCatalog(req, res) {
|
|
14
15
|
if (req.method !== 'GET') {
|
|
@@ -26,6 +27,8 @@ export async function handleSolutionInstallations(req, res, ref, deps) {
|
|
|
26
27
|
const identity = await requireIdentity(req, res, deps);
|
|
27
28
|
if (identity === false)
|
|
28
29
|
return;
|
|
30
|
+
if (ref.action === 'activate')
|
|
31
|
+
return retryInstallationActivation(req, res, ref, identity, deps);
|
|
29
32
|
if (req.method === 'POST' && ref.installationId === undefined) {
|
|
30
33
|
if (!(await canManageMembers(deps.controlPlane, ref.org, identity))) {
|
|
31
34
|
return sendForbidden(res, 'organization owner required');
|
|
@@ -96,7 +99,7 @@ export async function handleSolutionInstallations(req, res, ref, deps) {
|
|
|
96
99
|
return sendJson(res, result.disposition === 'created' ? 201 : 200, {
|
|
97
100
|
ok: true,
|
|
98
101
|
data: {
|
|
99
|
-
installation:
|
|
102
|
+
installation: await installationProjection(result.installation, grant.role, identity, deps),
|
|
100
103
|
},
|
|
101
104
|
});
|
|
102
105
|
}
|
|
@@ -114,7 +117,7 @@ export async function handleSolutionInstallations(req, res, ref, deps) {
|
|
|
114
117
|
return sendJson(res, 200, {
|
|
115
118
|
ok: true,
|
|
116
119
|
data: {
|
|
117
|
-
installations: permitted.map(({ installation, role }) =>
|
|
120
|
+
installations: await Promise.all(permitted.map(({ installation, role }) => installationProjection(installation, role, identity, deps))),
|
|
118
121
|
},
|
|
119
122
|
});
|
|
120
123
|
}
|
|
@@ -125,7 +128,7 @@ export async function handleSolutionInstallations(req, res, ref, deps) {
|
|
|
125
128
|
return sendJson(res, 200, {
|
|
126
129
|
ok: true,
|
|
127
130
|
data: {
|
|
128
|
-
installation:
|
|
131
|
+
installation: await installationProjection(authorized.installation, authorized.grant.role, identity, deps),
|
|
129
132
|
},
|
|
130
133
|
});
|
|
131
134
|
}
|
|
@@ -149,7 +152,9 @@ export async function handleSolutionInstallations(req, res, ref, deps) {
|
|
|
149
152
|
return mutationFailure(res, result);
|
|
150
153
|
return sendJson(res, 200, {
|
|
151
154
|
ok: true,
|
|
152
|
-
data: {
|
|
155
|
+
data: {
|
|
156
|
+
installation: await installationProjection(result.installation, authorized.grant.role, identity, deps),
|
|
157
|
+
},
|
|
153
158
|
});
|
|
154
159
|
}
|
|
155
160
|
return methodNotAllowed(res);
|
|
@@ -9,7 +9,7 @@ import { publicSurfaceOf } from '@noodle-borg/assistant-gateway/portable';
|
|
|
9
9
|
* Read from the just-activated artifact rather than the submitted manifest, so the id follows what the
|
|
10
10
|
* runtime will actually serve — the same source minting and projection read.
|
|
11
11
|
*/
|
|
12
|
-
export async function provisionPublicEmbed(registry, options, tenant, deploymentId) {
|
|
12
|
+
export async function provisionPublicEmbed(registry, options, tenant, deploymentId, allowRevokedReplacement = true) {
|
|
13
13
|
const embeds = options.publicEmbeds;
|
|
14
14
|
if (embeds === undefined || deploymentId === undefined)
|
|
15
15
|
return undefined;
|
|
@@ -18,7 +18,12 @@ export async function provisionPublicEmbed(registry, options, tenant, deployment
|
|
|
18
18
|
if (surface === undefined)
|
|
19
19
|
return undefined;
|
|
20
20
|
try {
|
|
21
|
-
const record = await embeds.ensure({
|
|
21
|
+
const record = await embeds.ensure({
|
|
22
|
+
...tenant,
|
|
23
|
+
surfaceMode: surface.mode,
|
|
24
|
+
now: new Date(),
|
|
25
|
+
allowRevokedReplacement,
|
|
26
|
+
});
|
|
22
27
|
return record.embedId;
|
|
23
28
|
}
|
|
24
29
|
catch {
|
|
@@ -96,7 +96,7 @@ export function createServiceHandler(registry, options = {}) {
|
|
|
96
96
|
allowance: async (org, request) => moduleHost.resolveActivityHistoryAllowance?.(org, request),
|
|
97
97
|
});
|
|
98
98
|
const withIntentMode = createIntentTargetResolver(intentSettings, intentPreviewOrgs);
|
|
99
|
-
const { activateInstallation, resolveRuntimeTarget, businessOnboarding } = createApplicationServingRuntime(registry, providerOptions, controlPlane, audit, activity);
|
|
99
|
+
const { activateInstallation, readInstallationActivation, resolveRuntimeTarget, businessOnboarding, } = createApplicationServingRuntime(registry, providerOptions, controlPlane, audit, activity);
|
|
100
100
|
const runtimeTarget = async (target) => target === undefined ? undefined : resolveRuntimeTarget(target);
|
|
101
101
|
const router = createMcpRouter(async (id) => withIntentMode(await runtimeTarget(await registry.getServing(id))), {
|
|
102
102
|
logger,
|
|
@@ -282,6 +282,7 @@ export function createServiceHandler(registry, options = {}) {
|
|
|
282
282
|
store: businessInformationStore,
|
|
283
283
|
...(businessOnboarding ? { businessOnboarding } : {}),
|
|
284
284
|
activateInstallation,
|
|
285
|
+
readInstallationActivation,
|
|
285
286
|
...(activity === undefined ? {} : { activity }),
|
|
286
287
|
...(options.connectionRuntime === undefined
|
|
287
288
|
? {}
|
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
import { sha256Canonical } from '@noodle-borg/app-package';
|
|
2
|
+
import { publicSurfaceOf } from '@noodle-borg/assistant-gateway/portable';
|
|
2
3
|
import { ApplicationSettings, installationSettingsTarget } from './application-settings.js';
|
|
3
4
|
import { privateDefinitionFromDeployment } from './business-information/definition-resolver.js';
|
|
4
5
|
import { managedSolutionManifest } from './business-information/managed-solution-executable.js';
|
|
5
6
|
import { BUSINESS_SETUP_MESSAGE, BusinessOnboarding } from './business-onboarding.js';
|
|
6
7
|
import { executeAuthorizedDeployment, } from './deployment-execution.js';
|
|
8
|
+
import { provisionPublicEmbed } from './routes/deploy-public-embed.js';
|
|
9
|
+
/** Deployment/binding readiness only; channel model, origin and connection checks remain separate. */
|
|
10
|
+
export async function readSolutionInstallationActivation(installation, dependencies) {
|
|
11
|
+
try {
|
|
12
|
+
const { registry, businessInformationStore: store, options, controlPlane } = dependencies;
|
|
13
|
+
const stored = await store?.getInstallation(installation.scope);
|
|
14
|
+
if (!store || !stored)
|
|
15
|
+
return 'unavailable';
|
|
16
|
+
const { org, app } = stored.scope;
|
|
17
|
+
const generation = await registry.getAppGeneration(org, app);
|
|
18
|
+
if ((await registry.getAppArchivedAt(org, app)) !== undefined ||
|
|
19
|
+
(stored.applicationGeneration !== 'pending' &&
|
|
20
|
+
(!generation ||
|
|
21
|
+
(stored.applicationGeneration !== undefined &&
|
|
22
|
+
stored.applicationGeneration !== generation))) ||
|
|
23
|
+
(options.businessOnboarding !== undefined &&
|
|
24
|
+
!(await new BusinessOnboarding(options.businessOnboarding, controlPlane, store).ready(stored))))
|
|
25
|
+
return 'unavailable';
|
|
26
|
+
const target = await registry.getActiveByTenant(stored.scope);
|
|
27
|
+
if (!target || stored.applicationGeneration === 'pending')
|
|
28
|
+
return 'pending';
|
|
29
|
+
if (publicSurfaceOf(target.served.artifact.server.assistant)) {
|
|
30
|
+
if (!options.publicEmbeds)
|
|
31
|
+
return 'unavailable';
|
|
32
|
+
const embeds = await options.publicEmbeds.list(stored.scope, { includeRevoked: true });
|
|
33
|
+
if (!embeds.some((embed) => embed.revokedAt === undefined))
|
|
34
|
+
return embeds.length > 0 ? 'unavailable' : 'pending';
|
|
35
|
+
}
|
|
36
|
+
return 'ready';
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return 'unavailable';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
7
42
|
/** Called after installation authorization, and by the managed-runtime refresh boundary. Never copies configuration. */
|
|
8
43
|
export async function activateSolutionInstallation(input, dependencies) {
|
|
9
44
|
const { installation, actor } = input;
|
|
@@ -32,13 +67,32 @@ export async function activateSolutionInstallation(input, dependencies) {
|
|
|
32
67
|
!(await store.bindApplication(installation.scope, generation ?? ''))) {
|
|
33
68
|
return reject(409, 'installation_application_unavailable', 'The retained installation requires application ownership recovery before activation.');
|
|
34
69
|
}
|
|
35
|
-
const bind = async (deploymentId) => {
|
|
70
|
+
const bind = async (deploymentId, reconcileEmbed) => {
|
|
36
71
|
const currentGeneration = await dependencies.registry.getAppGeneration(tenant.org, tenant.app);
|
|
37
72
|
if (store &&
|
|
38
73
|
(!currentGeneration || !(await store.bindApplication(installation.scope, currentGeneration))))
|
|
39
74
|
return reject(409, 'installation_application_unavailable', 'Application activation was interrupted; retained records remain accessible.');
|
|
40
75
|
if ((installation.definition.variables?.length ?? 0) > 0)
|
|
41
76
|
await new ApplicationSettings(dependencies.registry.configStore).initialize(installationSettingsTarget(installation));
|
|
77
|
+
const target = await dependencies.registry.get(deploymentId);
|
|
78
|
+
if (input.purpose !== 'runtime-refresh' &&
|
|
79
|
+
dependencies.options.publicEmbeds &&
|
|
80
|
+
publicSurfaceOf(target?.served.artifact.server.assistant)) {
|
|
81
|
+
try {
|
|
82
|
+
if (reconcileEmbed)
|
|
83
|
+
await provisionPublicEmbed(dependencies.registry, dependencies.options, tenant, deploymentId, false);
|
|
84
|
+
const embeds = await dependencies.options.publicEmbeds.list(tenant, {
|
|
85
|
+
includeRevoked: true,
|
|
86
|
+
});
|
|
87
|
+
if (!embeds.some((embed) => embed.revokedAt === undefined))
|
|
88
|
+
return embeds.length > 0
|
|
89
|
+
? reject(409, 'installation_embed_revoked', 'The assistant was deliberately revoked. Use explicit channel recovery; activation does not replace revoked access.')
|
|
90
|
+
: reject(503, 'installation_activation_incomplete', 'The installation is saved. Retry activation to finish assistant setup.');
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return reject(503, 'installation_activation_incomplete', 'The installation is saved. Retry activation when assistant setup is available.');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
42
96
|
return { ok: true, deploymentId };
|
|
43
97
|
};
|
|
44
98
|
const source = await executableSource(installation, dependencies.registry);
|
|
@@ -63,7 +117,7 @@ export async function activateSolutionInstallation(input, dependencies) {
|
|
|
63
117
|
currentSource.manifest === source.value.manifest &&
|
|
64
118
|
currentSource.connectors === source.value.connectors &&
|
|
65
119
|
JSON.stringify(currentSource.hostedAssets) === JSON.stringify(source.value.hostedAssets)) {
|
|
66
|
-
return bind(current.deploymentId);
|
|
120
|
+
return bind(current.deploymentId, true);
|
|
67
121
|
}
|
|
68
122
|
const key = sha256Canonical({
|
|
69
123
|
scope: installation.scope,
|
|
@@ -84,6 +138,7 @@ export async function activateSolutionInstallation(input, dependencies) {
|
|
|
84
138
|
? {}
|
|
85
139
|
: { orgMembershipSources: current.orgMembershipSources }),
|
|
86
140
|
deploymentSource: 'api',
|
|
141
|
+
allowRevokedEmbedReplacement: false,
|
|
87
142
|
idempotencyKey: key,
|
|
88
143
|
}, dependencies);
|
|
89
144
|
if (!deployed.ok)
|
|
@@ -95,7 +150,7 @@ export async function activateSolutionInstallation(input, dependencies) {
|
|
|
95
150
|
: 'installation_activation_failed',
|
|
96
151
|
message: 'The installation is saved, but its application could not be activated. Retry installation after resolving the deployment requirement.',
|
|
97
152
|
};
|
|
98
|
-
return bind(deployed.result.deploymentId);
|
|
153
|
+
return bind(deployed.result.deploymentId, false);
|
|
99
154
|
}
|
|
100
155
|
async function executableSource(installation, registry) {
|
|
101
156
|
const reference = installation.definition.reference;
|
|
@@ -427,6 +427,18 @@ export declare const SolutionInstallationIntakeRequestSchema: z.ZodObject<{
|
|
|
427
427
|
expectedRevision: z.ZodNumber;
|
|
428
428
|
}, z.core.$strict>;
|
|
429
429
|
export type SolutionInstallationIntakeRequest = z.infer<typeof SolutionInstallationIntakeRequestSchema>;
|
|
430
|
+
export declare const SolutionInstallationActivateRequestSchema: z.ZodObject<{}, z.core.$strict>;
|
|
431
|
+
export declare const SolutionInstallationActivationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
432
|
+
state: z.ZodLiteral<"pending">;
|
|
433
|
+
canRetry: z.ZodBoolean;
|
|
434
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
435
|
+
state: z.ZodEnum<{
|
|
436
|
+
unavailable: "unavailable";
|
|
437
|
+
ready: "ready";
|
|
438
|
+
}>;
|
|
439
|
+
canRetry: z.ZodLiteral<false>;
|
|
440
|
+
}, z.core.$strict>], "state">;
|
|
441
|
+
export type SolutionInstallationActivation = z.infer<typeof SolutionInstallationActivationSchema>;
|
|
430
442
|
export declare const ResolvedManagedSolutionDefinitionSchema: z.ZodObject<{
|
|
431
443
|
kind: z.ZodLiteral<"managed">;
|
|
432
444
|
definitionId: z.ZodEnum<{
|
|
@@ -574,6 +586,16 @@ export declare const SolutionInstallationSchema: z.ZodObject<{
|
|
|
574
586
|
profileId: z.ZodOptional<z.ZodEnum<{
|
|
575
587
|
b2b_saas: "b2b_saas";
|
|
576
588
|
}>>;
|
|
589
|
+
activation: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
590
|
+
state: z.ZodLiteral<"pending">;
|
|
591
|
+
canRetry: z.ZodBoolean;
|
|
592
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
593
|
+
state: z.ZodEnum<{
|
|
594
|
+
unavailable: "unavailable";
|
|
595
|
+
ready: "ready";
|
|
596
|
+
}>;
|
|
597
|
+
canRetry: z.ZodLiteral<false>;
|
|
598
|
+
}, z.core.$strict>], "state">>;
|
|
577
599
|
id: z.ZodString;
|
|
578
600
|
organizationId: z.ZodString;
|
|
579
601
|
appSlug: z.ZodString;
|
|
@@ -690,6 +712,16 @@ export declare const SolutionInstallationResponseSchema: z.ZodObject<{
|
|
|
690
712
|
profileId: z.ZodOptional<z.ZodEnum<{
|
|
691
713
|
b2b_saas: "b2b_saas";
|
|
692
714
|
}>>;
|
|
715
|
+
activation: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
716
|
+
state: z.ZodLiteral<"pending">;
|
|
717
|
+
canRetry: z.ZodBoolean;
|
|
718
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
719
|
+
state: z.ZodEnum<{
|
|
720
|
+
unavailable: "unavailable";
|
|
721
|
+
ready: "ready";
|
|
722
|
+
}>;
|
|
723
|
+
canRetry: z.ZodLiteral<false>;
|
|
724
|
+
}, z.core.$strict>], "state">>;
|
|
693
725
|
id: z.ZodString;
|
|
694
726
|
organizationId: z.ZodString;
|
|
695
727
|
appSlug: z.ZodString;
|
|
@@ -808,6 +840,16 @@ export declare const SolutionInstallationListResponseSchema: z.ZodObject<{
|
|
|
808
840
|
profileId: z.ZodOptional<z.ZodEnum<{
|
|
809
841
|
b2b_saas: "b2b_saas";
|
|
810
842
|
}>>;
|
|
843
|
+
activation: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
844
|
+
state: z.ZodLiteral<"pending">;
|
|
845
|
+
canRetry: z.ZodBoolean;
|
|
846
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
847
|
+
state: z.ZodEnum<{
|
|
848
|
+
unavailable: "unavailable";
|
|
849
|
+
ready: "ready";
|
|
850
|
+
}>;
|
|
851
|
+
canRetry: z.ZodLiteral<false>;
|
|
852
|
+
}, z.core.$strict>], "state">>;
|
|
811
853
|
id: z.ZodString;
|
|
812
854
|
organizationId: z.ZodString;
|
|
813
855
|
appSlug: z.ZodString;
|
|
@@ -1136,6 +1178,16 @@ export declare const BusinessInvitationAcceptResponseSchema: z.ZodObject<{
|
|
|
1136
1178
|
profileId: z.ZodOptional<z.ZodEnum<{
|
|
1137
1179
|
b2b_saas: "b2b_saas";
|
|
1138
1180
|
}>>;
|
|
1181
|
+
activation: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1182
|
+
state: z.ZodLiteral<"pending">;
|
|
1183
|
+
canRetry: z.ZodBoolean;
|
|
1184
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1185
|
+
state: z.ZodEnum<{
|
|
1186
|
+
unavailable: "unavailable";
|
|
1187
|
+
ready: "ready";
|
|
1188
|
+
}>;
|
|
1189
|
+
canRetry: z.ZodLiteral<false>;
|
|
1190
|
+
}, z.core.$strict>], "state">>;
|
|
1139
1191
|
id: z.ZodString;
|
|
1140
1192
|
organizationId: z.ZodString;
|
|
1141
1193
|
appSlug: z.ZodString;
|
|
@@ -153,7 +153,13 @@ export const SolutionInstallationIntakeRequestSchema = z.strictObject({
|
|
|
153
153
|
active: z.boolean(),
|
|
154
154
|
expectedRevision: positiveRevision,
|
|
155
155
|
});
|
|
156
|
+
export const SolutionInstallationActivateRequestSchema = z.strictObject({});
|
|
157
|
+
export const SolutionInstallationActivationSchema = z.discriminatedUnion('state', [
|
|
158
|
+
z.strictObject({ state: z.literal('pending'), canRetry: z.boolean() }),
|
|
159
|
+
z.strictObject({ state: z.enum(['ready', 'unavailable']), canRetry: z.literal(false) }),
|
|
160
|
+
]);
|
|
156
161
|
const installationShape = {
|
|
162
|
+
activation: SolutionInstallationActivationSchema.optional(),
|
|
157
163
|
id,
|
|
158
164
|
organizationId: id,
|
|
159
165
|
appSlug: slug,
|
|
@@ -384,4 +384,5 @@ export * from './application-activity.js';
|
|
|
384
384
|
export * from './application-connections.js';
|
|
385
385
|
export * from './application-onboarding.js';
|
|
386
386
|
export * from './billing-catalog.js';
|
|
387
|
+
export * from './operation-coordination.js';
|
|
387
388
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -226,4 +226,5 @@ export * from './application-activity.js';
|
|
|
226
226
|
export * from './application-connections.js';
|
|
227
227
|
export * from './application-onboarding.js';
|
|
228
228
|
export * from './billing-catalog.js';
|
|
229
|
+
export * from './operation-coordination.js';
|
|
229
230
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const OperationCoordinationListRequestSchema: z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
beforeResource: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare const OperationCoordinationResolveRequestSchema: z.ZodObject<{
|
|
7
|
+
resource: z.ZodString;
|
|
8
|
+
token: z.ZodUUID;
|
|
9
|
+
reason: z.ZodString;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export declare const OperationCoordinationListResponseSchema: z.ZodObject<{
|
|
12
|
+
ok: z.ZodLiteral<true>;
|
|
13
|
+
data: z.ZodObject<{
|
|
14
|
+
records: z.ZodArray<z.ZodObject<{
|
|
15
|
+
resource: z.ZodString;
|
|
16
|
+
token: z.ZodUUID;
|
|
17
|
+
reference: z.ZodString;
|
|
18
|
+
operationDigest: z.ZodString;
|
|
19
|
+
startedAt: z.ZodISODateTime;
|
|
20
|
+
deadline: z.ZodISODateTime;
|
|
21
|
+
state: z.ZodEnum<{
|
|
22
|
+
unknown: "unknown";
|
|
23
|
+
executing: "executing";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strict>>;
|
|
26
|
+
nextBeforeResource: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export declare const OperationCoordinationListClientResponseSchema: z.ZodObject<{
|
|
30
|
+
ok: z.ZodLiteral<true>;
|
|
31
|
+
data: z.ZodObject<{
|
|
32
|
+
records: z.ZodArray<z.ZodObject<{
|
|
33
|
+
resource: z.ZodString;
|
|
34
|
+
token: z.ZodUUID;
|
|
35
|
+
reference: z.ZodString;
|
|
36
|
+
operationDigest: z.ZodString;
|
|
37
|
+
startedAt: z.ZodISODateTime;
|
|
38
|
+
deadline: z.ZodISODateTime;
|
|
39
|
+
state: z.ZodEnum<{
|
|
40
|
+
unknown: "unknown";
|
|
41
|
+
executing: "executing";
|
|
42
|
+
}>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
nextBeforeResource: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export declare const OperationCoordinationResolveResponseSchema: z.ZodObject<{
|
|
48
|
+
ok: z.ZodLiteral<true>;
|
|
49
|
+
data: z.ZodObject<{
|
|
50
|
+
resolved: z.ZodLiteral<true>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export declare const OperationCoordinationResolveClientResponseSchema: z.ZodObject<{
|
|
54
|
+
ok: z.ZodLiteral<true>;
|
|
55
|
+
data: z.ZodObject<{
|
|
56
|
+
resolved: z.ZodLiteral<true>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
//# sourceMappingURL=operation-coordination.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const ResourceSchema = z.string().regex(/^[a-f0-9]{64}$/);
|
|
3
|
+
export const OperationCoordinationListRequestSchema = z.strictObject({
|
|
4
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
5
|
+
beforeResource: ResourceSchema.optional(),
|
|
6
|
+
});
|
|
7
|
+
export const OperationCoordinationResolveRequestSchema = z.strictObject({
|
|
8
|
+
resource: ResourceSchema,
|
|
9
|
+
token: z.uuid(),
|
|
10
|
+
reason: z
|
|
11
|
+
.string()
|
|
12
|
+
.trim()
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(256)
|
|
15
|
+
.regex(/^[^\p{Cc}\p{Zl}\p{Zp}]*$/u),
|
|
16
|
+
});
|
|
17
|
+
const RecordSchema = z.strictObject({
|
|
18
|
+
resource: ResourceSchema,
|
|
19
|
+
token: z.uuid(),
|
|
20
|
+
reference: z
|
|
21
|
+
.string()
|
|
22
|
+
.regex(/^[A-Za-z0-9._:@/-]{1,256}$/)
|
|
23
|
+
.refine((value) => !value.includes('://')),
|
|
24
|
+
operationDigest: ResourceSchema,
|
|
25
|
+
startedAt: z.iso.datetime(),
|
|
26
|
+
deadline: z.iso.datetime(),
|
|
27
|
+
state: z.enum(['executing', 'unknown']),
|
|
28
|
+
});
|
|
29
|
+
export const OperationCoordinationListResponseSchema = z.strictObject({
|
|
30
|
+
ok: z.literal(true),
|
|
31
|
+
data: z.strictObject({
|
|
32
|
+
records: z.array(RecordSchema).max(100),
|
|
33
|
+
nextBeforeResource: ResourceSchema.optional(),
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
export const OperationCoordinationListClientResponseSchema = z.object({
|
|
37
|
+
ok: z.literal(true),
|
|
38
|
+
data: z.object({
|
|
39
|
+
records: z.array(z.object(RecordSchema.shape)).max(100),
|
|
40
|
+
nextBeforeResource: ResourceSchema.optional(),
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
export const OperationCoordinationResolveResponseSchema = z.strictObject({
|
|
44
|
+
ok: z.literal(true),
|
|
45
|
+
data: z.strictObject({ resolved: z.literal(true) }),
|
|
46
|
+
});
|
|
47
|
+
export const OperationCoordinationResolveClientResponseSchema = z.object({
|
|
48
|
+
ok: z.literal(true),
|
|
49
|
+
data: z.object({ resolved: z.literal(true) }),
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=operation-coordination.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/one",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.165.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Noodle CLI by Noodle Seed — author, run, and deploy declarative MCP servers. Embedding the assistant in your own web app is @noodleseed/assistant.",
|
|
6
6
|
"license": "Apache-2.0",
|