@contractspec/lib.contracts 1.44.1 → 1.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/app-config/app-config.feature.js +6 -6
- package/dist/app-config/contracts.d.ts +50 -50
- package/dist/app-config/contracts.js +13 -13
- package/dist/app-config/events.d.ts +27 -27
- package/dist/app-config/events.js +12 -12
- package/dist/app-config/lifecycle-contracts.d.ts +54 -54
- package/dist/app-config/lifecycle-contracts.js +19 -19
- package/dist/app-config/lifecycle.d.ts +2 -2
- package/dist/app-config/runtime.d.ts +3 -3
- package/dist/app-config/spec.d.ts +10 -12
- package/dist/app-config/spec.js +5 -26
- package/dist/capabilities/capabilities.d.ts +4 -11
- package/dist/capabilities/capabilities.js +3 -5
- package/dist/capabilities/openbanking.js +10 -10
- package/dist/client/react/form-render.js +1 -0
- package/dist/contract-registry/schemas.d.ts +2 -2
- package/dist/contract-registry/schemas.js +1 -1
- package/dist/contract-registry/types.d.ts +1 -1
- package/dist/data-views/data-views.js +1 -0
- package/dist/data-views/registry.d.ts +3 -37
- package/dist/data-views/registry.js +4 -66
- package/dist/data-views/runtime.d.ts +1 -1
- package/dist/data-views/runtime.js +2 -0
- package/dist/data-views/spec.d.ts +2 -2
- package/dist/docs/index.d.ts +2 -2
- package/dist/docs/index.js +2 -2
- package/dist/docs/presentations.d.ts +2 -4
- package/dist/docs/presentations.js +2 -4
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +1 -1
- package/dist/docs/tech/contracts/tests.docblock.js +1 -1
- package/dist/docs/tech-contracts.docs.js +1 -1
- package/dist/docs/types.d.ts +1 -1
- package/dist/events.d.ts +3 -3
- package/dist/examples/docs/examples.docblock.d.ts +6 -0
- package/dist/examples/docs/examples.docblock.js +165 -0
- package/dist/examples/index.d.ts +5 -0
- package/dist/examples/index.js +6 -0
- package/dist/examples/registry.d.ts +65 -0
- package/dist/examples/registry.js +144 -0
- package/dist/examples/schema.d.ts +282 -0
- package/dist/examples/schema.js +125 -0
- package/dist/examples/types.d.ts +167 -0
- package/dist/examples/types.js +43 -0
- package/dist/examples/validation.d.ts +65 -0
- package/dist/examples/validation.js +144 -0
- package/dist/experiments/docs/experiments.docblock.js +1 -1
- package/dist/experiments/evaluator.d.ts +1 -1
- package/dist/experiments/spec-resolver.d.ts +2 -2
- package/dist/experiments/spec.d.ts +6 -8
- package/dist/experiments/spec.js +5 -23
- package/dist/features/index.d.ts +9 -1
- package/dist/features/index.js +8 -1
- package/dist/features/install.js +2 -2
- package/dist/features/types.d.ts +7 -7
- package/dist/forms/forms.d.ts +2 -2
- package/dist/forms/forms.js +3 -6
- package/dist/index.d.ts +13 -8
- package/dist/index.js +11 -2
- package/dist/install.d.ts +9 -9
- package/dist/integrations/connection.d.ts +1 -1
- package/dist/integrations/integrations.feature.js +8 -8
- package/dist/integrations/openbanking/contracts/accounts.d.ts +66 -66
- package/dist/integrations/openbanking/contracts/accounts.js +3 -3
- package/dist/integrations/openbanking/contracts/balances.d.ts +34 -34
- package/dist/integrations/openbanking/contracts/balances.js +2 -2
- package/dist/integrations/openbanking/contracts/transactions.d.ts +48 -48
- package/dist/integrations/openbanking/contracts/transactions.js +2 -2
- package/dist/integrations/openbanking/models.d.ts +55 -55
- package/dist/integrations/openbanking/openbanking.feature.js +10 -10
- package/dist/integrations/operations.d.ts +102 -102
- package/dist/integrations/operations.js +10 -10
- package/dist/integrations/providers/elevenlabs.js +2 -2
- package/dist/integrations/providers/gcs-storage.js +2 -2
- package/dist/integrations/providers/gmail.js +3 -3
- package/dist/integrations/providers/google-calendar.js +2 -2
- package/dist/integrations/providers/mistral.js +3 -3
- package/dist/integrations/providers/postmark.js +2 -2
- package/dist/integrations/providers/powens.js +4 -4
- package/dist/integrations/providers/qdrant.js +3 -3
- package/dist/integrations/providers/stripe.js +2 -2
- package/dist/integrations/providers/twilio-sms.js +2 -2
- package/dist/integrations/runtime.d.ts +5 -5
- package/dist/integrations/spec.d.ts +3 -5
- package/dist/integrations/spec.js +5 -26
- package/dist/jobs/gcp-cloud-tasks.js +1 -1
- package/dist/jobs/gcp-pubsub.js +1 -1
- package/dist/jobs/handlers/ping-handler.d.ts +3 -3
- package/dist/jobs/handlers/ping-handler.js +2 -2
- package/dist/jobs/memory-queue.js +1 -1
- package/dist/jobs/queue.d.ts +4 -4
- package/dist/jobs/scaleway-sqs-queue.js +2 -2
- package/dist/jsonschema.d.ts +4 -4
- package/dist/knowledge/binding.d.ts +1 -1
- package/dist/knowledge/knowledge.feature.js +8 -8
- package/dist/knowledge/operations.d.ts +66 -66
- package/dist/knowledge/operations.js +12 -12
- package/dist/knowledge/source.d.ts +1 -1
- package/dist/knowledge/spaces/email-threads.js +2 -2
- package/dist/knowledge/spaces/financial-docs.js +2 -2
- package/dist/knowledge/spaces/financial-overview.js +2 -2
- package/dist/knowledge/spaces/product-canon.js +2 -2
- package/dist/knowledge/spaces/support-faq.js +2 -2
- package/dist/knowledge/spaces/uploaded-docs.js +2 -2
- package/dist/knowledge/spec.d.ts +3 -5
- package/dist/knowledge/spec.js +6 -28
- package/dist/llm/exporters.js +2 -2
- package/dist/llm/types.d.ts +4 -4
- package/dist/markdown.js +1 -1
- package/dist/migrations.d.ts +2 -2
- package/dist/migrations.js +7 -9
- package/dist/onboarding-base.d.ts +29 -29
- package/dist/onboarding-base.js +4 -4
- package/dist/openapi.js +9 -2
- package/dist/operations/operation.d.ts +3 -3
- package/dist/operations/registry.d.ts +9 -58
- package/dist/operations/registry.js +17 -93
- package/dist/ownership.d.ts +1 -1
- package/dist/policy/docs/policy.docblock.js +1 -1
- package/dist/policy/engine.js +2 -0
- package/dist/policy/spec.d.ts +1 -1
- package/dist/prompt.d.ts +6 -6
- package/dist/promptRegistry.d.ts +4 -4
- package/dist/promptRegistry.js +2 -5
- package/dist/regenerator/docs/regenerator.docblock.js +1 -1
- package/dist/regenerator/types.d.ts +1 -1
- package/dist/registry.d.ts +3 -2
- package/dist/registry.js +5 -5
- package/dist/resources.d.ts +5 -5
- package/dist/server/graphql-pothos.js +2 -2
- package/dist/server/mcp/registerTools.js +1 -1
- package/dist/server/rest-elysia.d.ts +1 -1
- package/dist/server/rest-elysia.js +1 -1
- package/dist/server/rest-express.d.ts +1 -1
- package/dist/server/rest-express.js +1 -1
- package/dist/server/rest-generic.d.ts +1 -1
- package/dist/server/rest-generic.js +1 -1
- package/dist/server/rest-next-app.d.ts +1 -1
- package/dist/server/rest-next-mcp.d.ts +1 -1
- package/dist/server/rest-next-mcp.js +1 -1
- package/dist/server/rest-next-pages.d.ts +1 -1
- package/dist/telemetry/docs/telemetry.docblock.js +1 -1
- package/dist/telemetry/spec.d.ts +7 -7
- package/dist/telemetry/spec.js +17 -44
- package/dist/telemetry/tracker.d.ts +2 -2
- package/dist/tests/runner.d.ts +1 -1
- package/dist/tests/spec.d.ts +5 -5
- package/dist/tests/spec.js +3 -5
- package/dist/themes.d.ts +4 -6
- package/dist/themes.js +5 -27
- package/dist/translations/catalog.d.ts +1 -1
- package/dist/types.d.ts +5 -5
- package/dist/workflow/adapters/db-adapter.js +3 -3
- package/dist/workflow/runner.d.ts +4 -2
- package/dist/workflow/spec.d.ts +4 -17
- package/dist/workflow/spec.js +4 -48
- package/dist/workflow/state.d.ts +1 -1
- package/dist/workflow/validation.js +1 -1
- package/dist/workspace-config/contractsrc-schema.d.ts +346 -346
- package/dist/workspace-config/contractsrc-schema.js +86 -86
- package/package.json +19 -12
package/dist/themes.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OwnerShipMeta } from "./ownership.js";
|
|
2
|
+
import { SpecContractRegistry } from "./registry.js";
|
|
2
3
|
|
|
3
4
|
//#region src/themes.d.ts
|
|
4
5
|
type ThemeScope = 'global' | 'tenant' | 'user';
|
|
@@ -40,13 +41,10 @@ interface ThemeSpec {
|
|
|
40
41
|
}
|
|
41
42
|
interface ThemeRef {
|
|
42
43
|
key: string;
|
|
43
|
-
version:
|
|
44
|
+
version: string;
|
|
44
45
|
}
|
|
45
|
-
declare class ThemeRegistry {
|
|
46
|
-
|
|
47
|
-
register(spec: ThemeSpec): this;
|
|
48
|
-
list(): ThemeSpec[];
|
|
49
|
-
get(key: string, version?: number): ThemeSpec | undefined;
|
|
46
|
+
declare class ThemeRegistry extends SpecContractRegistry<'theme', ThemeSpec> {
|
|
47
|
+
constructor(items?: ThemeSpec[]);
|
|
50
48
|
}
|
|
51
49
|
declare function makeThemeRef(spec: ThemeSpec): ThemeRef;
|
|
52
50
|
//#endregion
|
package/dist/themes.js
CHANGED
|
@@ -1,31 +1,9 @@
|
|
|
1
|
+
import { SpecContractRegistry } from "./registry.js";
|
|
2
|
+
|
|
1
3
|
//#region src/themes.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
register(spec) {
|
|
6
|
-
const key = themeKey(spec.meta);
|
|
7
|
-
if (this.items.has(key)) throw new Error(`Duplicate theme ${key}`);
|
|
8
|
-
this.items.set(key, spec);
|
|
9
|
-
return this;
|
|
10
|
-
}
|
|
11
|
-
list() {
|
|
12
|
-
return [...this.items.values()];
|
|
13
|
-
}
|
|
14
|
-
get(key, version) {
|
|
15
|
-
if (version != null) return this.items.get(themeKey({
|
|
16
|
-
key,
|
|
17
|
-
version
|
|
18
|
-
}));
|
|
19
|
-
let candidate;
|
|
20
|
-
let max = -Infinity;
|
|
21
|
-
for (const spec of this.items.values()) {
|
|
22
|
-
if (spec.meta.key !== key) continue;
|
|
23
|
-
if (spec.meta.version > max) {
|
|
24
|
-
max = spec.meta.version;
|
|
25
|
-
candidate = spec;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return candidate;
|
|
4
|
+
var ThemeRegistry = class extends SpecContractRegistry {
|
|
5
|
+
constructor(items) {
|
|
6
|
+
super("theme", items);
|
|
29
7
|
}
|
|
30
8
|
};
|
|
31
9
|
function makeThemeRef(spec) {
|
package/dist/types.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { ResolvedBranding } from "./app-config/branding.js";
|
|
|
5
5
|
import { Locale, MessageKey } from "./translations/catalog.js";
|
|
6
6
|
import { ResolvedAppConfig, ResolvedIntegration, ResolvedKnowledge, ResolvedTranslation } from "./app-config/runtime.js";
|
|
7
7
|
import { SecretProvider } from "./integrations/secrets/provider.js";
|
|
8
|
-
import { SpecVariantResolver } from "./experiments/spec-resolver.js";
|
|
9
8
|
import { EventRegistry } from "./events.js";
|
|
9
|
+
import { SpecVariantResolver } from "./experiments/spec-resolver.js";
|
|
10
10
|
|
|
11
11
|
//#region src/types.d.ts
|
|
12
12
|
/**
|
|
@@ -14,7 +14,7 @@ import { EventRegistry } from "./events.js";
|
|
|
14
14
|
*/
|
|
15
15
|
type Actor = 'anonymous' | 'user' | 'admin';
|
|
16
16
|
type Channel = 'web' | 'mobile' | 'job' | 'agent';
|
|
17
|
-
type ContractSpecType = 'app-config' | '
|
|
17
|
+
type ContractSpecType = 'app-config' | 'agent' | 'operation' | 'event' | 'presentation' | 'capability' | 'integration' | 'data-view' | 'feature' | 'workflow' | 'policy' | 'theme' | 'telemetry' | 'experiment' | 'knowledge-space';
|
|
18
18
|
interface FieldLevelDecision {
|
|
19
19
|
field: string;
|
|
20
20
|
effect: 'allow' | 'deny';
|
|
@@ -33,7 +33,7 @@ interface PolicyDecision {
|
|
|
33
33
|
interface PolicyDeciderInput {
|
|
34
34
|
service: string;
|
|
35
35
|
command: string;
|
|
36
|
-
version:
|
|
36
|
+
version: string;
|
|
37
37
|
actor: Actor;
|
|
38
38
|
channel?: Channel;
|
|
39
39
|
roles?: string[];
|
|
@@ -47,7 +47,7 @@ type TranslationResolver = (key: MessageKey, locale?: Locale) => Promise<string
|
|
|
47
47
|
/** Outbox/bus event publisher (after validation & guarding) */
|
|
48
48
|
type EventPublisher = (envelope: {
|
|
49
49
|
key: string;
|
|
50
|
-
version:
|
|
50
|
+
version: string;
|
|
51
51
|
payload: unknown;
|
|
52
52
|
traceId?: string;
|
|
53
53
|
}) => Promise<void>;
|
|
@@ -70,7 +70,7 @@ interface HandlerCtx {
|
|
|
70
70
|
/** Secret provider for secure credentials */
|
|
71
71
|
secretProvider?: SecretProvider;
|
|
72
72
|
/** Internal pipe: filled by executor to enforce declared events */
|
|
73
|
-
__emitGuard__?: (key: string, version:
|
|
73
|
+
__emitGuard__?: (key: string, version: string, payload: unknown) => Promise<void>;
|
|
74
74
|
/** Resolved application configuration for the current execution context */
|
|
75
75
|
appConfig?: ResolvedAppConfig;
|
|
76
76
|
/** Resolved integration connections available to this execution */
|
|
@@ -23,7 +23,7 @@ var PrismaStateStore = class {
|
|
|
23
23
|
return {
|
|
24
24
|
workflowId: record.id,
|
|
25
25
|
workflowName: record.name,
|
|
26
|
-
workflowVersion:
|
|
26
|
+
workflowVersion: record.version,
|
|
27
27
|
currentStep: record.currentStep,
|
|
28
28
|
data: record.data,
|
|
29
29
|
history: record.history,
|
|
@@ -51,7 +51,7 @@ var PrismaStateStore = class {
|
|
|
51
51
|
return {
|
|
52
52
|
workflowId: updated.id,
|
|
53
53
|
workflowName: updated.name,
|
|
54
|
-
workflowVersion:
|
|
54
|
+
workflowVersion: updated.version,
|
|
55
55
|
currentStep: updated.currentStep,
|
|
56
56
|
data: updated.data,
|
|
57
57
|
history: updated.history,
|
|
@@ -67,7 +67,7 @@ var PrismaStateStore = class {
|
|
|
67
67
|
return (await this.prisma.workflowState.findMany({ where })).map((record) => ({
|
|
68
68
|
workflowId: record.id,
|
|
69
69
|
workflowName: record.name,
|
|
70
|
-
workflowVersion:
|
|
70
|
+
workflowVersion: record.version,
|
|
71
71
|
currentStep: record.currentStep,
|
|
72
72
|
data: record.data,
|
|
73
73
|
history: record.history,
|
|
@@ -53,8 +53,10 @@ interface WorkflowRunnerConfig {
|
|
|
53
53
|
declare class WorkflowRunner {
|
|
54
54
|
private readonly config;
|
|
55
55
|
constructor(config: WorkflowRunnerConfig);
|
|
56
|
-
preFlightCheck(workflowName: string, version?:
|
|
57
|
-
|
|
56
|
+
preFlightCheck(workflowName: string, version?: string,
|
|
57
|
+
// Update to string
|
|
58
|
+
resolvedConfig?: ResolvedAppConfig): Promise<WorkflowPreFlightResult>;
|
|
59
|
+
start(workflowName: string, version?: string, initialData?: Record<string, unknown>): Promise<string>;
|
|
58
60
|
executeStep(workflowId: string, input?: unknown): Promise<void>;
|
|
59
61
|
rollback(workflowId: string): Promise<void>;
|
|
60
62
|
getState(workflowId: string): Promise<WorkflowState>;
|
package/dist/workflow/spec.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OwnerShipMeta } from "../ownership.js";
|
|
2
2
|
import { CapabilityRef } from "../capabilities/capabilities.js";
|
|
3
3
|
import "../capabilities/index.js";
|
|
4
|
+
import { SpecContractRegistry } from "../registry.js";
|
|
4
5
|
import { ExperimentRef } from "../experiments/spec.js";
|
|
5
|
-
import { GroupKeyFn, RegistryFilter } from "../registry-utils.js";
|
|
6
6
|
import { OpRef } from "../features/types.js";
|
|
7
7
|
import "../features/index.js";
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ import "../features/index.js";
|
|
|
12
12
|
*/
|
|
13
13
|
interface FormRef {
|
|
14
14
|
key: string;
|
|
15
|
-
version:
|
|
15
|
+
version: string;
|
|
16
16
|
}
|
|
17
17
|
type StepType = 'human' | 'automation' | 'decision';
|
|
18
18
|
type WorkflowStatus = 'running' | 'paused' | 'completed' | 'failed' | 'cancelled';
|
|
@@ -86,21 +86,8 @@ interface WorkflowSpec {
|
|
|
86
86
|
};
|
|
87
87
|
experiments?: ExperimentRef[];
|
|
88
88
|
}
|
|
89
|
-
declare class WorkflowRegistry {
|
|
90
|
-
|
|
91
|
-
register(spec: WorkflowSpec): this;
|
|
92
|
-
list(): WorkflowSpec[];
|
|
93
|
-
get(name: string, version?: number): WorkflowSpec | undefined;
|
|
94
|
-
/** Filter workflows by criteria. */
|
|
95
|
-
filter(criteria: RegistryFilter): WorkflowSpec[];
|
|
96
|
-
/** List workflows with specific tag. */
|
|
97
|
-
listByTag(tag: string): WorkflowSpec[];
|
|
98
|
-
/** List workflows by owner. */
|
|
99
|
-
listByOwner(owner: string): WorkflowSpec[];
|
|
100
|
-
/** Group workflows by key function. */
|
|
101
|
-
groupBy(keyFn: GroupKeyFn<WorkflowSpec>): Map<string, WorkflowSpec[]>;
|
|
102
|
-
/** Get unique tags from all workflows. */
|
|
103
|
-
getUniqueTags(): string[];
|
|
89
|
+
declare class WorkflowRegistry extends SpecContractRegistry<'workflow', WorkflowSpec> {
|
|
90
|
+
constructor(items?: WorkflowSpec[]);
|
|
104
91
|
}
|
|
105
92
|
//#endregion
|
|
106
93
|
export { CompensationStep, CompensationStrategy, FormRef, GuardCondition, GuardConditionKind, RetryPolicy, SLA, Step, StepAction, StepType, Transition, WorkflowDefinition, WorkflowMeta, WorkflowRegistry, WorkflowSpec, WorkflowStatus };
|
package/dist/workflow/spec.js
CHANGED
|
@@ -1,53 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SpecContractRegistry } from "../registry.js";
|
|
2
2
|
|
|
3
3
|
//#region src/workflow/spec.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
var WorkflowRegistry = class {
|
|
9
|
-
items = /* @__PURE__ */ new Map();
|
|
10
|
-
register(spec) {
|
|
11
|
-
const key = workflowKey(spec.meta);
|
|
12
|
-
if (this.items.has(key)) throw new Error(`Duplicate workflow ${key}`);
|
|
13
|
-
this.items.set(key, spec);
|
|
14
|
-
return this;
|
|
15
|
-
}
|
|
16
|
-
list() {
|
|
17
|
-
return [...this.items.values()];
|
|
18
|
-
}
|
|
19
|
-
get(name, version) {
|
|
20
|
-
if (version != null) return this.items.get(`${name}.v${version}`);
|
|
21
|
-
let candidate;
|
|
22
|
-
let max = -Infinity;
|
|
23
|
-
for (const spec of this.items.values()) {
|
|
24
|
-
if (spec.meta.key !== name) continue;
|
|
25
|
-
if (spec.meta.version > max) {
|
|
26
|
-
max = spec.meta.version;
|
|
27
|
-
candidate = spec;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return candidate;
|
|
31
|
-
}
|
|
32
|
-
/** Filter workflows by criteria. */
|
|
33
|
-
filter(criteria) {
|
|
34
|
-
return filterBy(this.list(), criteria);
|
|
35
|
-
}
|
|
36
|
-
/** List workflows with specific tag. */
|
|
37
|
-
listByTag(tag) {
|
|
38
|
-
return this.list().filter((w) => w.meta.tags?.includes(tag));
|
|
39
|
-
}
|
|
40
|
-
/** List workflows by owner. */
|
|
41
|
-
listByOwner(owner) {
|
|
42
|
-
return this.list().filter((w) => w.meta.owners?.includes(owner));
|
|
43
|
-
}
|
|
44
|
-
/** Group workflows by key function. */
|
|
45
|
-
groupBy(keyFn) {
|
|
46
|
-
return groupBy(this.list(), keyFn);
|
|
47
|
-
}
|
|
48
|
-
/** Get unique tags from all workflows. */
|
|
49
|
-
getUniqueTags() {
|
|
50
|
-
return getUniqueTags(this.list());
|
|
4
|
+
var WorkflowRegistry = class extends SpecContractRegistry {
|
|
5
|
+
constructor(items) {
|
|
6
|
+
super("workflow", items);
|
|
51
7
|
}
|
|
52
8
|
};
|
|
53
9
|
|
package/dist/workflow/state.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ function validateStepActions(steps, options, issues) {
|
|
|
113
113
|
const action = step.action;
|
|
114
114
|
if (!action) continue;
|
|
115
115
|
if (action.operation && options.operations) {
|
|
116
|
-
if (!options.operations.
|
|
116
|
+
if (!options.operations.get(action.operation.key, action.operation.version)) issues.push({
|
|
117
117
|
level: "error",
|
|
118
118
|
message: `Step "${step.id}" references unknown operation ${action.operation.key}.v${action.operation.version}.`
|
|
119
119
|
});
|