@astrale-os/sdk 0.5.0-beta.99 → 0.6.0-beta.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/README.md +165 -2
- package/dist/application/action/action.d.ts +7 -4
- package/dist/application/action/authoring.d.ts +2 -1
- package/dist/application/action/context.d.ts +18 -13
- package/dist/application/action/define.d.ts +5 -1
- package/dist/application/action/define.js +6 -1
- package/dist/application/action/index.d.ts +2 -1
- package/dist/application/dependency/index.d.ts +1 -0
- package/dist/application/dependency/invoker.d.ts +26 -0
- package/dist/application/error/error.d.ts +23 -0
- package/dist/application/error/error.js +87 -0
- package/dist/application/error/index.d.ts +2 -0
- package/dist/application/error/index.js +1 -0
- package/dist/application/index.d.ts +2 -2
- package/dist/application/integration/authentication.d.ts +10 -0
- package/dist/application/integration/authentication.typecheck.js +18 -0
- package/dist/application/integration/client.d.ts +2 -0
- package/dist/application/integration/client.js +19 -2
- package/dist/application/integration/index.d.ts +1 -0
- package/dist/application/integration/operation.d.ts +3 -0
- package/dist/application/mutation/authoring/builder.js +2 -2
- package/dist/application/mutation/authoring/endpoint.d.ts +3 -3
- package/dist/application/mutation/authoring/endpoint.js +9 -0
- package/dist/application/mutation/failure.js +13 -7
- package/dist/application/mutation/index.d.ts +1 -0
- package/dist/application/requirements/{profiles.d.ts → core.d.ts} +5 -3
- package/dist/application/requirements/{profiles.js → core.js} +6 -6
- package/dist/application/requirements/index.d.ts +4 -4
- package/dist/application/requirements/index.js +5 -5
- package/dist/application/requirements/requirement.d.ts +3 -2
- package/dist/application/runtime/authoring.d.ts +1 -0
- package/dist/application/runtime/callables.js +2 -2
- package/dist/application/runtime/declarations.d.ts +43 -0
- package/dist/application/runtime/define.d.ts +2 -1
- package/dist/application/view/index.d.ts +1 -1
- package/dist/application/view/route.d.ts +4 -0
- package/dist/application/view/route.js +5 -1
- package/dist/application/workflow/authoring.d.ts +1 -0
- package/dist/application/workflow/context.d.ts +2 -1
- package/dist/application/workflow/define.d.ts +5 -1
- package/dist/application/workflow/define.js +6 -1
- package/dist/application/workflow/index.d.ts +1 -0
- package/dist/application/workflow/runner/runner.d.ts +3 -2
- package/dist/application/workflow/workflow.d.ts +4 -3
- package/dist/deployment/adapter/adapter.d.ts +12 -7
- package/dist/deployment/adapter/define.d.ts +5 -2
- package/dist/deployment/adapter/define.js +15 -17
- package/dist/deployment/adapter/deploy/context.d.ts +6 -0
- package/dist/deployment/adapter/deploy/result.d.ts +2 -0
- package/dist/deployment/adapter/index.d.ts +2 -3
- package/dist/deployment/adapter/index.js +1 -1
- package/dist/deployment/adapter/prepare/context.d.ts +13 -5
- package/dist/deployment/authoring.d.ts +1 -1
- package/dist/deployment/build/compile.js +21 -19
- package/dist/deployment/build/frontend/compilation.d.ts +2 -1
- package/dist/deployment/build/frontend/compilation.js +1 -0
- package/dist/deployment/build/material.js +5 -5
- package/dist/deployment/deploy.d.ts +10 -4
- package/dist/deployment/deploy.js +5 -5
- package/dist/deployment/deployment.d.ts +8 -5
- package/dist/deployment/deployment.js +10 -1
- package/dist/deployment/index.d.ts +5 -4
- package/dist/deployment/index.js +3 -2
- package/dist/deployment/release/addressing.d.ts +6 -2
- package/dist/deployment/release/addressing.js +9 -4
- package/dist/deployment/release/publication/callables.js +1 -1
- package/dist/deployment/release/publication/index.d.ts +1 -1
- package/dist/deployment/release/publication/index.js +1 -1
- package/dist/deployment/release/publication/routes.js +1 -1
- package/dist/deployment/release/publication/seal.d.ts +0 -1
- package/dist/deployment/release/publication/seal.js +4 -5
- package/dist/deployment/release/publication/views.js +2 -1
- package/dist/deployment/verify/preflight/artifact.js +1 -1
- package/dist/deployment/verify/readiness/deployment.js +7 -3
- package/dist/deployment/verify/readiness/identity.js +1 -1
- package/dist/deployment/verify/readiness/publication.js +2 -2
- package/dist/execution/identity/authentication.js +0 -1
- package/dist/execution/identity/exchange.d.ts +1 -0
- package/dist/execution/identity/exchange.js +1 -1
- package/dist/execution/identity/jwks.js +1 -1
- package/dist/execution/invocation/admission/authentication.d.ts +6 -3
- package/dist/execution/invocation/admission/authentication.js +16 -6
- package/dist/execution/invocation/admission/authority.d.ts +2 -2
- package/dist/execution/invocation/dependency/bind.d.ts +5 -0
- package/dist/execution/invocation/dependency/bind.js +68 -0
- package/dist/execution/invocation/dependency/index.d.ts +1 -0
- package/dist/execution/invocation/dependency/index.js +1 -0
- package/dist/execution/invocation/dispatch/action.js +19 -2
- package/dist/execution/invocation/dispatch/context.d.ts +4 -4
- package/dist/execution/invocation/dispatch/context.js +29 -9
- package/dist/execution/invocation/dispatch/workflow.js +17 -4
- package/dist/execution/invocation/integration/authentication.d.ts +5 -0
- package/dist/execution/invocation/integration/authentication.js +53 -0
- package/dist/execution/invocation/integration/call.d.ts +7 -1
- package/dist/execution/invocation/integration/call.js +8 -3
- package/dist/execution/invocation/integration/clients.d.ts +2 -2
- package/dist/execution/invocation/integration/clients.js +2 -2
- package/dist/execution/invocation/lifecycle/active.js +30 -5
- package/dist/execution/invocation/result/errors.d.ts +1 -0
- package/dist/execution/invocation/result/errors.js +15 -10
- package/dist/execution/service/create.js +3 -1
- package/dist/execution/service/service.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/platform/auth/index.d.ts +1 -1
- package/dist/platform/auth/index.js +0 -1
- package/dist/platform/graph/alias.d.ts +6 -0
- package/dist/platform/graph/alias.js +6 -0
- package/dist/platform/graph/document/index.d.ts +2 -1
- package/dist/platform/graph/document/index.js +2 -1
- package/dist/platform/graph/index.d.ts +2 -1
- package/dist/platform/graph/index.js +2 -1
- package/dist/platform/schema/class-authoring.d.ts +37 -0
- package/dist/platform/schema/class-authoring.js +20 -0
- package/dist/platform/schema/class-icon.d.ts +15 -0
- package/dist/platform/schema/class-icon.js +46 -0
- package/dist/platform/schema/error.d.ts +11 -0
- package/dist/platform/schema/error.js +34 -0
- package/dist/platform/schema/errors/index.d.ts +3 -0
- package/dist/platform/schema/errors/index.js +2 -0
- package/dist/platform/schema/icons/index.d.ts +2 -0
- package/dist/platform/schema/icons/index.js +2 -0
- package/dist/platform/schema/index.d.ts +20 -13
- package/dist/platform/schema/index.js +9 -4
- package/dist/platform/schema/kernel.d.ts +22 -0
- package/dist/platform/schema/kernel.js +5 -0
- package/dist/platform/schema/node-id.d.ts +3 -0
- package/dist/platform/schema/node-id.js +6 -0
- package/dist/platform/schema/property.d.ts +12 -0
- package/dist/platform/schema/property.js +3 -0
- package/dist/platform/schema/schema-authoring.d.ts +48 -0
- package/dist/platform/schema/schema-authoring.js +3 -0
- package/dist/platform/schema/state-property.d.ts +11 -0
- package/dist/platform/schema/state-property.js +3 -0
- package/dist/project/admit.d.ts +4 -0
- package/dist/project/admit.js +22 -0
- package/dist/project/define.d.ts +12 -0
- package/dist/project/define.js +106 -0
- package/dist/project/index.d.ts +4 -0
- package/dist/project/index.js +2 -0
- package/dist/project/project.d.ts +24 -0
- package/dist/project/project.js +1 -0
- package/dist/testing/dataset/admission.d.ts +13 -0
- package/dist/testing/dataset/admission.js +107 -0
- package/dist/testing/dataset/builder.d.ts +42 -0
- package/dist/testing/dataset/builder.js +127 -0
- package/dist/testing/dataset/codec.d.ts +6 -0
- package/dist/testing/dataset/codec.js +113 -0
- package/dist/testing/dataset/dataset.d.ts +58 -0
- package/dist/testing/dataset/dataset.js +2 -0
- package/dist/testing/dataset/define.d.ts +33 -0
- package/dist/testing/dataset/define.js +105 -0
- package/dist/testing/dataset/index.d.ts +8 -0
- package/dist/testing/dataset/index.js +4 -0
- package/dist/testing/dataset/references.d.ts +14 -0
- package/dist/testing/dataset/references.js +56 -0
- package/dist/testing/index.d.ts +9 -0
- package/dist/testing/index.js +5 -0
- package/dist/testing/load.d.ts +14 -0
- package/dist/testing/load.js +44 -0
- package/dist/testing/reference.d.ts +11 -0
- package/dist/testing/reference.js +19 -0
- package/dist/testing/tests.d.ts +12 -0
- package/dist/testing/tests.js +31 -0
- package/dist/tooling/cli/arguments.d.ts +7 -4
- package/dist/tooling/cli/arguments.js +82 -107
- package/dist/tooling/cli/astrale/authority.d.ts +5 -0
- package/dist/tooling/cli/astrale/authority.js +11 -0
- package/dist/tooling/cli/astrale/executable.d.ts +2 -0
- package/dist/tooling/cli/astrale/executable.js +47 -0
- package/dist/tooling/cli/astrale/failure.d.ts +6 -0
- package/dist/tooling/cli/astrale/failure.js +48 -0
- package/dist/tooling/cli/astrale/instance.d.ts +11 -0
- package/dist/tooling/cli/astrale/instance.js +52 -0
- package/dist/tooling/cli/astrale/process.d.ts +13 -0
- package/dist/tooling/cli/astrale/process.js +94 -0
- package/dist/tooling/cli/astrale/version.d.ts +18 -0
- package/dist/tooling/cli/astrale/version.js +55 -0
- package/dist/tooling/cli/bun.js +1 -1
- package/dist/tooling/cli/credential.d.ts +2 -0
- package/dist/tooling/cli/credential.js +57 -0
- package/dist/tooling/cli/development/candidate.d.ts +25 -0
- package/dist/tooling/cli/development/candidate.js +176 -0
- package/dist/tooling/cli/development/deployment.d.ts +16 -0
- package/dist/tooling/cli/development/deployment.js +39 -0
- package/dist/tooling/cli/development/develop.d.ts +4 -3
- package/dist/tooling/cli/development/develop.js +125 -289
- package/dist/tooling/cli/development/lease.d.ts +18 -0
- package/dist/tooling/cli/development/lease.js +163 -0
- package/dist/tooling/cli/development/lifecycle.js +4 -0
- package/dist/tooling/cli/development/project-imports.d.ts +22 -0
- package/dist/tooling/cli/development/project-imports.js +39 -0
- package/dist/tooling/cli/development/project-lock.d.ts +3 -4
- package/dist/tooling/cli/development/project-lock.js +14 -166
- package/dist/tooling/cli/development/release-evidence.d.ts +4 -0
- package/dist/tooling/cli/development/release-evidence.js +10 -0
- package/dist/tooling/cli/development/report.d.ts +6 -0
- package/dist/tooling/cli/development/report.js +14 -0
- package/dist/tooling/cli/development/source-watch.js +53 -5
- package/dist/tooling/cli/development/sources.d.ts +7 -0
- package/dist/tooling/cli/development/sources.js +48 -0
- package/dist/tooling/cli/development/target-lock.d.ts +16 -0
- package/dist/tooling/cli/development/target-lock.js +68 -0
- package/dist/tooling/cli/development/view.d.ts +28 -0
- package/dist/tooling/cli/development/view.js +151 -0
- package/dist/tooling/cli/environment-release.d.ts +21 -0
- package/dist/tooling/cli/environment-release.js +46 -0
- package/dist/tooling/cli/evidence.d.ts +11 -0
- package/dist/tooling/cli/evidence.js +53 -0
- package/dist/tooling/cli/help.js +78 -34
- package/dist/tooling/cli/index.d.ts +1 -1
- package/dist/tooling/cli/index.js +1 -1
- package/dist/tooling/cli/installation/index.d.ts +2 -0
- package/dist/tooling/cli/installation/index.js +1 -0
- package/dist/tooling/cli/installation/observation.d.ts +10 -0
- package/dist/tooling/cli/installation/observation.js +44 -0
- package/dist/tooling/cli/installation/reconcile.d.ts +32 -0
- package/dist/tooling/cli/installation/reconcile.js +122 -0
- package/dist/tooling/cli/orchestrate.js +84 -44
- package/dist/tooling/cli/project.d.ts +17 -0
- package/dist/tooling/cli/project.js +18 -0
- package/dist/tooling/cli/test.d.ts +12 -0
- package/dist/tooling/cli/test.js +47 -0
- package/dist/tooling/cli/upgrade/index.d.ts +6 -0
- package/dist/tooling/cli/upgrade/index.js +115 -0
- package/dist/tooling/cli/upgrade/manifest.d.ts +18 -0
- package/dist/tooling/cli/upgrade/manifest.js +77 -0
- package/dist/tooling/cli/upgrade/process.d.ts +2 -0
- package/dist/tooling/cli/upgrade/process.js +57 -0
- package/dist/tooling/linter/adapters/typescript/imports.js +2 -0
- package/dist/tooling/linter/adapters/typescript/index.d.ts +1 -0
- package/dist/tooling/linter/adapters/typescript/index.js +1 -0
- package/dist/tooling/linter/adapters/typescript/query-collection-type.js +4 -51
- package/dist/tooling/linter/adapters/typescript/type-analysis.d.ts +9 -0
- package/dist/tooling/linter/adapters/typescript/type-analysis.js +55 -0
- package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +28 -0
- package/dist/tooling/linter/implementations/source/callable-requirements.js +234 -0
- package/dist/tooling/linter/implementations/source/dependencies.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/dependencies.js +219 -0
- package/dist/tooling/linter/implementations/source/global.js +52 -2
- package/dist/tooling/linter/implementations/source/mutations.js +520 -38
- package/dist/tooling/linter/implementations/source/providers.js +19 -164
- package/dist/tooling/linter/implementations/source/schema.js +454 -2
- package/dist/tooling/linter/implementations/source/verifiers.js +2 -0
- package/dist/tooling/linter/implementations/source/workflows.js +8 -35
- package/dist/tooling/linter/policy/generated.js +2 -2
- package/dist/tooling/linter/requirements/registry.js +9 -3
- package/dist/tooling/packaging/declarations/normalize.js +3 -38
- package/dist/tooling/packaging/declarations/paths.d.ts +5 -0
- package/dist/tooling/packaging/declarations/paths.js +38 -0
- package/dist/tooling/packaging/finalize.d.ts +13 -0
- package/dist/tooling/packaging/finalize.js +62 -0
- package/dist/tooling/packaging/index.d.ts +2 -0
- package/dist/tooling/packaging/index.js +1 -0
- package/dist/tooling/packaging/javascript.d.ts +3 -0
- package/dist/tooling/packaging/javascript.js +45 -2
- package/dist/tooling/packaging/packaging.d.ts +2 -5
- package/dist/tooling/packaging/packaging.js +6 -30
- package/package.json +42 -12
- package/CHANGELOG.md +0 -1506
- package/dist/deployment/adapter/development/context.d.ts +0 -18
- package/dist/deployment/adapter/development/index.d.ts +0 -4
- package/dist/deployment/adapter/development/input.d.ts +0 -6
- package/dist/deployment/adapter/development/placement.d.ts +0 -15
- package/dist/deployment/adapter/development/session.d.ts +0 -9
- /package/dist/{deployment/adapter/development → application/dependency}/index.js +0 -0
- /package/dist/{deployment/adapter/development/context.js → application/dependency/invoker.js} +0 -0
- /package/dist/{deployment/adapter/development/input.js → application/integration/authentication.js} +0 -0
- /package/dist/{deployment/adapter/development/placement.js → application/integration/authentication.typecheck.d.ts} +0 -0
- /package/dist/{deployment/adapter/development/session.js → application/runtime/declarations.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { NEUTRAL_CLASS_ICON_SVG } from '../../../../platform/schema/class-icon.js';
|
|
3
|
+
import { importedSymbol, objectProperty, propertyChain, resolveImportedSymbol, staticText, unwrap, visit, } from '../../adapters/typescript/index.js';
|
|
4
|
+
import { ambiguity, definitionObjects, definitionOriginAmbiguity, DSL_MODULES, forbiddenIoImport, production, propertyExpression, violation, } from './shared.js';
|
|
4
5
|
import { stateMachineConstructorOrigin, stateMachineOrigin, statePropertyIdentity, statePropertyOrigin, stateSchemaIdentity, } from './state-machine.js';
|
|
5
6
|
const FORBIDDEN_LAYERS = new Set([
|
|
6
7
|
'integrations',
|
|
@@ -20,7 +21,458 @@ const EXECUTION_NAMES = new Set([
|
|
|
20
21
|
'mutate',
|
|
21
22
|
'query',
|
|
22
23
|
]);
|
|
24
|
+
const SCHEMA_KINDS = Object.freeze([
|
|
25
|
+
'classes',
|
|
26
|
+
'core',
|
|
27
|
+
'dependencies',
|
|
28
|
+
'errors',
|
|
29
|
+
'functions',
|
|
30
|
+
'policies',
|
|
31
|
+
'states',
|
|
32
|
+
'types',
|
|
33
|
+
'views',
|
|
34
|
+
]);
|
|
35
|
+
const SCHEMA_KIND_DIRECTORIES = new Set(SCHEMA_KINDS);
|
|
36
|
+
const SCHEMA_ROOT_DIRECTORIES = new Set(['__tests__', 'modules', ...SCHEMA_KINDS]);
|
|
37
|
+
const SCHEMA_KIND_LIST = SCHEMA_KINDS.join(', ');
|
|
38
|
+
const SCHEMA_ROOT_DIRECTORY_LIST = [...SCHEMA_ROOT_DIRECTORIES].join(', ');
|
|
39
|
+
const OWNED_DECLARATION_KINDS = new Set(['classes', 'functions', 'policies', 'states', 'views']);
|
|
40
|
+
const DECLARATION_KIND_CONTRACTS = Object.freeze({
|
|
41
|
+
classes: {
|
|
42
|
+
label: 'Class',
|
|
43
|
+
constructors: [
|
|
44
|
+
{ module: '@astrale-os/sdk/schema', name: 'nodeClass' },
|
|
45
|
+
{ module: '@astrale-os/sdk/schema', name: 'defineClass' },
|
|
46
|
+
{ module: '@astrale-os/sdk/schema', name: 'edgeClass', member: 'directed' },
|
|
47
|
+
{ module: '@astrale-os/sdk/schema', name: 'edgeClass', member: 'undirected' },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
functions: {
|
|
51
|
+
label: 'Function or Method',
|
|
52
|
+
constructors: [
|
|
53
|
+
{ module: '@astrale-os/sdk/schema', name: 'func' },
|
|
54
|
+
{ module: '@astrale-os/sdk/schema', name: 'method' },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
policies: {
|
|
58
|
+
label: 'Policy',
|
|
59
|
+
constructors: [
|
|
60
|
+
{ module: '@astrale-os/sdk/schema', name: 'policy' },
|
|
61
|
+
{ module: '@astrale-os/sdk/schema', name: 'policy', member: 'allOf' },
|
|
62
|
+
{ module: '@astrale-os/sdk/schema', name: 'policy', member: 'anyOf' },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
states: {
|
|
66
|
+
label: 'StateMachine',
|
|
67
|
+
constructors: [{ module: '@astrale-os/sdk/state', name: 'stateMachine' }],
|
|
68
|
+
},
|
|
69
|
+
views: {
|
|
70
|
+
label: 'View',
|
|
71
|
+
constructors: [{ module: '@astrale-os/sdk/schema', name: 'view' }],
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
function classIconObservation(file, call, object) {
|
|
75
|
+
if (!object) {
|
|
76
|
+
if (call.arguments.length === 0 || isUndefinedExpression(call.arguments[0])) {
|
|
77
|
+
return { state: 'missing', node: call };
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
state: 'presence-ambiguous',
|
|
81
|
+
node: call,
|
|
82
|
+
detail: 'Node Class icon is hidden inside an opaque configuration.',
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const property = objectProperty(object, 'icon');
|
|
86
|
+
if (!property) {
|
|
87
|
+
if (object.properties.some(mayAssignUnknownProperty)) {
|
|
88
|
+
return {
|
|
89
|
+
state: 'presence-ambiguous',
|
|
90
|
+
node: object,
|
|
91
|
+
detail: 'Node Class icon may be supplied by an object spread or computed property.',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return { state: 'missing', node: object };
|
|
95
|
+
}
|
|
96
|
+
if (object.properties.some((candidate) => candidate.pos > property.pos && mayAssignUnknownProperty(candidate))) {
|
|
97
|
+
return {
|
|
98
|
+
state: 'presence-ambiguous',
|
|
99
|
+
node: property,
|
|
100
|
+
detail: 'Node Class icon may be overridden by a later object spread or computed property.',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (!ts.isPropertyAssignment(property)) {
|
|
104
|
+
return {
|
|
105
|
+
state: 'value-ambiguous',
|
|
106
|
+
node: property,
|
|
107
|
+
detail: 'Node Class icon value is not statically visible.',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (isUndefinedExpression(property.initializer)) {
|
|
111
|
+
return { state: 'missing', node: property };
|
|
112
|
+
}
|
|
113
|
+
const state = neutralIconState(file, property.initializer);
|
|
114
|
+
if (state === 'neutral') {
|
|
115
|
+
return { state, node: property };
|
|
116
|
+
}
|
|
117
|
+
if (state === 'value-ambiguous') {
|
|
118
|
+
return {
|
|
119
|
+
state,
|
|
120
|
+
node: property,
|
|
121
|
+
detail: 'Node Class icon origin is not statically resolvable.',
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return { state: 'meaningful', node: property };
|
|
125
|
+
}
|
|
126
|
+
function neutralIconState(file, expression) {
|
|
127
|
+
if (staticText(expression) === NEUTRAL_CLASS_ICON_SVG)
|
|
128
|
+
return 'neutral';
|
|
129
|
+
const target = unwrap(expression);
|
|
130
|
+
if (ts.isCallExpression(target)) {
|
|
131
|
+
const callee = unwrap(target.expression);
|
|
132
|
+
if (!ts.isPropertyAccessExpression(callee) || callee.name.text !== 'svg') {
|
|
133
|
+
return 'meaningful';
|
|
134
|
+
}
|
|
135
|
+
const resolution = resolveImportedSymbol(file, callee.expression);
|
|
136
|
+
if (resolution.kind === 'local' || resolution.name !== 'classIcon')
|
|
137
|
+
return 'meaningful';
|
|
138
|
+
if (resolution.kind === 'ambiguous')
|
|
139
|
+
return 'value-ambiguous';
|
|
140
|
+
if (resolution.module !== '@astrale-os/sdk/schema')
|
|
141
|
+
return 'meaningful';
|
|
142
|
+
return staticText(target.arguments[0]) === NEUTRAL_CLASS_ICON_SVG ? 'neutral' : 'meaningful';
|
|
143
|
+
}
|
|
144
|
+
if (!ts.isPropertyAccessExpression(target) || target.name.text !== 'neutral') {
|
|
145
|
+
return 'meaningful';
|
|
146
|
+
}
|
|
147
|
+
const resolution = resolveImportedSymbol(file, target.expression);
|
|
148
|
+
if (resolution.kind === 'local')
|
|
149
|
+
return 'meaningful';
|
|
150
|
+
if (resolution.name !== 'classIcon')
|
|
151
|
+
return 'meaningful';
|
|
152
|
+
if (resolution.kind === 'resolved') {
|
|
153
|
+
return resolution.module === '@astrale-os/sdk/schema' ? 'neutral' : 'meaningful';
|
|
154
|
+
}
|
|
155
|
+
return resolution.kind === 'ambiguous' ? 'value-ambiguous' : 'meaningful';
|
|
156
|
+
}
|
|
157
|
+
function requiredClassIconEvidence(file, observation) {
|
|
158
|
+
if (observation.state === 'missing') {
|
|
159
|
+
return [
|
|
160
|
+
violation(file, observation.node, 'Node Class must declare icon explicitly; use classIcon.neutral only for an intentional neutral choice.'),
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
if (observation.state === 'presence-ambiguous') {
|
|
164
|
+
return [ambiguity(file, observation.node, observation.detail ?? 'Node Class icon is opaque.')];
|
|
165
|
+
}
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
function neutralClassIconEvidence(file, observation) {
|
|
169
|
+
if (observation.state !== 'neutral')
|
|
170
|
+
return [];
|
|
171
|
+
return [
|
|
172
|
+
violation(file, observation.node, 'Node Class uses classIcon.neutral; choose a meaningful Lucide or custom SVG icon.'),
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
function classIconEvidence(project, mode) {
|
|
176
|
+
const evidence = [];
|
|
177
|
+
const report = mode === 'required' ? requiredClassIconEvidence : neutralClassIconEvidence;
|
|
178
|
+
for (const file of production(project, 'schema')) {
|
|
179
|
+
for (const definition of definitionObjects(file, 'nodeClass', undefined, DSL_MODULES)) {
|
|
180
|
+
const uncertain = definitionOriginAmbiguity(file, definition, 'nodeClass declaration');
|
|
181
|
+
if (uncertain) {
|
|
182
|
+
if (mode === 'required')
|
|
183
|
+
evidence.push(uncertain);
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
evidence.push(...report(file, classIconObservation(file, definition.call, definition.object)));
|
|
187
|
+
}
|
|
188
|
+
for (const definition of definitionObjects(file, 'defineClass', undefined, DSL_MODULES)) {
|
|
189
|
+
if (!definition.object)
|
|
190
|
+
continue;
|
|
191
|
+
if (staticText(propertyExpression(definition.object, 'kind')) !== 'node')
|
|
192
|
+
continue;
|
|
193
|
+
const uncertain = definitionOriginAmbiguity(file, definition, 'defineClass declaration');
|
|
194
|
+
if (uncertain) {
|
|
195
|
+
if (mode === 'required')
|
|
196
|
+
evidence.push(uncertain);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
evidence.push(...report(file, classIconObservation(file, definition.call, definition.object)));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return evidence;
|
|
203
|
+
}
|
|
204
|
+
function isUndefinedExpression(expression) {
|
|
205
|
+
if (!expression)
|
|
206
|
+
return false;
|
|
207
|
+
const target = unwrap(expression);
|
|
208
|
+
return (ts.isIdentifier(target) && target.text === 'undefined') || ts.isVoidExpression(target);
|
|
209
|
+
}
|
|
210
|
+
function mayAssignUnknownProperty(property) {
|
|
211
|
+
if (ts.isSpreadAssignment(property))
|
|
212
|
+
return true;
|
|
213
|
+
return ('name' in property &&
|
|
214
|
+
property.name !== undefined &&
|
|
215
|
+
ts.isComputedPropertyName(property.name) &&
|
|
216
|
+
staticText(property.name.expression) === undefined);
|
|
217
|
+
}
|
|
218
|
+
function declarationKindFile(project, file) {
|
|
219
|
+
if (file.role !== 'production' || file.layer !== 'schema')
|
|
220
|
+
return undefined;
|
|
221
|
+
const layer = project.policy.layers.find(({ id }) => id === 'schema');
|
|
222
|
+
if (!layer)
|
|
223
|
+
return undefined;
|
|
224
|
+
const segments = file.path.slice(layer.sourcePath.length).split('/');
|
|
225
|
+
const nestedModule = segments[0] === 'modules';
|
|
226
|
+
const kind = segments[nestedModule ? 2 : 0];
|
|
227
|
+
if (!kind || !OWNED_DECLARATION_KINDS.has(kind))
|
|
228
|
+
return undefined;
|
|
229
|
+
const index = nestedModule
|
|
230
|
+
? segments.length === 4 && segments[3] === 'index.ts'
|
|
231
|
+
: segments.length === 2 && segments[1] === 'index.ts';
|
|
232
|
+
return { kind: kind, index };
|
|
233
|
+
}
|
|
234
|
+
function declarationConstructor(file, expression) {
|
|
235
|
+
const call = unwrap(expression);
|
|
236
|
+
if (!ts.isCallExpression(call))
|
|
237
|
+
return undefined;
|
|
238
|
+
const callee = unwrap(call.expression);
|
|
239
|
+
const direct = resolveImportedSymbol(file, callee);
|
|
240
|
+
if (direct.kind === 'resolved') {
|
|
241
|
+
for (const contract of Object.values(DECLARATION_KIND_CONTRACTS)) {
|
|
242
|
+
const constructor = contract.constructors.find((candidate) => candidate.module === direct.module &&
|
|
243
|
+
candidate.name === direct.name &&
|
|
244
|
+
candidate.member === undefined);
|
|
245
|
+
if (constructor)
|
|
246
|
+
return constructor;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (!ts.isPropertyAccessExpression(callee))
|
|
250
|
+
return undefined;
|
|
251
|
+
const resolution = resolveImportedSymbol(file, callee.expression);
|
|
252
|
+
if (resolution.kind !== 'resolved')
|
|
253
|
+
return undefined;
|
|
254
|
+
for (const contract of Object.values(DECLARATION_KIND_CONTRACTS)) {
|
|
255
|
+
const constructor = contract.constructors.find((candidate) => candidate.module === resolution.module &&
|
|
256
|
+
candidate.name === resolution.name &&
|
|
257
|
+
candidate.member === callee.name.text);
|
|
258
|
+
if (constructor)
|
|
259
|
+
return constructor;
|
|
260
|
+
}
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
function expectedDeclarationConstructor(file, expression, kind) {
|
|
264
|
+
if (!expression)
|
|
265
|
+
return false;
|
|
266
|
+
const constructor = declarationConstructor(file, expression);
|
|
267
|
+
return (constructor !== undefined &&
|
|
268
|
+
DECLARATION_KIND_CONTRACTS[kind].constructors.some((candidate) => candidate.module === constructor.module &&
|
|
269
|
+
candidate.name === constructor.name &&
|
|
270
|
+
candidate.member === constructor.member));
|
|
271
|
+
}
|
|
272
|
+
function locallyConstructedDeclarations(file) {
|
|
273
|
+
const declarations = [];
|
|
274
|
+
visit(file.source, (node) => {
|
|
275
|
+
if (ts.isCallExpression(node) && declarationConstructor(file, node))
|
|
276
|
+
declarations.push(node);
|
|
277
|
+
});
|
|
278
|
+
return declarations;
|
|
279
|
+
}
|
|
280
|
+
function runtimeExports(file) {
|
|
281
|
+
const bindings = new Map();
|
|
282
|
+
for (const statement of file.source.statements) {
|
|
283
|
+
if (ts.isVariableStatement(statement)) {
|
|
284
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
285
|
+
if (ts.isIdentifier(declaration.name)) {
|
|
286
|
+
bindings.set(declaration.name.text, {
|
|
287
|
+
node: declaration,
|
|
288
|
+
...(declaration.initializer ? { initializer: declaration.initializer } : {}),
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
if ((ts.isFunctionDeclaration(statement) ||
|
|
295
|
+
ts.isClassDeclaration(statement) ||
|
|
296
|
+
ts.isEnumDeclaration(statement) ||
|
|
297
|
+
ts.isModuleDeclaration(statement)) &&
|
|
298
|
+
statement.name) {
|
|
299
|
+
bindings.set(statement.name.text, { node: statement });
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
const exports = [];
|
|
303
|
+
for (const statement of file.source.statements) {
|
|
304
|
+
if (ts.isVariableStatement(statement) && hasModifier(statement, ts.SyntaxKind.ExportKeyword)) {
|
|
305
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
306
|
+
exports.push({
|
|
307
|
+
node: declaration,
|
|
308
|
+
...(declaration.initializer ? { initializer: declaration.initializer } : {}),
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
if ((ts.isFunctionDeclaration(statement) ||
|
|
314
|
+
ts.isClassDeclaration(statement) ||
|
|
315
|
+
ts.isEnumDeclaration(statement) ||
|
|
316
|
+
ts.isModuleDeclaration(statement)) &&
|
|
317
|
+
hasModifier(statement, ts.SyntaxKind.ExportKeyword)) {
|
|
318
|
+
exports.push({ node: statement });
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if (ts.isExportAssignment(statement)) {
|
|
322
|
+
exports.push({
|
|
323
|
+
node: statement,
|
|
324
|
+
initializer: localInitializer(statement.expression, bindings),
|
|
325
|
+
});
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
if (!ts.isExportDeclaration(statement) || statement.isTypeOnly)
|
|
329
|
+
continue;
|
|
330
|
+
if (!statement.exportClause || !ts.isNamedExports(statement.exportClause)) {
|
|
331
|
+
exports.push({ node: statement });
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
for (const element of statement.exportClause.elements) {
|
|
335
|
+
if (element.isTypeOnly)
|
|
336
|
+
continue;
|
|
337
|
+
exports.push({
|
|
338
|
+
node: element,
|
|
339
|
+
...(statement.moduleSpecifier
|
|
340
|
+
? {}
|
|
341
|
+
: { initializer: localInitializer(element.propertyName ?? element.name, bindings) }),
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return exports;
|
|
346
|
+
}
|
|
347
|
+
function localInitializer(expression, bindings, seen = new Set()) {
|
|
348
|
+
const target = unwrap(expression);
|
|
349
|
+
if (!ts.isIdentifier(target))
|
|
350
|
+
return target;
|
|
351
|
+
if (seen.has(target.text))
|
|
352
|
+
return undefined;
|
|
353
|
+
seen.add(target.text);
|
|
354
|
+
const initializer = bindings.get(target.text)?.initializer;
|
|
355
|
+
return initializer ? localInitializer(initializer, bindings, seen) : undefined;
|
|
356
|
+
}
|
|
357
|
+
function hasModifier(node, kind) {
|
|
358
|
+
return (ts.canHaveModifiers(node) &&
|
|
359
|
+
ts.getModifiers(node)?.some((modifier) => modifier.kind === kind) === true);
|
|
360
|
+
}
|
|
361
|
+
function curatedDeclarationIndex(statement) {
|
|
362
|
+
if (ts.isEmptyStatement(statement))
|
|
363
|
+
return true;
|
|
364
|
+
if (ts.isImportDeclaration(statement))
|
|
365
|
+
return statement.importClause !== undefined;
|
|
366
|
+
return (ts.isExportDeclaration(statement) &&
|
|
367
|
+
statement.exportClause !== undefined &&
|
|
368
|
+
ts.isNamedExports(statement.exportClause));
|
|
369
|
+
}
|
|
23
370
|
export const schemaRules = [
|
|
371
|
+
{
|
|
372
|
+
id: 'SCH-SUBMODULE',
|
|
373
|
+
ruleRevision: '8b226c1ec1f283372e048d40338f010ba97ae81230b4ebae63e48d533c7152c4',
|
|
374
|
+
evaluate(project) {
|
|
375
|
+
const layer = project.policy.layers.find(({ id }) => id === 'schema');
|
|
376
|
+
if (!layer)
|
|
377
|
+
return [];
|
|
378
|
+
const evidence = [];
|
|
379
|
+
const rootFiles = new Set(['index.ts', ...(layer.facade ? [layer.facade] : [])]);
|
|
380
|
+
const reportedRootDirectories = new Set();
|
|
381
|
+
const reportedModuleDirectories = new Set();
|
|
382
|
+
for (const file of project.files) {
|
|
383
|
+
if (file.layer !== 'schema')
|
|
384
|
+
continue;
|
|
385
|
+
const relative = file.path.slice(layer.sourcePath.length);
|
|
386
|
+
const segments = relative.split('/');
|
|
387
|
+
if (segments.length === 1) {
|
|
388
|
+
if (!rootFiles.has(relative)) {
|
|
389
|
+
evidence.push(violation(file, file.source, `Schema root source ${file.path} is flat; only ${[...rootFiles]
|
|
390
|
+
.map((name) => `${layer.sourcePath}${name}`)
|
|
391
|
+
.join(' and ')} may be flat.`));
|
|
392
|
+
}
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
const rootDirectory = segments[0];
|
|
396
|
+
if (!SCHEMA_ROOT_DIRECTORIES.has(rootDirectory)) {
|
|
397
|
+
if (!reportedRootDirectories.has(rootDirectory)) {
|
|
398
|
+
reportedRootDirectories.add(rootDirectory);
|
|
399
|
+
evidence.push(violation(file, file.source, `Schema source ${file.path} uses unknown root directory ${layer.sourcePath}${rootDirectory}/; expected one of ${SCHEMA_ROOT_DIRECTORY_LIST}.`));
|
|
400
|
+
}
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
403
|
+
if (rootDirectory !== 'modules')
|
|
404
|
+
continue;
|
|
405
|
+
if (segments.length === 2) {
|
|
406
|
+
evidence.push(violation(file, file.source, `Schema modules source ${file.path} is flat; declarations must belong to ${layer.sourcePath}modules/<module>/.`));
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const moduleName = segments[1];
|
|
410
|
+
if (segments.length === 3) {
|
|
411
|
+
if (segments[2] !== 'index.ts') {
|
|
412
|
+
evidence.push(violation(file, file.source, `Schema module source ${file.path} is flat; only ${layer.sourcePath}modules/${moduleName}/index.ts may be flat.`));
|
|
413
|
+
}
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
const kind = segments[2];
|
|
417
|
+
if (kind === '__tests__' || SCHEMA_KIND_DIRECTORIES.has(kind))
|
|
418
|
+
continue;
|
|
419
|
+
const directory = `${moduleName}/${kind}`;
|
|
420
|
+
if (reportedModuleDirectories.has(directory))
|
|
421
|
+
continue;
|
|
422
|
+
reportedModuleDirectories.add(directory);
|
|
423
|
+
evidence.push(violation(file, file.source, `Schema module source ${file.path} uses unknown declaration-kind directory ${kind}/; expected one of ${SCHEMA_KIND_LIST}, __tests__.`));
|
|
424
|
+
}
|
|
425
|
+
return evidence;
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
id: 'SCH-ONE-DECL',
|
|
430
|
+
ruleRevision: '62d059e983429281d3858d3d3e10573668cb5b59762247c3b47c8bb5ed99ee2d',
|
|
431
|
+
evaluate(project) {
|
|
432
|
+
const evidence = [];
|
|
433
|
+
for (const file of project.files) {
|
|
434
|
+
const owner = declarationKindFile(project, file);
|
|
435
|
+
if (!owner)
|
|
436
|
+
continue;
|
|
437
|
+
if (owner.index) {
|
|
438
|
+
const unsupported = file.source.statements.find((statement) => !curatedDeclarationIndex(statement));
|
|
439
|
+
if (unsupported) {
|
|
440
|
+
evidence.push(violation(file, unsupported, `Schema declaration-kind index ${file.path} owns a value or uses an uncurated export; keep index.ts limited to imports and named re-exports.`));
|
|
441
|
+
}
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
const contract = DECLARATION_KIND_CONTRACTS[owner.kind];
|
|
445
|
+
const exports = runtimeExports(file);
|
|
446
|
+
if (exports.length !== 1) {
|
|
447
|
+
evidence.push(violation(file, exports[0]?.node ?? file.source, `Schema ${owner.kind} leaf ${file.path} exports ${exports.length} runtime values; export exactly one locally authored ${contract.label} declaration.`));
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
if (!expectedDeclarationConstructor(file, exports[0]?.initializer, owner.kind)) {
|
|
451
|
+
evidence.push(violation(file, exports[0].node, `Schema ${owner.kind} leaf ${file.path} does not export one locally authored ${contract.label} declaration; only index.ts may re-export declarations.`));
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
454
|
+
const declarations = locallyConstructedDeclarations(file);
|
|
455
|
+
if (declarations.length !== 1) {
|
|
456
|
+
evidence.push(violation(file, declarations[1] ?? declarations[0] ?? exports[0].node, `Schema ${owner.kind} leaf ${file.path} constructs ${declarations.length} Schema declarations; construct exactly one ${contract.label} declaration.`));
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return evidence;
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
id: 'SCH-ICON-REQUIRED',
|
|
464
|
+
ruleRevision: 'f4055b93066289f9b7d9cfceb5ef236420f88311a357ea11161b6fda0922ab9f',
|
|
465
|
+
evaluate(project) {
|
|
466
|
+
return classIconEvidence(project, 'required');
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
id: 'SCH-ICON-NEUTRAL',
|
|
471
|
+
ruleRevision: '061939249964440ceba92dcb86f166553d56cc0196dff15785616423963d4d5b',
|
|
472
|
+
evaluate(project) {
|
|
473
|
+
return classIconEvidence(project, 'neutral');
|
|
474
|
+
},
|
|
475
|
+
},
|
|
24
476
|
{
|
|
25
477
|
id: 'SCH-STATE-SOURCE',
|
|
26
478
|
ruleRevision: '153bb37fbc7ddcf164dea299d6874251b6b2aeffa707e809044c5390f25b3fe6',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { actionRules } from './actions.js';
|
|
2
|
+
import { dependencyRules } from './dependencies.js';
|
|
2
3
|
import { globalRules } from './global.js';
|
|
3
4
|
import { integrationRules } from './integrations.js';
|
|
4
5
|
import { migrationRules } from './migrations.js';
|
|
@@ -21,6 +22,7 @@ export const sourceRuleVerifiers = Object.freeze([
|
|
|
21
22
|
...queryRules,
|
|
22
23
|
...mutationRules,
|
|
23
24
|
...workflowRules,
|
|
25
|
+
...dependencyRules,
|
|
24
26
|
...migrationRules,
|
|
25
27
|
...integrationRules,
|
|
26
28
|
...actionRules,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import {
|
|
3
|
-
import { ambiguity, calls,
|
|
2
|
+
import { propertyChain, unwrap, visit } from '../../adapters/typescript/index.js';
|
|
3
|
+
import { ambiguity, calls, production, staticId, violation } from './shared.js';
|
|
4
4
|
const STEP_METHODS = new Set(['run']);
|
|
5
5
|
export const workflowRules = [
|
|
6
6
|
{
|
|
@@ -65,38 +65,6 @@ export const workflowRules = [
|
|
|
65
65
|
return evidence;
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
|
-
{
|
|
69
|
-
id: 'FNC-XDOM-INT',
|
|
70
|
-
ruleRevision: 'ae5a879a6b19e26e33568cc47e0f5c34ba741df0e5dec663590923ceac4de264',
|
|
71
|
-
evaluate(project) {
|
|
72
|
-
const evidence = [];
|
|
73
|
-
for (const file of production(project, 'functions')) {
|
|
74
|
-
for (const sourceImport of file.imports) {
|
|
75
|
-
if (isForeignDomain(sourceImport.specifier)) {
|
|
76
|
-
evidence.push(violation(file, sourceImport.node, `Workflow imports foreign Domain ${sourceImport.specifier}; use an Integration.`));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
for (const definition of workflowDefinitions(file)) {
|
|
80
|
-
if (definition.origin === 'ambiguous') {
|
|
81
|
-
evidence.push(ambiguity(file, definition.call, 'Workflow definition resolves through a local facade whose ultimate public constructor origin is unknown.'));
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
const { run } = definition;
|
|
85
|
-
if (!run)
|
|
86
|
-
continue;
|
|
87
|
-
visitOwnBody(run, (node) => {
|
|
88
|
-
if (!ts.isCallExpression(node))
|
|
89
|
-
return;
|
|
90
|
-
const symbol = importedSymbol(file, node.expression);
|
|
91
|
-
if (symbol && isForeignDomain(symbol.module)) {
|
|
92
|
-
evidence.push(violation(file, node, `Workflow invokes foreign callable ${symbol.name} directly.`));
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return evidence;
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
68
|
{
|
|
101
69
|
id: 'FNC-NO-NEST',
|
|
102
70
|
ruleRevision: 'f2d818d1da69830c9ccaf183c5eb0310c795ab5da1a67871952aef1c2ef7600c',
|
|
@@ -147,7 +115,12 @@ function workflowDefinitions(file) {
|
|
|
147
115
|
const call = ts.isCallExpression(factory.parent) && factory.parent.expression === factory
|
|
148
116
|
? factory.parent
|
|
149
117
|
: factory;
|
|
150
|
-
const
|
|
118
|
+
const candidate = call.arguments.length === 2
|
|
119
|
+
? call.arguments[1]
|
|
120
|
+
: call.arguments.length === 3
|
|
121
|
+
? call.arguments[2]
|
|
122
|
+
: undefined;
|
|
123
|
+
const run = candidate && unwrap(candidate);
|
|
151
124
|
return {
|
|
152
125
|
call,
|
|
153
126
|
origin,
|