@contractspec/lib.contracts 1.46.2 → 1.48.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/app-config/app-config.capability.d.ts +7 -0
- package/dist/app-config/app-config.capability.js +23 -0
- package/dist/app-config/app-config.feature.d.ts +1 -2
- package/dist/app-config/app-config.feature.js +9 -2
- package/dist/app-config/contracts.d.ts +50 -50
- package/dist/app-config/events.d.ts +27 -27
- package/dist/app-config/index.d.ts +4 -3
- package/dist/app-config/index.js +3 -2
- package/dist/app-config/lifecycle-contracts.d.ts +1 -1
- package/dist/app-config/runtime.d.ts +6 -6
- package/dist/app-config/spec.d.ts +9 -5
- package/dist/app-config/spec.js +5 -1
- package/dist/contract-registry/schemas.d.ts +2 -2
- package/dist/data-views/runtime.d.ts +5 -1
- package/dist/data-views/runtime.js +34 -7
- package/dist/data-views/spec.d.ts +1 -1
- package/dist/docs/index.js +2 -1
- package/dist/docs/tech/cli.docblock.d.ts +6 -0
- package/dist/docs/tech/cli.docblock.js +138 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +106 -1
- package/dist/docs/tech/studio/project-access-teams.docblock.js +3 -1
- package/dist/examples/index.d.ts +9 -1
- package/dist/examples/index.js +8 -1
- package/dist/examples/registry.d.ts +3 -25
- package/dist/examples/registry.js +4 -60
- package/dist/examples/schema.d.ts +14 -14
- package/dist/examples/types.d.ts +1 -1
- package/dist/features/types.d.ts +1 -1
- package/dist/index.d.ts +27 -26
- package/dist/index.js +6 -6
- package/dist/install.d.ts +1 -1
- package/dist/integrations/index.d.ts +2 -2
- package/dist/integrations/index.js +2 -2
- package/dist/integrations/integrations.capability.d.ts +7 -0
- package/dist/integrations/integrations.capability.js +17 -0
- package/dist/integrations/integrations.feature.d.ts +1 -2
- package/dist/integrations/integrations.feature.js +9 -2
- package/dist/integrations/openbanking/models.d.ts +55 -55
- package/dist/integrations/openbanking/openbanking.capability.d.ts +7 -0
- package/dist/integrations/openbanking/openbanking.capability.js +21 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +1 -2
- package/dist/integrations/openbanking/openbanking.feature.js +9 -2
- package/dist/integrations/operations.d.ts +102 -102
- package/dist/integrations/providers/elevenlabs.d.ts +1 -0
- package/dist/integrations/providers/elevenlabs.js +3 -2
- package/dist/integrations/providers/gcs-storage.d.ts +1 -0
- package/dist/integrations/providers/gcs-storage.js +3 -2
- package/dist/integrations/providers/gmail.d.ts +1 -0
- package/dist/integrations/providers/gmail.js +3 -2
- package/dist/integrations/providers/google-calendar.d.ts +1 -0
- package/dist/integrations/providers/google-calendar.js +3 -2
- package/dist/integrations/providers/impls/provider-factory.js +2 -1
- package/dist/integrations/providers/mistral.d.ts +1 -0
- package/dist/integrations/providers/mistral.js +3 -2
- package/dist/integrations/providers/postmark.d.ts +1 -0
- package/dist/integrations/providers/postmark.js +3 -2
- package/dist/integrations/providers/powens.d.ts +1 -0
- package/dist/integrations/providers/powens.js +3 -2
- package/dist/integrations/providers/qdrant.d.ts +1 -0
- package/dist/integrations/providers/qdrant.js +3 -2
- package/dist/integrations/providers/stripe.d.ts +1 -0
- package/dist/integrations/providers/stripe.js +3 -2
- package/dist/integrations/providers/twilio-sms.d.ts +1 -0
- package/dist/integrations/providers/twilio-sms.js +3 -2
- package/dist/integrations/spec.d.ts +5 -1
- package/dist/integrations/spec.js +5 -1
- package/dist/knowledge/knowledge.capability.d.ts +7 -0
- package/dist/knowledge/knowledge.capability.js +21 -0
- package/dist/knowledge/knowledge.feature.d.ts +1 -2
- package/dist/knowledge/knowledge.feature.js +9 -2
- package/dist/knowledge/operations.d.ts +66 -66
- package/dist/llm/exporters.d.ts +1 -1
- package/dist/llm/types.d.ts +1 -1
- package/dist/onboarding-base.d.ts +29 -29
- package/dist/operations/operation.d.ts +1 -1
- package/dist/server/mcp/createMcpServer.js +1 -1
- package/dist/server/mcp/mcpTypes.d.ts +1 -1
- package/dist/server/mcp/registerPresentations.js +1 -1
- package/dist/server/mcp/registerResources.js +2 -2
- package/dist/tests/index.d.ts +2 -2
- package/dist/tests/index.js +2 -2
- package/dist/tests/spec.d.ts +2 -1
- package/dist/tests/spec.js +4 -1
- package/dist/types.d.ts +2 -2
- package/dist/workflow/index.d.ts +8 -1
- package/dist/workflow/index.js +8 -1
- package/dist/workflow/runner.d.ts +2 -2
- package/dist/workflow/spec.d.ts +1 -1
- package/dist/workflow/validation.d.ts +1 -1
- package/dist/workspace-config/contractsrc-schema.d.ts +45 -974
- package/dist/workspace-config/contractsrc-schema.js +89 -55
- package/dist/workspace-config/contractsrc-types.d.ts +346 -0
- package/dist/workspace-config/contractsrc-types.js +0 -0
- package/dist/workspace-config/index.d.ts +3 -2
- package/package.json +27 -25
- package/dist/docs/tech/contracts/create-subscription.docblock.d.ts +0 -6
- package/dist/docs/tech/contracts/create-subscription.docblock.js +0 -21
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.d.ts +0 -6
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.js +0 -21
- package/dist/docs/tech/templates/runtime.docblock.d.ts +0 -6
- package/dist/docs/tech/templates/runtime.docblock.js +0 -21
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { OperationSpecRegistry } from "../operations/registry.js";
|
|
2
|
+
import "../operations/index.js";
|
|
1
3
|
import { DataViewSpec } from "./spec.js";
|
|
2
4
|
import { DataViewRegistry } from "./registry.js";
|
|
3
5
|
import "./index.js";
|
|
6
|
+
import { HandlerCtx } from "../types.js";
|
|
4
7
|
|
|
5
8
|
//#region src/data-views/runtime.d.ts
|
|
6
9
|
interface DataViewRuntimeConfig {
|
|
7
10
|
registry: DataViewRegistry;
|
|
11
|
+
operationRegistry: OperationSpecRegistry;
|
|
8
12
|
}
|
|
9
13
|
interface DataViewResult<T = unknown> {
|
|
10
14
|
data: T[];
|
|
@@ -19,7 +23,7 @@ declare class DataViewRuntime {
|
|
|
19
23
|
constructor(config: DataViewRuntimeConfig);
|
|
20
24
|
register(spec: DataViewSpec): void;
|
|
21
25
|
getSpec(name: string, version?: string): DataViewSpec | undefined;
|
|
22
|
-
executeQuery(specName: string,
|
|
26
|
+
executeQuery(specName: string, params: unknown, ctx: HandlerCtx): Promise<DataViewResult>;
|
|
23
27
|
invalidate(specName: string): void;
|
|
24
28
|
subscribe(specName: string, callback: () => void): () => void;
|
|
25
29
|
private notifySubscribers;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import "../operations/index.js";
|
|
1
2
|
import "./index.js";
|
|
2
3
|
|
|
3
4
|
//#region src/data-views/runtime.ts
|
|
5
|
+
function isPaginatedResult(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && "items" in value && Array.isArray(value.items);
|
|
7
|
+
}
|
|
4
8
|
var DataViewRuntime = class {
|
|
5
9
|
cache = /* @__PURE__ */ new Map();
|
|
6
10
|
subscriptions = /* @__PURE__ */ new Map();
|
|
@@ -13,13 +17,36 @@ var DataViewRuntime = class {
|
|
|
13
17
|
getSpec(name, version) {
|
|
14
18
|
return this.config.registry.get(name, version);
|
|
15
19
|
}
|
|
16
|
-
async executeQuery(specName,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
async executeQuery(specName, params, ctx) {
|
|
21
|
+
const spec = this.getSpec(specName);
|
|
22
|
+
if (!spec) throw new Error(`DataView spec not found: ${specName}`);
|
|
23
|
+
const opRef = spec.source.primary;
|
|
24
|
+
if (!opRef) throw new Error(`DataView spec ${specName} missing primary source`);
|
|
25
|
+
try {
|
|
26
|
+
const result = await this.config.operationRegistry.execute(opRef.key, opRef.version, params, ctx);
|
|
27
|
+
if (Array.isArray(result)) return {
|
|
28
|
+
data: result,
|
|
29
|
+
total: result.length,
|
|
30
|
+
loading: false
|
|
31
|
+
};
|
|
32
|
+
if (isPaginatedResult(result)) return {
|
|
33
|
+
data: result.items,
|
|
34
|
+
total: result.total ?? result.items.length,
|
|
35
|
+
loading: false
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
data: [result],
|
|
39
|
+
total: 1,
|
|
40
|
+
loading: false
|
|
41
|
+
};
|
|
42
|
+
} catch (error) {
|
|
43
|
+
return {
|
|
44
|
+
data: [],
|
|
45
|
+
total: 0,
|
|
46
|
+
loading: false,
|
|
47
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
48
|
+
};
|
|
49
|
+
}
|
|
23
50
|
}
|
|
24
51
|
invalidate(specName) {
|
|
25
52
|
this.cache.delete(specName);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataViewConfig, DataViewMeta, DataViewSource, DataViewStates } from "./types.js";
|
|
2
1
|
import { ExperimentRef } from "../experiments/spec.js";
|
|
2
|
+
import { DataViewConfig, DataViewMeta, DataViewSource, DataViewStates } from "./types.js";
|
|
3
3
|
|
|
4
4
|
//#region src/data-views/spec.d.ts
|
|
5
5
|
|
package/dist/docs/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import "./tech/lifecycle-stage-system.docblock.js";
|
|
|
7
7
|
import "./tech/presentation-runtime.docblock.js";
|
|
8
8
|
import "./tech/auth/better-auth-nextjs.docblock.js";
|
|
9
9
|
import "./tech/schema/README.docblock.js";
|
|
10
|
-
import "./tech/templates/runtime.docblock.js";
|
|
11
10
|
import "../workflow/overview.docblock.js";
|
|
12
11
|
import "./tech/mcp-endpoints.docblock.js";
|
|
13
12
|
import "./tech/vscode-extension.docblock.js";
|
|
14
13
|
import "./tech/telemetry-ingest.docblock.js";
|
|
14
|
+
import "./tech/contracts/README.docblock.js";
|
|
15
15
|
import "./tech/contracts/openapi-export.docblock.js";
|
|
16
16
|
import "./tech/contracts/openapi-import.docblock.js";
|
|
17
17
|
import "../workspace-config/workspace-config.docblock.js";
|
|
@@ -25,5 +25,6 @@ import "./tech/studio/learning-journeys.docblock.js";
|
|
|
25
25
|
import "./tech/studio/project-access-teams.docblock.js";
|
|
26
26
|
import "./tech/studio/team-invitations.docblock.js";
|
|
27
27
|
import "./tech/llm/llm-integration.docblock.js";
|
|
28
|
+
import "./tech/cli.docblock.js";
|
|
28
29
|
|
|
29
30
|
export { DocRegistry, defaultDocRegistry, docBlockToPresentationSpec, docBlocksToPresentationRoutes, docBlocksToPresentationSpecs, docId, listRegisteredDocBlocks, mapDocRoutes, metaDocs, registerDocBlocks, techContractsDocs };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech/cli.docblock.ts
|
|
4
|
+
const tech_cli_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.cli.contractspec",
|
|
6
|
+
title: "ContractSpec CLI",
|
|
7
|
+
summary: "The command-line interface for creating, building, and validating contract specifications.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/cli/contractspec",
|
|
11
|
+
tags: [
|
|
12
|
+
"cli",
|
|
13
|
+
"tooling",
|
|
14
|
+
"reference"
|
|
15
|
+
],
|
|
16
|
+
owners: ["@contractspec/app.cli-contractspec"],
|
|
17
|
+
body: `# ContractSpec CLI
|
|
18
|
+
|
|
19
|
+
The \`@contractspec/app.cli-contractspec\` package provides the command-line interface for the ContractSpec ecosystem.
|
|
20
|
+
|
|
21
|
+
It is also exposed via \`@contractspec/apps-registry/contractspec\` for convenience.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
\`\`\`bash
|
|
26
|
+
bun add -D @contractspec/app.cli-contractspec
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
\`\`\`bash
|
|
32
|
+
# Create a new contract spec interactively
|
|
33
|
+
contractspec create
|
|
34
|
+
|
|
35
|
+
# Create with AI assistance
|
|
36
|
+
contractspec create --ai
|
|
37
|
+
|
|
38
|
+
# Build implementation from spec
|
|
39
|
+
contractspec build src/contracts/mySpec.ts
|
|
40
|
+
|
|
41
|
+
# Validate a spec
|
|
42
|
+
contractspec validate src/contracts/mySpec.ts
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
## Core Commands
|
|
46
|
+
|
|
47
|
+
### \`create\`
|
|
48
|
+
|
|
49
|
+
Interactive wizard to create contract specifications.
|
|
50
|
+
|
|
51
|
+
\`\`\`bash
|
|
52
|
+
contractspec create --type operation --ai
|
|
53
|
+
\`\`\`
|
|
54
|
+
|
|
55
|
+
### \`build\`
|
|
56
|
+
|
|
57
|
+
Generate implementation code from contract specs using AI agents or templates.
|
|
58
|
+
|
|
59
|
+
\`\`\`bash
|
|
60
|
+
contractspec build src/contracts/signup.contracts.ts --agent-mode claude-code
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
### \`validate\`
|
|
64
|
+
|
|
65
|
+
Validate contract specifications and verify implementations.
|
|
66
|
+
|
|
67
|
+
\`\`\`bash
|
|
68
|
+
contractspec validate src/contracts/signup.contracts.ts --check-implementation
|
|
69
|
+
\`\`\`
|
|
70
|
+
|
|
71
|
+
### \`watch\`
|
|
72
|
+
|
|
73
|
+
Watch contract specifications and auto-regenerate on changes.
|
|
74
|
+
|
|
75
|
+
\`\`\`bash
|
|
76
|
+
contractspec watch --build --validate
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
### \`list\`
|
|
80
|
+
|
|
81
|
+
List all contract specifications in the project.
|
|
82
|
+
|
|
83
|
+
\`\`\`bash
|
|
84
|
+
contractspec list --owner @team-platform
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
### \`cleanup\` / \`clean\`
|
|
88
|
+
|
|
89
|
+
Clean generated files and build artifacts.
|
|
90
|
+
|
|
91
|
+
\`\`\`bash
|
|
92
|
+
contractspec clean
|
|
93
|
+
\`\`\`
|
|
94
|
+
|
|
95
|
+
### \`deps\`
|
|
96
|
+
|
|
97
|
+
Analyze contract dependencies and relationships (circular dependencies, missing refs).
|
|
98
|
+
|
|
99
|
+
\`\`\`bash
|
|
100
|
+
contractspec deps --circular
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
### \`diff\`
|
|
104
|
+
|
|
105
|
+
Compare contract specifications and show differences (breaking changes, semantic diff).
|
|
106
|
+
|
|
107
|
+
\`\`\`bash
|
|
108
|
+
contractspec diff spec1.ts spec2.ts --breaking
|
|
109
|
+
\`\`\`
|
|
110
|
+
|
|
111
|
+
### \`ci\`
|
|
112
|
+
|
|
113
|
+
Run all validation checks for CI/CD pipelines (structure, integrity, deps, doctor, handlers, tests).
|
|
114
|
+
|
|
115
|
+
\`\`\`bash
|
|
116
|
+
contractspec ci --format sarif --output results.sarif
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
The CLI is configured via \`.contractsrc.json\` in your project root.
|
|
122
|
+
|
|
123
|
+
\`\`\`json
|
|
124
|
+
{
|
|
125
|
+
"aiProvider": "claude",
|
|
126
|
+
"aiModel": "claude-3-7-sonnet-20250219",
|
|
127
|
+
"agentMode": "claude-code",
|
|
128
|
+
"outputDir": "./src"
|
|
129
|
+
}
|
|
130
|
+
\`\`\`
|
|
131
|
+
|
|
132
|
+
For full documentation, refer to the [package README](https://github.com/contractspec/monorepo/tree/main/packages/apps/cli-contractspec).
|
|
133
|
+
`
|
|
134
|
+
}];
|
|
135
|
+
registerDocBlocks(tech_cli_DocBlocks);
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { tech_cli_DocBlocks };
|
|
@@ -13,7 +13,112 @@ const tech_contracts_vertical_pocket_family_office_DocBlocks = [{
|
|
|
13
13
|
"contracts",
|
|
14
14
|
"vertical-pocket-family-office"
|
|
15
15
|
],
|
|
16
|
-
body:
|
|
16
|
+
body: `# Pocket Family Office Vertical
|
|
17
|
+
|
|
18
|
+
Pocket Family Office is a ContractSpec reference vertical that
|
|
19
|
+
demonstrates finance automation atop the integration and knowledge
|
|
20
|
+
layers. It is optimised for the hackathon stack (Google Cloud, Mistral,
|
|
21
|
+
Qdrant, ElevenLabs) while remaining provider-agnostic.
|
|
22
|
+
|
|
23
|
+
## Goals
|
|
24
|
+
|
|
25
|
+
- Ingest household financial documents (uploads + Gmail threads).
|
|
26
|
+
- Generate AI summaries and optionally deliver them as voice notes.
|
|
27
|
+
- Schedule multi-channel reminders for upcoming bills.
|
|
28
|
+
- Showcase spec-first composition of integrations, knowledge spaces, and
|
|
29
|
+
workflows.
|
|
30
|
+
|
|
31
|
+
## Blueprint Overview
|
|
32
|
+
|
|
33
|
+
Source: \`packages/examples/pocket-family-office/blueprint.ts\`
|
|
34
|
+
|
|
35
|
+
- **Integration slots**
|
|
36
|
+
- \`primaryLLM\` \u2192 Mistral chat/embeddings
|
|
37
|
+
- \`primaryVectorDb\` \u2192 Qdrant
|
|
38
|
+
- \`primaryStorage\` \u2192 Google Cloud Storage
|
|
39
|
+
- \`primaryOpenBanking\` \u2192 Powens BYOK project for account aggregation
|
|
40
|
+
- \`emailInbound\` / \`emailOutbound\` \u2192 Gmail + Postmark
|
|
41
|
+
- \`calendarScheduling\` \u2192 Google Calendar
|
|
42
|
+
- \`voicePlayback\` \u2192 ElevenLabs (optional)
|
|
43
|
+
- \`smsNotifications\` \u2192 Twilio (optional)
|
|
44
|
+
- \`paymentsProcessing\` \u2192 Stripe (optional)
|
|
45
|
+
- **Workflows**
|
|
46
|
+
- \`process-uploaded-document\`
|
|
47
|
+
- \`upcoming-payments-reminder\`
|
|
48
|
+
- \`generate-financial-summary\`
|
|
49
|
+
- \`ingest-email-threads\`
|
|
50
|
+
- \`sync-openbanking-accounts\`
|
|
51
|
+
- \`sync-openbanking-transactions\`
|
|
52
|
+
- \`refresh-openbanking-balances\`
|
|
53
|
+
- \`generate-openbanking-overview\`
|
|
54
|
+
- **Policies/Telemetry** \u2013 references tenant policy specs and
|
|
55
|
+
\`pfo.telemetry\` for observability.
|
|
56
|
+
|
|
57
|
+
## Tenant Sample
|
|
58
|
+
|
|
59
|
+
\`tenant.sample.ts\` binds each slot to sample connections defined in
|
|
60
|
+
\`connections/samples.ts\`. Key details:
|
|
61
|
+
|
|
62
|
+
- Uses Google Cloud Secret Manager URIs for all credentials.
|
|
63
|
+
- Enables knowledge spaces \`knowledge.financial-docs\` and
|
|
64
|
+
\`knowledge.email-threads\`, plus the derived summaries space
|
|
65
|
+
\`knowledge.financial-overview\` populated by open banking workflows.
|
|
66
|
+
- Keeps \`voicePlayback\` and \`paymentsProcessing\` optional so tenants can
|
|
67
|
+
enable them incrementally.
|
|
68
|
+
|
|
69
|
+
## Contracts
|
|
70
|
+
|
|
71
|
+
\`contracts/index.ts\` defines command/query specs that power the
|
|
72
|
+
workflows:
|
|
73
|
+
|
|
74
|
+
- \`pfo.documents.upload\` \u2013 store object + enqueue ingestion.
|
|
75
|
+
- \`pfo.reminders.schedule-payment\` \u2013 send email/SMS/calendar reminders.
|
|
76
|
+
- \`pfo.summary.generate\` \u2013 run RAG over knowledge spaces.
|
|
77
|
+
- \`pfo.summary.dispatch\` \u2013 deliver summaries via email / voice.
|
|
78
|
+
- \`pfo.email.sync-threads\` \u2013 ingest Gmail threads.
|
|
79
|
+
|
|
80
|
+
## Workflows
|
|
81
|
+
|
|
82
|
+
- **Process Uploaded Document**
|
|
83
|
+
1. Upload to storage / queue ingestion.
|
|
84
|
+
2. Optional human review step.
|
|
85
|
+
- **Upcoming Payments Reminder**
|
|
86
|
+
1. Human review (confirm due date / channel).
|
|
87
|
+
2. Automation schedules reminders (email/SMS/calendar).
|
|
88
|
+
- **Generate Financial Summary**
|
|
89
|
+
1. Run RAG to produce Markdown summary.
|
|
90
|
+
2. Dispatch summary (email + optional ElevenLabs voice note).
|
|
91
|
+
- **Ingest Email Threads**
|
|
92
|
+
1. Sync Gmail threads into knowledge space.
|
|
93
|
+
2. Triage step for operators when nothing new is ingested.
|
|
94
|
+
|
|
95
|
+
## Knowledge & Jobs
|
|
96
|
+
|
|
97
|
+
- Knowledge spaces registered via
|
|
98
|
+
\`registerFinancialDocsKnowledgeSpace\` and
|
|
99
|
+
\`registerEmailThreadsKnowledgeSpace\`.
|
|
100
|
+
- Ingestion adapters (\`GmailIngestionAdapter\`, \`StorageIngestionAdapter\`)
|
|
101
|
+
and job handlers (\`createGmailSyncHandler\`,
|
|
102
|
+
\`createStorageDocumentHandler\`) wire Gmail labels & GCS prefixes into
|
|
103
|
+
Qdrant.
|
|
104
|
+
- \`KnowledgeQueryService\` provides summarisation + references for the
|
|
105
|
+
summary generation workflow.
|
|
106
|
+
|
|
107
|
+
## Tests & Usage
|
|
108
|
+
|
|
109
|
+
\`tests/pocket-family-office.test.ts\` exercises:
|
|
110
|
+
|
|
111
|
+
- Blueprint validation + config composition.
|
|
112
|
+
- In-memory ingestion of a sample invoice.
|
|
113
|
+
- Retrieval augmented generation producing a summary with references.
|
|
114
|
+
|
|
115
|
+
Use these files as scaffolding for new tenants or as a template for the
|
|
116
|
+
hackathon deliverable. Replace the sample connection metadata with
|
|
117
|
+
tenant-specific IDs/secret references before deploying.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
`
|
|
17
122
|
}];
|
|
18
123
|
registerDocBlocks(tech_contracts_vertical_pocket_family_office_DocBlocks);
|
|
19
124
|
|
|
@@ -33,7 +33,9 @@ Studio access control is **organization-first** with optional **team-based shari
|
|
|
33
33
|
|
|
34
34
|
## GraphQL surfaces
|
|
35
35
|
|
|
36
|
-
- Read
|
|
36
|
+
- Read:
|
|
37
|
+
- \`myStudioProjects\` (returns only projects you can access)\n - \`studioProjectBySlug(slug)\` (enforces the same access rules)\n - \`myTeams\`\n - \`projectTeams(projectId)\`\n\n- Write:\n - \`createStudioProject(input.teamIds?)\` (teamIds optional)\n - \`setProjectTeams(projectId, teamIds)\` (admin-only)\n
|
|
38
|
+
|
|
37
39
|
## Related\n+\n+- Team administration + invitations: see \`/docs/tech/studio/team-invitations\`.\n+
|
|
38
40
|
## Notes
|
|
39
41
|
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -2,4 +2,12 @@ import { ExampleDocumentation, ExampleEntrypoints, ExampleKind, ExampleKindEnum,
|
|
|
2
2
|
import { ExampleDocumentationSchema, ExampleEntrypointsSchema, ExampleKindSchema, ExampleMetaSchema, ExampleSandboxModeSchema, ExampleSpecSchema, ExampleSurfacesSchema, ExampleVisibilitySchema, parseExampleDocumentation, parseExampleEntrypoints, parseExampleMeta, parseExampleSpec, parseExampleSurfaces, safeParseExampleSpec } from "./schema.js";
|
|
3
3
|
import { ExampleRegistry } from "./registry.js";
|
|
4
4
|
import { CrossValidationContext, ExampleValidationError, ExampleValidationWarning, ValidateExampleResult, ValidateExamplesResult, validateExample, validateExampleReferences, validateExamples } from "./validation.js";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
//#region src/examples/index.d.ts
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Helper to define an Example.
|
|
10
|
+
*/
|
|
11
|
+
declare const defineExample: (spec: ExampleSpec) => ExampleSpec;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { type CrossValidationContext, type ExampleDocumentation, ExampleDocumentationSchema, type ExampleEntrypoints, ExampleEntrypointsSchema, type ExampleKind, ExampleKindEnum, ExampleKindSchema, type ExampleMcpSupport, type ExampleMeta, ExampleMetaSchema, ExampleRegistry, type ExampleSandboxMode, ExampleSandboxModeEnum, ExampleSandboxModeSchema, type ExampleSandboxSupport, type ExampleSpec, ExampleSpecSchema, type ExampleStudioSupport, type ExampleSurfaces, ExampleSurfacesSchema, type ExampleValidationError, type ExampleValidationWarning, type ExampleVisibility, ExampleVisibilityEnum, ExampleVisibilitySchema, type ValidateExampleResult, type ValidateExamplesResult, defineExample, isExampleKind, isExampleVisibility, isFeatureRef, isSpecPointer, parseExampleDocumentation, parseExampleEntrypoints, parseExampleMeta, parseExampleSpec, parseExampleSurfaces, safeParseExampleSpec, validateExample, validateExampleReferences, validateExamples };
|
package/dist/examples/index.js
CHANGED
|
@@ -3,4 +3,11 @@ import { ExampleDocumentationSchema, ExampleEntrypointsSchema, ExampleKindSchema
|
|
|
3
3
|
import { ExampleRegistry } from "./registry.js";
|
|
4
4
|
import { validateExample, validateExampleReferences, validateExamples } from "./validation.js";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
//#region src/examples/index.ts
|
|
7
|
+
/**
|
|
8
|
+
* Helper to define an Example.
|
|
9
|
+
*/
|
|
10
|
+
const defineExample = (spec) => spec;
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ExampleDocumentationSchema, ExampleEntrypointsSchema, ExampleKindEnum, ExampleKindSchema, ExampleMetaSchema, ExampleRegistry, ExampleSandboxModeEnum, ExampleSandboxModeSchema, ExampleSpecSchema, ExampleSurfacesSchema, ExampleVisibilityEnum, ExampleVisibilitySchema, defineExample, isExampleKind, isExampleVisibility, isFeatureRef, isSpecPointer, parseExampleDocumentation, parseExampleEntrypoints, parseExampleMeta, parseExampleSpec, parseExampleSurfaces, safeParseExampleSpec, validateExample, validateExampleReferences, validateExamples };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SpecContractRegistry } from "../registry.js";
|
|
2
2
|
import { ExampleKind, ExampleSpec, ExampleVisibility } from "./types.js";
|
|
3
3
|
|
|
4
4
|
//#region src/examples/registry.d.ts
|
|
@@ -18,42 +18,20 @@ import { ExampleKind, ExampleSpec, ExampleVisibility } from "./types.js";
|
|
|
18
18
|
* const publicExamples = registry.listByVisibility('public');
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
declare class ExampleRegistry {
|
|
22
|
-
|
|
23
|
-
/** Register an example. Throws when the key already exists. */
|
|
24
|
-
register(spec: ExampleSpec): this;
|
|
25
|
-
/** List all registered examples. */
|
|
26
|
-
list(): ExampleSpec[];
|
|
27
|
-
/** Get an example by its key. */
|
|
28
|
-
get(key: string, version?: string): ExampleSpec | undefined;
|
|
29
|
-
/** Check if an example with the given key exists. */
|
|
30
|
-
has(key: string, version?: string): boolean;
|
|
31
|
-
/** Get the number of registered examples. */
|
|
32
|
-
get size(): number;
|
|
33
|
-
/** Clear all registered examples. */
|
|
34
|
-
clear(): void;
|
|
35
|
-
/** Filter examples by criteria. */
|
|
36
|
-
filter(criteria: RegistryFilter): ExampleSpec[];
|
|
21
|
+
declare class ExampleRegistry extends SpecContractRegistry<'example', ExampleSpec> {
|
|
22
|
+
constructor(items?: ExampleSpec[]);
|
|
37
23
|
/** List examples by kind. */
|
|
38
24
|
listByKind(kind: ExampleKind): ExampleSpec[];
|
|
39
25
|
/** List examples by visibility. */
|
|
40
26
|
listByVisibility(visibility: ExampleVisibility): ExampleSpec[];
|
|
41
|
-
/** List examples with specific tag. */
|
|
42
|
-
listByTag(tag: string): ExampleSpec[];
|
|
43
|
-
/** List examples by owner. */
|
|
44
|
-
listByOwner(owner: string): ExampleSpec[];
|
|
45
27
|
/** List examples by domain. */
|
|
46
28
|
listByDomain(domain: string): ExampleSpec[];
|
|
47
29
|
/** List examples that support a specific surface. */
|
|
48
30
|
listBySurface(surface: 'templates' | 'sandbox' | 'studio' | 'mcp'): ExampleSpec[];
|
|
49
31
|
/** List examples that are installable via Studio. */
|
|
50
32
|
listInstallable(): ExampleSpec[];
|
|
51
|
-
/** Group examples by key function. */
|
|
52
|
-
groupBy(keyFn: GroupKeyFn<ExampleSpec>): Map<string, ExampleSpec[]>;
|
|
53
33
|
/** Group examples by kind. */
|
|
54
34
|
groupByKind(): Map<ExampleKind, ExampleSpec[]>;
|
|
55
|
-
/** Get unique tags from all examples. */
|
|
56
|
-
getUniqueTags(): string[];
|
|
57
35
|
/** Get unique kinds from all examples. */
|
|
58
36
|
getUniqueKinds(): ExampleKind[];
|
|
59
37
|
/** Get unique domains from all examples. */
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { compareVersions } from "compare-versions";
|
|
1
|
+
import { SpecContractRegistry } from "../registry.js";
|
|
3
2
|
|
|
4
3
|
//#region src/examples/registry.ts
|
|
5
|
-
init_registry_utils();
|
|
6
|
-
function exampleKey(meta) {
|
|
7
|
-
return `${meta.key}.v${meta.version}`;
|
|
8
|
-
}
|
|
9
4
|
/**
|
|
10
5
|
* In-memory registry for ExampleSpec.
|
|
11
6
|
*
|
|
@@ -21,44 +16,9 @@ function exampleKey(meta) {
|
|
|
21
16
|
* const publicExamples = registry.listByVisibility('public');
|
|
22
17
|
* ```
|
|
23
18
|
*/
|
|
24
|
-
var ExampleRegistry = class {
|
|
25
|
-
items
|
|
26
|
-
|
|
27
|
-
register(spec) {
|
|
28
|
-
const key = exampleKey(spec.meta);
|
|
29
|
-
if (this.items.has(key)) throw new Error(`Duplicate example: ${key}`);
|
|
30
|
-
this.items.set(key, spec);
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
/** List all registered examples. */
|
|
34
|
-
list() {
|
|
35
|
-
return [...this.items.values()];
|
|
36
|
-
}
|
|
37
|
-
/** Get an example by its key. */
|
|
38
|
-
get(key, version) {
|
|
39
|
-
if (version != null) return this.items.get(`${key}.v${version}`);
|
|
40
|
-
let candidate;
|
|
41
|
-
for (const [_k, v] of this.items.entries()) {
|
|
42
|
-
if (v.meta.key !== key) continue;
|
|
43
|
-
if (!candidate || compareVersions(v.meta.version, candidate.meta.version) > 0) candidate = v;
|
|
44
|
-
}
|
|
45
|
-
return candidate;
|
|
46
|
-
}
|
|
47
|
-
/** Check if an example with the given key exists. */
|
|
48
|
-
has(key, version) {
|
|
49
|
-
return !!this.get(key, version);
|
|
50
|
-
}
|
|
51
|
-
/** Get the number of registered examples. */
|
|
52
|
-
get size() {
|
|
53
|
-
return this.items.size;
|
|
54
|
-
}
|
|
55
|
-
/** Clear all registered examples. */
|
|
56
|
-
clear() {
|
|
57
|
-
this.items.clear();
|
|
58
|
-
}
|
|
59
|
-
/** Filter examples by criteria. */
|
|
60
|
-
filter(criteria) {
|
|
61
|
-
return filterBy(this.list(), criteria);
|
|
19
|
+
var ExampleRegistry = class extends SpecContractRegistry {
|
|
20
|
+
constructor(items) {
|
|
21
|
+
super("example", items);
|
|
62
22
|
}
|
|
63
23
|
/** List examples by kind. */
|
|
64
24
|
listByKind(kind) {
|
|
@@ -68,14 +28,6 @@ var ExampleRegistry = class {
|
|
|
68
28
|
listByVisibility(visibility) {
|
|
69
29
|
return this.list().filter((spec) => spec.meta.visibility === visibility);
|
|
70
30
|
}
|
|
71
|
-
/** List examples with specific tag. */
|
|
72
|
-
listByTag(tag) {
|
|
73
|
-
return this.list().filter((spec) => spec.meta.tags.includes(tag));
|
|
74
|
-
}
|
|
75
|
-
/** List examples by owner. */
|
|
76
|
-
listByOwner(owner) {
|
|
77
|
-
return this.list().filter((spec) => spec.meta.owners.includes(owner));
|
|
78
|
-
}
|
|
79
31
|
/** List examples by domain. */
|
|
80
32
|
listByDomain(domain) {
|
|
81
33
|
return this.list().filter((spec) => spec.meta.domain === domain);
|
|
@@ -94,10 +46,6 @@ var ExampleRegistry = class {
|
|
|
94
46
|
listInstallable() {
|
|
95
47
|
return this.list().filter((spec) => spec.surfaces.studio.installable);
|
|
96
48
|
}
|
|
97
|
-
/** Group examples by key function. */
|
|
98
|
-
groupBy(keyFn) {
|
|
99
|
-
return groupBy(this.list(), keyFn);
|
|
100
|
-
}
|
|
101
49
|
/** Group examples by kind. */
|
|
102
50
|
groupByKind() {
|
|
103
51
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -108,10 +56,6 @@ var ExampleRegistry = class {
|
|
|
108
56
|
}
|
|
109
57
|
return result;
|
|
110
58
|
}
|
|
111
|
-
/** Get unique tags from all examples. */
|
|
112
|
-
getUniqueTags() {
|
|
113
|
-
return getUniqueTags(this.list());
|
|
114
|
-
}
|
|
115
59
|
/** Get unique kinds from all examples. */
|
|
116
60
|
getUniqueKinds() {
|
|
117
61
|
const kinds = /* @__PURE__ */ new Set();
|
|
@@ -3,14 +3,14 @@ import { z as z$1 } from "zod";
|
|
|
3
3
|
|
|
4
4
|
//#region src/examples/schema.d.ts
|
|
5
5
|
declare const ExampleKindSchema: z$1.ZodEnum<{
|
|
6
|
-
|
|
7
|
-
template: "template";
|
|
6
|
+
library: "library";
|
|
8
7
|
workflow: "workflow";
|
|
8
|
+
template: "template";
|
|
9
|
+
integration: "integration";
|
|
9
10
|
knowledge: "knowledge";
|
|
10
11
|
blueprint: "blueprint";
|
|
11
12
|
ui: "ui";
|
|
12
13
|
script: "script";
|
|
13
|
-
library: "library";
|
|
14
14
|
}>;
|
|
15
15
|
declare const ExampleVisibilitySchema: z$1.ZodEnum<{
|
|
16
16
|
experimental: "experimental";
|
|
@@ -25,12 +25,12 @@ declare const ExampleSandboxModeSchema: z$1.ZodEnum<{
|
|
|
25
25
|
evolution: "evolution";
|
|
26
26
|
}>;
|
|
27
27
|
declare const StabilitySchema: z$1.ZodEnum<{
|
|
28
|
+
deprecated: "deprecated";
|
|
28
29
|
idea: "idea";
|
|
29
30
|
in_creation: "in_creation";
|
|
30
31
|
experimental: "experimental";
|
|
31
32
|
beta: "beta";
|
|
32
33
|
stable: "stable";
|
|
33
|
-
deprecated: "deprecated";
|
|
34
34
|
}>;
|
|
35
35
|
declare const ExampleDocumentationSchema: z$1.ZodObject<{
|
|
36
36
|
rootDocId: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -93,25 +93,25 @@ declare const ExampleMetaSchema: z$1.ZodObject<{
|
|
|
93
93
|
description: z$1.ZodString;
|
|
94
94
|
domain: z$1.ZodOptional<z$1.ZodString>;
|
|
95
95
|
stability: z$1.ZodEnum<{
|
|
96
|
+
deprecated: "deprecated";
|
|
96
97
|
idea: "idea";
|
|
97
98
|
in_creation: "in_creation";
|
|
98
99
|
experimental: "experimental";
|
|
99
100
|
beta: "beta";
|
|
100
101
|
stable: "stable";
|
|
101
|
-
deprecated: "deprecated";
|
|
102
102
|
}>;
|
|
103
103
|
owners: z$1.ZodArray<z$1.ZodString>;
|
|
104
104
|
tags: z$1.ZodArray<z$1.ZodString>;
|
|
105
105
|
docId: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
106
106
|
kind: z$1.ZodEnum<{
|
|
107
|
-
|
|
108
|
-
template: "template";
|
|
107
|
+
library: "library";
|
|
109
108
|
workflow: "workflow";
|
|
109
|
+
template: "template";
|
|
110
|
+
integration: "integration";
|
|
110
111
|
knowledge: "knowledge";
|
|
111
112
|
blueprint: "blueprint";
|
|
112
113
|
ui: "ui";
|
|
113
114
|
script: "script";
|
|
114
|
-
library: "library";
|
|
115
115
|
}>;
|
|
116
116
|
visibility: z$1.ZodEnum<{
|
|
117
117
|
experimental: "experimental";
|
|
@@ -141,25 +141,25 @@ declare const ExampleSpecSchema: z$1.ZodObject<{
|
|
|
141
141
|
description: z$1.ZodString;
|
|
142
142
|
domain: z$1.ZodOptional<z$1.ZodString>;
|
|
143
143
|
stability: z$1.ZodEnum<{
|
|
144
|
+
deprecated: "deprecated";
|
|
144
145
|
idea: "idea";
|
|
145
146
|
in_creation: "in_creation";
|
|
146
147
|
experimental: "experimental";
|
|
147
148
|
beta: "beta";
|
|
148
149
|
stable: "stable";
|
|
149
|
-
deprecated: "deprecated";
|
|
150
150
|
}>;
|
|
151
151
|
owners: z$1.ZodArray<z$1.ZodString>;
|
|
152
152
|
tags: z$1.ZodArray<z$1.ZodString>;
|
|
153
153
|
docId: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
154
154
|
kind: z$1.ZodEnum<{
|
|
155
|
-
|
|
156
|
-
template: "template";
|
|
155
|
+
library: "library";
|
|
157
156
|
workflow: "workflow";
|
|
157
|
+
template: "template";
|
|
158
|
+
integration: "integration";
|
|
158
159
|
knowledge: "knowledge";
|
|
159
160
|
blueprint: "blueprint";
|
|
160
161
|
ui: "ui";
|
|
161
162
|
script: "script";
|
|
162
|
-
library: "library";
|
|
163
163
|
}>;
|
|
164
164
|
visibility: z$1.ZodEnum<{
|
|
165
165
|
experimental: "experimental";
|
|
@@ -221,10 +221,10 @@ declare function safeParseExampleSpec(data: unknown): z$1.ZodSafeParseResult<{
|
|
|
221
221
|
version: string;
|
|
222
222
|
key: string;
|
|
223
223
|
description: string;
|
|
224
|
-
stability: "idea" | "in_creation" | "experimental" | "beta" | "stable"
|
|
224
|
+
stability: "deprecated" | "idea" | "in_creation" | "experimental" | "beta" | "stable";
|
|
225
225
|
owners: string[];
|
|
226
226
|
tags: string[];
|
|
227
|
-
kind: "
|
|
227
|
+
kind: "library" | "workflow" | "template" | "integration" | "knowledge" | "blueprint" | "ui" | "script";
|
|
228
228
|
visibility: "experimental" | "public" | "internal";
|
|
229
229
|
title?: string | undefined;
|
|
230
230
|
domain?: string | undefined;
|