@lssm/example.workflow-system 0.0.0-canary-20251217060804 → 0.0.0-canary-20251217062139
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/approval/approval.contracts.d.ts +133 -133
- package/dist/approval/approval.contracts.js +1 -1
- package/dist/approval/approval.enum.d.ts +3 -3
- package/dist/approval/approval.enum.js +1 -1
- package/dist/approval/approval.event.d.ts +31 -31
- package/dist/approval/approval.event.js +1 -1
- package/dist/approval/approval.schema.d.ts +24 -24
- package/dist/approval/approval.schema.js +1 -1
- package/dist/docs/workflow-system.docblock.js +1 -1
- package/dist/entities/approval.d.ts +36 -36
- package/dist/entities/approval.js +1 -1
- package/dist/entities/index.d.ts +127 -127
- package/dist/entities/instance.d.ts +47 -47
- package/dist/entities/instance.js +1 -1
- package/dist/entities/step.d.ts +32 -32
- package/dist/entities/step.js +1 -1
- package/dist/entities/workflow.d.ts +23 -23
- package/dist/entities/workflow.js +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/instance/instance.contracts.d.ts +256 -256
- package/dist/instance/instance.contracts.js +1 -1
- package/dist/instance/instance.enum.d.ts +2 -2
- package/dist/instance/instance.enum.js +1 -1
- package/dist/instance/instance.event.d.ts +87 -87
- package/dist/instance/instance.event.js +1 -1
- package/dist/instance/instance.schema.d.ts +54 -54
- package/dist/instance/instance.schema.js +1 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +1 -0
- package/dist/libs/contracts/dist/client/index.js +1 -0
- package/dist/libs/contracts/dist/client/react/feature-render.js +1 -0
- package/dist/libs/contracts/dist/client/react/form-render.js +1 -0
- package/dist/libs/contracts/dist/client/react/index.js +1 -0
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -0
- package/dist/libs/contracts/dist/contract-registry/schemas.js +1 -0
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +76 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +350 -0
- package/dist/libs/contracts/dist/docs/index.js +1 -0
- package/dist/libs/contracts/dist/docs/presentations.js +1 -0
- package/dist/libs/contracts/dist/docs/registry.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +383 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +68 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +140 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +86 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +58 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +38 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +213 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +289 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +262 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +57 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +63 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +36 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +65 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +41 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +122 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +1 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +68 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +1 -0
- package/dist/libs/contracts/dist/events.js +1 -0
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
- package/dist/libs/contracts/dist/index.js +1 -0
- package/dist/libs/contracts/dist/install.js +1 -0
- package/dist/libs/contracts/dist/integrations/contracts.js +1 -0
- package/dist/libs/contracts/dist/integrations/index.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/index.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/registry.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +1 -0
- package/dist/libs/contracts/dist/jsonschema.js +1 -0
- package/dist/libs/contracts/dist/knowledge/contracts.js +1 -0
- package/dist/libs/contracts/dist/knowledge/index.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +1 -0
- package/dist/libs/contracts/dist/llm/exporters.js +1 -0
- package/dist/libs/contracts/dist/llm/index.js +1 -0
- package/dist/libs/contracts/dist/llm/prompts.js +1 -0
- package/dist/libs/contracts/dist/onboarding-base.js +1 -0
- package/dist/libs/contracts/dist/openapi.js +1 -0
- package/dist/libs/contracts/dist/ownership.js +1 -0
- package/dist/libs/contracts/dist/presentations.js +1 -0
- package/dist/libs/contracts/dist/presentations.v2.js +1 -0
- package/dist/libs/contracts/dist/prompt.js +1 -0
- package/dist/libs/contracts/dist/promptRegistry.js +1 -0
- package/dist/libs/contracts/dist/regenerator/index.js +1 -0
- package/dist/libs/contracts/dist/regenerator/service.js +1 -0
- package/dist/libs/contracts/dist/registry.js +1 -0
- package/dist/libs/contracts/dist/resources.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +1 -0
- package/dist/libs/contracts/dist/server/graphql-pothos.js +1 -0
- package/dist/libs/contracts/dist/server/index.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -0
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
- package/dist/libs/contracts/dist/server/rest-express.js +1 -0
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
- package/dist/libs/contracts/dist/spec.js +1 -0
- package/dist/libs/contracts/dist/telemetry/index.js +1 -0
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
- package/dist/libs/contracts/dist/tests/index.js +1 -0
- package/dist/libs/contracts/dist/tests/runner.js +1 -0
- package/dist/libs/contracts/dist/workflow/index.js +1 -0
- package/dist/libs/contracts/dist/workflow/runner.js +1 -0
- package/dist/libs/schema/dist/EnumType.js +1 -0
- package/dist/libs/schema/dist/FieldType.js +1 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js +1 -0
- package/dist/libs/schema/dist/SchemaModel.js +1 -0
- package/dist/libs/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/schema/dist/entity/index.js +1 -0
- package/dist/libs/schema/dist/entity/types.js +1 -0
- package/dist/libs/schema/dist/index.js +1 -0
- package/dist/workflow/workflow.contracts.d.ts +245 -245
- package/dist/workflow/workflow.contracts.js +1 -1
- package/dist/workflow/workflow.enum.d.ts +5 -5
- package/dist/workflow/workflow.enum.js +1 -1
- package/dist/workflow/workflow.event.d.ts +32 -32
- package/dist/workflow/workflow.event.js +1 -1
- package/dist/workflow/workflow.schema.d.ts +63 -63
- package/dist/workflow/workflow.schema.js +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.schema.README`,title:`Multi‑File Prisma Schema Conventions (per database)`,summary:`We adopt Prisma multi‑file schema (GA ≥ v6.7) to organize each database’s models by domain and to import core LSSM module schemas locally.`,kind:`reference`,visibility:`public`,route:`/docs/tech/schema/README`,tags:[`tech`,`schema`,`README`],body:`# Multi‑File Prisma Schema Conventions (per database)
|
|
2
|
+
|
|
3
|
+
We adopt Prisma multi‑file schema (GA ≥ v6.7) to organize each database’s models by domain and to import core LSSM module schemas locally.
|
|
4
|
+
|
|
5
|
+
Canonical layout per DB:
|
|
6
|
+
|
|
7
|
+
\`\`\`
|
|
8
|
+
prisma/
|
|
9
|
+
schema/
|
|
10
|
+
main.prisma # datasource + generators only
|
|
11
|
+
imported/
|
|
12
|
+
lssm_sigil/*.prisma # imported models/enums only (no datasource/generator)
|
|
13
|
+
lssm_content/*.prisma # idem
|
|
14
|
+
<domain>/*.prisma # vertical‑specific models split by bounded context
|
|
15
|
+
\`\`\`
|
|
16
|
+
|
|
17
|
+
Notes:
|
|
18
|
+
|
|
19
|
+
- Imported files contain only \`model\` and \`enum\` blocks (strip \`datasource\`/\`generator\`).
|
|
20
|
+
- Preserve \`@@schema("…")\` annotations to keep tables in their Postgres schemas; we now explicitly list schemas in \`main.prisma\` to avoid P1012: \`schemas = ["public","lssm_sigil","lssm_content","lssm_featureflags","lssm_ops","lssm_planning","lssm_quill","lssm_geoterro"]\`.
|
|
21
|
+
- Use \`@lssm/app.cli-database\` CLI: \`database import|check|generate|migrate:*|seed\` to manage a single DB; \`@lssm/app.cli-databases\` orchestrates multiple DBs.
|
|
22
|
+
|
|
23
|
+
## Typed merger config
|
|
24
|
+
|
|
25
|
+
- Define imported module list once per DB with a typed config:
|
|
26
|
+
|
|
27
|
+
\`\`\`ts
|
|
28
|
+
// prisma-merger.config.ts
|
|
29
|
+
import { defineMergedPrismaConfig } from '@lssm/app.cli-database';
|
|
30
|
+
|
|
31
|
+
export default defineMergedPrismaConfig({
|
|
32
|
+
modules: [
|
|
33
|
+
'@lssm/app.cli-database-sigil',
|
|
34
|
+
'@lssm/app.cli-database-content',
|
|
35
|
+
// ...
|
|
36
|
+
],
|
|
37
|
+
});
|
|
38
|
+
\`\`\`
|
|
39
|
+
|
|
40
|
+
- Then run \`database import --target .\` (no need to pass \`--modules\`).
|
|
41
|
+
|
|
42
|
+
## Prisma Config (prisma.config.ts)
|
|
43
|
+
|
|
44
|
+
We use Prisma Config per official docs to point Prisma to the multi-file schema folder and migrations:
|
|
45
|
+
|
|
46
|
+
\`\`\`ts
|
|
47
|
+
// prisma.config.ts
|
|
48
|
+
import path from 'node:path';
|
|
49
|
+
import { defineConfig } from 'prisma/config';
|
|
50
|
+
|
|
51
|
+
export default defineConfig({
|
|
52
|
+
schema: path.join('prisma', 'schema'),
|
|
53
|
+
migrations: { path: path.join('prisma', 'migrations') },
|
|
54
|
+
});
|
|
55
|
+
\`\`\`
|
|
56
|
+
|
|
57
|
+
Reference: Prisma blog – Organize Your Prisma Schema into Multiple Files: https://www.prisma.io/blog/organize-your-prisma-schema-with-multi-file-support
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
# LSSM Auth (Sigil) – Models & Integration
|
|
62
|
+
|
|
63
|
+
This document tracks the identity models and integration points used by the LSSM Sigil module.
|
|
64
|
+
|
|
65
|
+
## Models (Prisma \`lssm_sigil\`)
|
|
66
|
+
|
|
67
|
+
- \`User\` – core identity with email, optional phone, role, passkeys, apiKeys
|
|
68
|
+
- \`Session\` – session tokens and metadata; includes \`activeOrganizationId\`
|
|
69
|
+
- \`Account\` – external providers (password, OAuth)
|
|
70
|
+
- \`Organization\` – tenant boundary; includes \`type\` additional field
|
|
71
|
+
- \`Member\`, \`Invitation\`, \`Team\`, \`TeamMember\` – org/teams
|
|
72
|
+
- \`Role\`, \`Permission\`, \`PolicyBinding\` – RBAC
|
|
73
|
+
- \`ApiKey\`, \`Passkey\` – programmable access and WebAuthn
|
|
74
|
+
- \`SsoProvider\` – OIDC/SAML provider configuration (org- or user-scoped)
|
|
75
|
+
- \`OAuthApplication\`, \`OAuthAccessToken\`, \`OAuthConsent\` – first/third-party OAuth
|
|
76
|
+
|
|
77
|
+
These mirror STRIT additions so Better Auth advanced plugins (admin, organization, apiKey, passkey, genericOAuth) work uniformly across apps.
|
|
78
|
+
|
|
79
|
+
## Better Auth (server)
|
|
80
|
+
|
|
81
|
+
Enabled methods:
|
|
82
|
+
|
|
83
|
+
- Email & password
|
|
84
|
+
- Phone OTP (Telnyx)
|
|
85
|
+
- Passkey (WebAuthn)
|
|
86
|
+
- API keys
|
|
87
|
+
- Organizations & Teams
|
|
88
|
+
- Generic OAuth (FranceConnect+ via OIDC with JWE/JWS using JOSE)
|
|
89
|
+
|
|
90
|
+
Server config lives at \`packages/lssm/modules/sigil/src/application/services/auth.ts\`.
|
|
91
|
+
|
|
92
|
+
## Clients (Expo / React)
|
|
93
|
+
|
|
94
|
+
Client config lives at \`packages/lssm/modules/sigil/src/presentation/providers/auth/expo.ts\` with plugins for admin, passkey, apiKey, organization, phone, genericOAuth.
|
|
95
|
+
|
|
96
|
+
## Environment Variables
|
|
97
|
+
|
|
98
|
+
Telnyx (phone OTP):
|
|
99
|
+
|
|
100
|
+
- \`TELNYX_API_KEY\`
|
|
101
|
+
- \`TELNYX_MESSAGING_PROFILE_ID\`
|
|
102
|
+
- \`TELNYX_FROM_NUMBER\`
|
|
103
|
+
|
|
104
|
+
FranceConnect+ (prefer LSSM*… but STRIT*… fallbacks are supported):
|
|
105
|
+
|
|
106
|
+
- \`LSSM_FRANCECONNECTPLUS_DISCOVERY_URL\`
|
|
107
|
+
- \`LSSM_FRANCECONNECTPLUS_CLIENT_ID\`
|
|
108
|
+
- \`LSSM_FRANCECONNECTPLUS_CLIENT_SECRET\`
|
|
109
|
+
- \`LSSM_FRANCECONNECTPLUS_ENC_PRIVATE_KEY_PEM\` (PKCS8; RSA-OAEP-256)
|
|
110
|
+
|
|
111
|
+
Generic:
|
|
112
|
+
|
|
113
|
+
- \`API_URL_IDENTITIES\` – base URL for Better Auth server
|
|
114
|
+
- \`BETTER_AUTH_SECRET\` – server secret
|
|
115
|
+
|
|
116
|
+
Keep this in sync with code changes to avoid drift.
|
|
117
|
+
|
|
118
|
+
## HCircle domain splits and auth removal
|
|
119
|
+
|
|
120
|
+
- Auth/identity models are not defined locally anymore. They come from \`@lssm/app.cli-database-sigil\` under the \`lssm_sigil\` schema.
|
|
121
|
+
- \`packages/hcircle/libs/database-coliving/prisma/schema/domain/\` is split by domain; newsletter/waiting list lives in \`newsletter.prisma\` and uses \`@@map("waiting_list")\`.
|
|
122
|
+
- To avoid collisions with module names, the local event models were renamed to \`SocialEvent\`, \`SocialEventAttendee\`, and \`SocialEventRecurrence\` with \`@@map\` pointing to existing table names.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Vertical profiles (current)
|
|
127
|
+
|
|
128
|
+
### STRIT
|
|
129
|
+
|
|
130
|
+
- prisma-merger modules:
|
|
131
|
+
- \`@lssm/app.cli-database-sigil\`, \`@lssm/app.cli-database-content\`, \`@lssm/app.cli-database-ops\`, \`@lssm/app.cli-database-planning\`, \`@lssm/app.cli-database-quill\`, \`@lssm/app.cli-database-geoterro\`
|
|
132
|
+
- main.prisma schemas:
|
|
133
|
+
- \`schemas = ["public","lssm_sigil","lssm_content","lssm_ops","lssm_planning","lssm_quill","lssm_geoterro"]\`
|
|
134
|
+
- domain splits (\`packages/strit/libs/database/prisma/schema/domain/\`):
|
|
135
|
+
- \`bookings.prisma\` (Booking, StritDocument + links to Content \`File\` and Sigil \`Organization\`)
|
|
136
|
+
- \`commerce.prisma\` (Wholesale models; \`sellerId\` linked to Sigil \`Organization\`)
|
|
137
|
+
- \`files.prisma\` (PublicFile, PublicFileAccessLog; \`ownerId\`→Organization, \`uploadedBy\`→User)
|
|
138
|
+
- \`geo.prisma\` (PublicCountry, PublicAddress, City; links to Spots/Series)
|
|
139
|
+
- \`spots.prisma\`, \`urbanism.prisma\`, \`analytics.prisma\`, \`onboarding.prisma\`, \`referrals.prisma\`, \`subscriptions.prisma\`, \`content.prisma\`
|
|
140
|
+
- auth models are imported from Sigil (no local auth tables).
|
|
141
|
+
- Back-relations for \`Organization\` (e.g., \`files\`, seller relations) are declared in the Sigil module to avoid scattering.
|
|
142
|
+
|
|
143
|
+
### ARTISANOS
|
|
144
|
+
|
|
145
|
+
- prisma-merger modules:
|
|
146
|
+
- \`@lssm/app.cli-database-sigil\`, \`@lssm/app.cli-database-content\`, \`@lssm/app.cli-database-featureflags\`, \`@lssm/app.cli-database-ops\`, \`@lssm/app.cli-database-planning\`, \`@lssm/app.cli-database-quill\`, \`@lssm/app.cli-database-geoterro\`
|
|
147
|
+
- main.prisma schemas:
|
|
148
|
+
- \`schemas = ["public","lssm_sigil","lssm_content","lssm_featureflags","lssm_ops","lssm_planning","lssm_quill","lssm_geoterro"]\`
|
|
149
|
+
- domain splits (\`packages/artisanos/libs/database-artisan/prisma/schema/domain/\`):
|
|
150
|
+
- \`sales.prisma\` (Client, Quote, QuoteTemplate, Invoice, FollowUps)
|
|
151
|
+
- \`subsidies.prisma\` (SubsidyProgram, AidApplication, SupportingDocument)
|
|
152
|
+
- \`projects.prisma\` (Project, ProjectPlanningSettings)
|
|
153
|
+
- \`crm.prisma\` (OrganizationProfessionalProfile, OrganizationCertification)
|
|
154
|
+
- \`professions.prisma\`, \`products.prisma\`, \`templates.prisma\`, \`analytics.prisma\`, \`onboarding.prisma\`, \`referrals.prisma\`, \`subscriptions.prisma\`, \`files.prisma\`
|
|
155
|
+
- auth/organization/team models are provided by Sigil; local legacy copies were removed.
|
|
156
|
+
- Where names collide with Content, local models are prefixed (e.g., \`PublicFile\`) and use \`@@map\` to keep existing table names where applicable.
|
|
157
|
+
|
|
158
|
+
## Schema Dictionary: \`@lssm/lib.schema\`
|
|
159
|
+
|
|
160
|
+
### Purpose
|
|
161
|
+
|
|
162
|
+
Describe operation I/O once and generate:
|
|
163
|
+
|
|
164
|
+
- zod (runtime validation)
|
|
165
|
+
- GraphQL (Pothos types/refs)
|
|
166
|
+
- JSON Schema (via \`zod-to-json-schema\` or native descriptors)
|
|
167
|
+
|
|
168
|
+
### Primitives
|
|
169
|
+
|
|
170
|
+
- **FieldType<T>**: describes a scalar or composite field and carries:
|
|
171
|
+
- \`zod\` schema for validation
|
|
172
|
+
- optional JSON Schema descriptor
|
|
173
|
+
- optional GraphQL scalar reference/name
|
|
174
|
+
- **SchemaModel**: named object model composed of fields. Exposes helpers:
|
|
175
|
+
- \`getZod(): z.ZodObject<ZodShapeFromFields<Fields>> | z.ZodArray<z.ZodObject<...>>\`
|
|
176
|
+
- Preserves each field's schema, optionality, and array-ness
|
|
177
|
+
- Top-level lists are supported via \`config.isArray: true\`
|
|
178
|
+
- \`getJsonSchema(): JSONSchema7\` (export for docs, MCP, forms)
|
|
179
|
+
- \`getPothosInput()\` (GraphQL input object name)
|
|
180
|
+
|
|
181
|
+
### Conventions
|
|
182
|
+
|
|
183
|
+
- Name models with PascalCase; suffix with \`Input\`/\`Result\` when ambiguous.
|
|
184
|
+
- Use explicit enums for multi-value constants; reuse the same enum across input/output.
|
|
185
|
+
- Define domain enums via \`defineEnum('Name', [...])\` in the relevant domain package (e.g., \`packages/strit/libs/contracts-strit/src/enums/\`), not in \`ScalarTypeEnum\`.
|
|
186
|
+
- Reference those enums in \`SchemaModel\` fields directly (they expose \`getZod\`, \`getPothos\`, \`getJsonSchema\`).
|
|
187
|
+
|
|
188
|
+
#### Example (STRIT)
|
|
189
|
+
|
|
190
|
+
\`\`\`ts
|
|
191
|
+
// packages/strit/libs/contracts-strit/src/enums/recurrence.ts
|
|
192
|
+
import { defineEnum } from '@lssm/lib.schema';
|
|
193
|
+
export const SpotEnum = {
|
|
194
|
+
Weekday: () =>
|
|
195
|
+
defineEnum('Weekday', ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'] as const),
|
|
196
|
+
RecurrenceFrequency: () =>
|
|
197
|
+
defineEnum('RecurrenceFrequency', [
|
|
198
|
+
'DAILY',
|
|
199
|
+
'WEEKLY',
|
|
200
|
+
'MONTHLY',
|
|
201
|
+
'YEARLY',
|
|
202
|
+
] as const),
|
|
203
|
+
} as const;
|
|
204
|
+
\`\`\`
|
|
205
|
+
|
|
206
|
+
\`\`\`ts
|
|
207
|
+
// usage in contracts
|
|
208
|
+
frequency: { type: SpotEnum.RecurrenceFrequency(), isOptional: false },
|
|
209
|
+
byWeekday: { type: SpotEnum.Weekday(), isOptional: true, isArray: true },
|
|
210
|
+
\`\`\`
|
|
211
|
+
|
|
212
|
+
- Use \`Date\` type for temporal values and ensure ISO strings in JSON transports where needed.
|
|
213
|
+
|
|
214
|
+
### Mapping rules (summary)
|
|
215
|
+
|
|
216
|
+
- Strings → GraphQL \`String\`
|
|
217
|
+
- Numbers → \`Int\` if safe 32-bit integer else \`Float\`
|
|
218
|
+
- Booleans → \`Boolean\`
|
|
219
|
+
- Dates → custom \`Date\` scalar
|
|
220
|
+
- Arrays<T> → list of mapped T (set \`isArray: true\` on the field)
|
|
221
|
+
- Top-level arrays → set \`isArray: true\` on the model config
|
|
222
|
+
- Objects → input/output object types with stable field order
|
|
223
|
+
- Unions → supported for output; input unions map to JSON (structural input is not supported by GraphQL)
|
|
224
|
+
|
|
225
|
+
### JSON Schema export
|
|
226
|
+
|
|
227
|
+
Prefer \`getZod()\` + \`zod-to-json-schema\` for consistency. For advanced cases, provide a custom \`getJsonSchema()\` on the model.
|
|
228
|
+
|
|
229
|
+
### Example
|
|
230
|
+
|
|
231
|
+
\`\`\`ts
|
|
232
|
+
import { ScalarTypeEnum, SchemaModel } from '@lssm/lib.schema';
|
|
233
|
+
|
|
234
|
+
// Nested model
|
|
235
|
+
const Weekday = new SchemaModel({
|
|
236
|
+
name: 'Weekday',
|
|
237
|
+
fields: {
|
|
238
|
+
value: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// Parent model with array field and nested object
|
|
243
|
+
const Rule = new SchemaModel({
|
|
244
|
+
name: 'Rule',
|
|
245
|
+
fields: {
|
|
246
|
+
timezone: { type: ScalarTypeEnum.TimeZone(), isOptional: false },
|
|
247
|
+
byWeekday: { type: Weekday, isOptional: true, isArray: true },
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
const CreateThingInput = new SchemaModel({
|
|
252
|
+
name: 'CreateThingInput',
|
|
253
|
+
fields: {
|
|
254
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
255
|
+
rule: { type: Rule, isOptional: false },
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// zod
|
|
260
|
+
const z = CreateThingInput.getZod();
|
|
261
|
+
\`\`\`
|
|
262
|
+
`}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.learning-events`,title:`Studio Learning Events`,summary:`Studio persists learning/activity events to the database; Sandbox keeps learning local-first and unlogged.`,kind:`reference`,visibility:`public`,route:`/docs/tech/studio/learning-events`,tags:[`studio`,`learning`,`events`,`analytics`,`sandbox`],body:"# Studio Learning Events\n\nStudio emits lightweight **learning/activity events** to support onboarding, ambient coaching, and learning journeys.\n\n## Persistence model\n\n- **Studio**: events are persisted to the database in `StudioLearningEvent` and are organization-scoped (optionally project-scoped).\n- **Sandbox**: events remain **local-only** (unlogged); they must never be sent to backend services.\n\n## GraphQL API\n\n- `recordLearningEvent(input: { name, projectId?, payload? })`\n- `myLearningEvents(projectId?, limit?)`\n- `myOnboardingTracks(productId?, includeProgress?)`\n- `myOnboardingProgress(trackKey)`\n- `dismissOnboardingTrack(trackKey)`\n\n## Common event names (convention)\n\n- `module.navigated` — user navigated to a Studio module (payload at minimum: `{ moduleId }`).\n- `studio.template.instantiated` — created a new Studio project (starter template). Payload commonly includes `{ templateId, projectSlug }`.\n- `spec.changed` — created or updated a Studio spec. Payload may include `{ action: 'create' | 'update', specId?, specType? }`.\n- `regeneration.completed` — finished a “regen/deploy” action (currently emitted on successful Studio deploy actions).\n- `studio.evolution.applied` — completed an Evolution session (payload commonly includes `{ evolutionSessionId }`).\n\nThese events are intentionally minimal and must avoid PII/secrets in payloads.\n"}]);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.learning-journeys`,title:`Studio learning journeys (onboarding + coach)`,summary:`DB-backed learning journeys tracked per organization: seeded tracks/steps, event-driven progress, XP/streaks, and a Studio coach surface.`,kind:`reference`,visibility:`public`,route:`/docs/tech/studio/learning-journeys`,tags:[`studio`,`learning`,`onboarding`,`journey`,`graphql`,`database`],body:`# Studio learning journeys
|
|
2
|
+
|
|
3
|
+
Studio supports **DB-backed learning journeys** (onboarding tracks + ambient coach tips) that are advanced by **recorded learning events**.
|
|
4
|
+
|
|
5
|
+
> See also: \`/docs/tech/studio/learning-events\` for event naming + payload guardrails.
|
|
6
|
+
|
|
7
|
+
## Scope (multi-tenancy)
|
|
8
|
+
|
|
9
|
+
- Progress is tracked **per organization** (tenant/workspace), via a \`Learner\` record keyed by \`(userId, organizationId)\`.
|
|
10
|
+
- Learning events are stored as \`StudioLearningEvent\` under the Studio DB schema, scoped to an organization (optionally a project).
|
|
11
|
+
|
|
12
|
+
## Persistence model (Prisma)
|
|
13
|
+
|
|
14
|
+
Learning journey progress lives in the \`lssm_learning\` schema:
|
|
15
|
+
|
|
16
|
+
- \`Learner\` — one per \`(userId, organizationId)\`
|
|
17
|
+
- \`OnboardingTrack\` — seeded track definitions (trackKey, name, metadata)
|
|
18
|
+
- \`OnboardingStep\` — seeded step definitions (stepKey, completionCondition, xpReward, metadata)
|
|
19
|
+
- \`OnboardingProgress\` — learner × track progress (progress %, xpEarned, completedAt, dismissedAt)
|
|
20
|
+
- \`OnboardingStepCompletion\` — append-only completion records (stepKey, status, xpEarned, completedAt)
|
|
21
|
+
|
|
22
|
+
## Track definition source (spec-first)
|
|
23
|
+
|
|
24
|
+
- Canonical track specs live in \`@lssm/example.learning-journey-registry\`.
|
|
25
|
+
- The Studio API seeds/updates the DB definitions via an idempotent “ensure tracks” routine.
|
|
26
|
+
- The DB is kept aligned with track specs (stale steps are removed) to prevent drift and unblock completion.
|
|
27
|
+
|
|
28
|
+
## Progress advancement (event-driven)
|
|
29
|
+
|
|
30
|
+
1) UI records an event via GraphQL \`recordLearningEvent\`
|
|
31
|
+
2) Backend creates \`StudioLearningEvent\`
|
|
32
|
+
3) Backend advances onboarding by matching the new event against step completion conditions
|
|
33
|
+
4) Backend persists step completions and recomputes:
|
|
34
|
+
- \`progress\` percentage
|
|
35
|
+
- \`xpEarned\` (including streak/completion bonuses when configured)
|
|
36
|
+
- track completion state (\`completedAt\`)
|
|
37
|
+
|
|
38
|
+
## GraphQL API (Studio)
|
|
39
|
+
|
|
40
|
+
- \`myOnboardingTracks(productId?, includeProgress?)\`
|
|
41
|
+
- returns all tracks + optional progress for the current learner
|
|
42
|
+
- \`myOnboardingProgress(trackKey)\`
|
|
43
|
+
- returns progress + step completion list for a single track
|
|
44
|
+
- \`dismissOnboardingTrack(trackKey)\`
|
|
45
|
+
- marks a track dismissed for the learner (prevents auto-coach)
|
|
46
|
+
|
|
47
|
+
## UI routes/surfaces (web)
|
|
48
|
+
|
|
49
|
+
- \`/studio/learning\` — learning hub (track list + progress widget)
|
|
50
|
+
- \`/studio/learning/{trackKey}\` — track detail (steps + map)
|
|
51
|
+
- Studio shell mounts a **coach sheet** that can auto-open for incomplete, non-dismissed onboarding.
|
|
52
|
+
|
|
53
|
+
## Security + data hygiene
|
|
54
|
+
|
|
55
|
+
- Do not put secrets/PII in \`payload\` fields of learning events.
|
|
56
|
+
- Prefer shallow payload filters (small, stable keys).
|
|
57
|
+
`}]);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.platform-admin-panel`,title:`Studio Platform Admin Panel`,summary:`How PLATFORM_ADMIN organizations manage tenant orgs and integration connections without session switching.`,kind:`reference`,visibility:`public`,route:`/docs/tech/studio/platform-admin-panel`,tags:[`studio`,`admin`,`multi-tenancy`,`integrations`,`better-auth`],body:`# Studio Platform Admin Panel
|
|
2
|
+
|
|
3
|
+
ContractSpec Studio exposes a dedicated **Platform Admin Panel** for users whose **active organization** has:
|
|
4
|
+
|
|
5
|
+
- \`Organization.type = PLATFORM_ADMIN\`
|
|
6
|
+
|
|
7
|
+
The UI route is:
|
|
8
|
+
|
|
9
|
+
- \`/studio/admin\`
|
|
10
|
+
|
|
11
|
+
## Authorization model (no org switching)
|
|
12
|
+
|
|
13
|
+
Platform admins **remain in their own organization**. Cross-tenant actions are always explicit and scoped:
|
|
14
|
+
|
|
15
|
+
- Admin operations require an explicit \`targetOrganizationId\`.
|
|
16
|
+
- No session / activeOrganizationId switching is performed as part of admin operations.
|
|
17
|
+
|
|
18
|
+
## Integrations management
|
|
19
|
+
|
|
20
|
+
The admin panel manages the full ContractSpec Integrations system:
|
|
21
|
+
|
|
22
|
+
- Lists all shipped \`IntegrationSpec\` entries (registry built via \`createDefaultIntegrationSpecRegistry()\`).
|
|
23
|
+
- CRUD \`IntegrationConnection\` records for a selected tenant org.
|
|
24
|
+
|
|
25
|
+
### Secrets (reference-only + write-only)
|
|
26
|
+
|
|
27
|
+
The admin UI supports two modes:
|
|
28
|
+
|
|
29
|
+
- **Reference-only (BYOK)**: store only \`secretProvider\` + \`secretRef\`.
|
|
30
|
+
- **Write-only provisioning/rotation**: paste a raw secret payload; server writes to the selected backend and stores the resulting reference. The secret value is **never returned or displayed**.
|
|
31
|
+
|
|
32
|
+
Supported backends:
|
|
33
|
+
|
|
34
|
+
- Env overrides (\`env://...\`)
|
|
35
|
+
- Google Cloud Secret Manager (\`gcp://...\`)
|
|
36
|
+
- AWS Secrets Manager (\`aws://secretsmanager/...\`)
|
|
37
|
+
- Scaleway Secret Manager (\`scw://secret-manager/...\`)
|
|
38
|
+
|
|
39
|
+
## Better Auth Admin plugin
|
|
40
|
+
|
|
41
|
+
The panel uses the Better Auth **Admin plugin** for user operations (list users, impersonation):
|
|
42
|
+
|
|
43
|
+
- Client calls use \`authClient.admin.*\`.
|
|
44
|
+
- Server-side, ContractSpec enforces that users in a PLATFORM_ADMIN active org have \`User.role\` containing \`admin\` so Better Auth Admin endpoints authorize.
|
|
45
|
+
|
|
46
|
+
## GraphQL surface
|
|
47
|
+
|
|
48
|
+
The platform-admin GraphQL operations are guarded by the active org type and include:
|
|
49
|
+
|
|
50
|
+
- \`platformAdminOrganizations(search, limit, offset)\`
|
|
51
|
+
- \`platformAdminIntegrationSpecs\`
|
|
52
|
+
- \`platformAdminIntegrationConnections(input: { targetOrganizationId, category?, status? })\`
|
|
53
|
+
- \`platformAdminIntegrationConnectionCreate(input)\`
|
|
54
|
+
- \`platformAdminIntegrationConnectionUpdate(input)\`
|
|
55
|
+
- \`platformAdminIntegrationConnectionDelete(targetOrganizationId, connectionId)\`
|
|
56
|
+
|
|
57
|
+
## Key implementation files
|
|
58
|
+
|
|
59
|
+
- Auth + role enforcement: \`packages/bundles/contractspec-studio/src/application/services/auth.ts\`
|
|
60
|
+
- Admin GraphQL module: \`packages/bundles/contractspec-studio/src/infrastructure/graphql/modules/platform-admin.ts\`
|
|
61
|
+
- Integrations admin service: \`packages/bundles/contractspec-studio/src/modules/platform-integrations/index.ts\`
|
|
62
|
+
- Web route: \`packages/apps/web-landing/src/app/(app-customer)/studio/admin/*\`
|
|
63
|
+
`}]);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.project-access-teams`,title:`Studio Project Access via Teams`,summary:`Projects live under organizations; team sharing refines access with an admin/owner override.`,kind:`reference`,visibility:`public`,route:`/docs/tech/studio/project-access-teams`,tags:[`studio`,`projects`,`teams`,`rbac`,`access-control`],body:`# Studio Project Access via Teams
|
|
2
|
+
|
|
3
|
+
Studio access control is **organization-first** with optional **team-based sharing**.
|
|
4
|
+
|
|
5
|
+
## Data model
|
|
6
|
+
|
|
7
|
+
- \`Team\` and \`TeamMember\` define team membership inside an organization.
|
|
8
|
+
- \`StudioProject\` is owned by an organization.
|
|
9
|
+
- \`StudioProjectTeam\` links projects to 0..N teams.
|
|
10
|
+
|
|
11
|
+
## Access rules
|
|
12
|
+
|
|
13
|
+
- **Admins/owners**: always have access to all projects in the organization.
|
|
14
|
+
- **Org-wide projects**: if a project has **no team links**, all organization members can access it.
|
|
15
|
+
- **Team-scoped projects**: if a project has **one or more team links**, a user must be a member of at least one linked team.
|
|
16
|
+
|
|
17
|
+
## GraphQL surfaces
|
|
18
|
+
|
|
19
|
+
- Read:
|
|
20
|
+
- \`myStudioProjects\` (returns only projects you can access)
|
|
21
|
+
- \`studioProjectBySlug(slug)\` (enforces the same access rules)
|
|
22
|
+
- \`myTeams\`
|
|
23
|
+
- \`projectTeams(projectId)\`
|
|
24
|
+
|
|
25
|
+
- Write:
|
|
26
|
+
- \`createStudioProject(input.teamIds?)\` (teamIds optional)
|
|
27
|
+
- \`setProjectTeams(projectId, teamIds)\` (admin-only)
|
|
28
|
+
|
|
29
|
+
## Related
|
|
30
|
+
+
|
|
31
|
+
+- Team administration + invitations: see \`/docs/tech/studio/team-invitations\`.
|
|
32
|
+
+
|
|
33
|
+
## Notes
|
|
34
|
+
|
|
35
|
+
Payloads and events must avoid secrets/PII. For Sandbox, the model remains local-first and unlogged.
|
|
36
|
+
`}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.project-routing`,title:`Studio Project Routing`,summary:`Studio uses slugged, project-first routes: /studio/{projectSlug}/* with canonical slug redirects and soft-deleted projects hidden.`,kind:`reference`,visibility:`public`,route:`/docs/tech/studio/project-routing`,tags:[`studio`,`routing`,`projects`,`slug`,`redirects`],body:"# Studio Project Routing\n\nContractSpec Studio uses a **project-first URL scheme**:\n\n- `/studio/projects` — create, select, and delete projects.\n- `/studio/{projectSlug}/*` — project modules (canvas/specs/deploy/integrations/evolution/learning).\n- `/studio/learning` — learning hub that does not require selecting a project.\n\n## Studio layout shell\n\nStudio routes are wrapped in a dedicated **Studio app shell** (header + footer) that provides in-app navigation (Projects/Learning/Teams), organization switching, and account actions.\n\nProject module routes (`/studio/{projectSlug}/*`) render their own module shell (`WorkspaceProjectShellLayout`). When combined with the global Studio header, the project shell uses a **sticky header offset** to avoid overlapping sticky headers.\n\n## Slug behavior (rename-safe)\n\n- Each project has a `slug` stored in the database (`StudioProject.slug`).\n- When a project name changes, Studio **updates the slug** and stores the previous slug as an alias (`StudioProjectSlugAlias`).\n- Requests to an alias slug are **redirected to the canonical slug**.\n\nGraphQL entrypoint:\n\n- `studioProjectBySlug(slug: String!)` returns:\n - `project`\n - `canonicalSlug`\n - `wasRedirect`\n\n## Deletion behavior (soft delete)\n\nProjects are **soft-deleted**:\n\n- `deleteStudioProject(id: String!)` sets `StudioProject.deletedAt`.\n- All listings and access checks filter `deletedAt = null`.\n- Soft-deleted projects are treated as “not found” in Studio routes and GraphQL access checks.\n\n## Available modules for a selected project\n\nThe following project modules are expected under `/studio/{projectSlug}`:\n\n- `/canvas` — Visual builder canvas (stored via overlays and canvas versions).\n- `/specs` — Spec editor (stored as `StudioSpec`).\n- `/deploy` — Deployments history + triggers (stored as `StudioDeployment`).\n- `/integrations` — Integrations scoped to project (stored as `StudioIntegration`).\n- `/evolution` — Evolution sessions (stored as `EvolutionSession`).\n- `/learning` — Project learning activity.\n"}]);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.sandbox.unlogged`,title:`Sandbox (unlogged) vs Studio (authenticated)`,summary:`The sandbox is a lightweight, unlogged surface that mirrors Studio navigation without auth or analytics.`,kind:`reference`,visibility:`public`,route:`/docs/tech/studio/sandbox-unlogged`,tags:[`studio`,`sandbox`,`privacy`,`analytics`],body:`## Sandbox guarantees
|
|
2
|
+
|
|
3
|
+
- Route: \`/sandbox\`
|
|
4
|
+
- **No auth requirement**
|
|
5
|
+
- **No PostHog init**
|
|
6
|
+
- **No Vercel Analytics**
|
|
7
|
+
- Local-only state (in-browser runtime + localStorage where needed)
|
|
8
|
+
|
|
9
|
+
## What Sandbox is for
|
|
10
|
+
|
|
11
|
+
- Try templates and feature modules safely
|
|
12
|
+
- Preview specs/builder/evolution/learning
|
|
13
|
+
- Produce copyable CLI commands (no side effects)
|
|
14
|
+
|
|
15
|
+
## What Sandbox is *not* for
|
|
16
|
+
|
|
17
|
+
- Persisted projects/workspaces
|
|
18
|
+
- Real deployments
|
|
19
|
+
- Organization-scoped integrations (unless explicitly enabled later)
|
|
20
|
+
`}]);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.team-invitations`,title:`Studio Teams & Invitations`,summary:`Admin-only team management and email invitation flow to join an organization and optionally a team.`,kind:`reference`,visibility:`public`,route:`/docs/tech/studio/team-invitations`,tags:[`studio`,`teams`,`invitations`,`access-control`,`onboarding`],body:`# Studio Teams & Invitations
|
|
2
|
+
|
|
3
|
+
Studio uses **organization membership** as the base access model. Teams are optional and used to refine access to projects.
|
|
4
|
+
|
|
5
|
+
## Who can manage teams?
|
|
6
|
+
|
|
7
|
+
- **Admins/owners only**: create, rename, delete teams; manage project team access; issue invitations.
|
|
8
|
+
|
|
9
|
+
## Invitation data model
|
|
10
|
+
|
|
11
|
+
- \`Invitation\` rows are stored under an organization and target an **email** address.
|
|
12
|
+
|
|
13
|
+
- An invitation can optionally target a \`teamId\`, which will grant the user membership in that team upon acceptance.
|
|
14
|
+
|
|
15
|
+
Key fields:
|
|
16
|
+
- \`email\`: invited address (must match the accepting user's account email)
|
|
17
|
+
|
|
18
|
+
- \`status\`: \`pending | accepted | declined | expired\`
|
|
19
|
+
|
|
20
|
+
- \`teamId?\`: optional team to join
|
|
21
|
+
|
|
22
|
+
- \`inviterId\`: user who issued the invitation
|
|
23
|
+
|
|
24
|
+
## GraphQL surfaces
|
|
25
|
+
|
|
26
|
+
- Team CRUD (admin-only):
|
|
27
|
+
|
|
28
|
+
- \`createTeam(name)\`
|
|
29
|
+
|
|
30
|
+
- \`renameTeam(teamId, name)\`
|
|
31
|
+
|
|
32
|
+
- \`deleteTeam(teamId)\`
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
- Invitations (admin-only):
|
|
36
|
+
|
|
37
|
+
- \`organizationInvitations\`
|
|
38
|
+
|
|
39
|
+
- \`inviteToOrganization(email, role?, teamId?)\` → returns \`inviteUrl\` and whether an email was sent
|
|
40
|
+
|
|
41
|
+
## Accepting an invitation
|
|
42
|
+
|
|
43
|
+
The invite link is served as:
|
|
44
|
+
|
|
45
|
+
- \`/invite/{invitationId}\`
|
|
46
|
+
|
|
47
|
+
Acceptance rules:
|
|
48
|
+
- The user must be authenticated.
|
|
49
|
+
|
|
50
|
+
- The authenticated user’s email must match \`Invitation.email\`.
|
|
51
|
+
|
|
52
|
+
- If not already a member, create \`Member(userId, organizationId, role)\`.
|
|
53
|
+
|
|
54
|
+
- If \`teamId\` is present, ensure \`TeamMember(teamId, userId)\`.
|
|
55
|
+
|
|
56
|
+
- Mark invitation \`status='accepted'\` and set \`acceptedAt\`.
|
|
57
|
+
|
|
58
|
+
- Set \`activeOrganizationId\` for the session so \`/studio/*\` routes work immediately.
|
|
59
|
+
|
|
60
|
+
## Email delivery
|
|
61
|
+
|
|
62
|
+
- If \`RESEND_API_KEY\` is set, the system attempts to send an email.
|
|
63
|
+
|
|
64
|
+
- Otherwise, the UI uses the returned \`inviteUrl\` for manual copy/share.
|
|
65
|
+
`}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.workspace_ops`,title:`Workspace ops (repo-linked): list / validate / deps / diff`,summary:`Read-only repo operations used by Studio to inspect and validate a linked ContractSpec workspace.`,kind:`reference`,visibility:`mixed`,route:`/docs/tech/studio/workspace-ops`,tags:[`studio`,`repo`,`workspace`,`validate`,`diff`],body:"## API surface (api-contractspec)\n\nBase: `/api/workspace-ops`\n\nThese endpoints are **read-only** in v1 and never push to git:\n\n- `GET /api/workspace-ops/:integrationId/config?organizationId=`\n- `GET /api/workspace-ops/:integrationId/specs?organizationId=`\n- `POST /api/workspace-ops/:integrationId/validate` (body: organizationId, files?, pattern?)\n- `POST /api/workspace-ops/:integrationId/deps` (body: organizationId, pattern?)\n- `POST /api/workspace-ops/:integrationId/diff` (body: organizationId, specPath, baseline?, breakingOnly?)\n\n## Repo resolution\n\n- The repo root is resolved from the Studio Integration (`IntegrationProvider.GITHUB`) config:\n - `config.repoCachePath` (preferred) or `config.localPath`\n- Resolution is constrained to `CONTRACTSPEC_REPO_CACHE_DIR` (default: `/tmp/contractspec-repos`)\n\n## Intended UX\n\n- Studio Assistant can run these checks and present results as suggestions.\n- Users can copy equivalent CLI commands for local runs:\n - `contractspec validate`\n - `contractspec deps`\n - `contractspec diff --baseline <ref>`\n"}]);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{a as e}from"../../registry.js";e([{id:`docs.tech.studio.workspaces`,title:`Studio projects, teams, environments`,summary:`Organization-first Studio: projects live under an organization; teams refine access; projects deploy to multiple environments.`,kind:`reference`,visibility:`mixed`,route:`/docs/tech/studio/workspaces`,tags:[`studio`,`projects`,`teams`,`rbac`,`environments`],body:`## Concepts
|
|
2
|
+
|
|
3
|
+
- **Organization**: the primary grouping boundary for Studio projects.
|
|
4
|
+
- **Project**: one application (specs, overlays, deployments, integrations, evolution, learning).
|
|
5
|
+
- **Team**: refines who can see/edit a project within an organization.
|
|
6
|
+
- **Environment**: deployment target (Development / Staging / Production).
|
|
7
|
+
|
|
8
|
+
## Project access (teams + admin override)
|
|
9
|
+
|
|
10
|
+
Studio uses multi-team sharing to refine access:
|
|
11
|
+
|
|
12
|
+
- **Admins/owners** can access all projects.
|
|
13
|
+
- If a project is shared with **no teams**, it is **org-wide** (all org members).
|
|
14
|
+
- If a project is shared with **one or more teams**, it is visible to:
|
|
15
|
+
- admins/owners, and
|
|
16
|
+
- members of any linked team.
|
|
17
|
+
|
|
18
|
+
## Current persistence (DB + GraphQL)
|
|
19
|
+
|
|
20
|
+
- DB (Prisma): \`StudioProject\`, \`Team\`, \`TeamMember\`, \`StudioProjectTeam\`
|
|
21
|
+
- GraphQL:
|
|
22
|
+
- \`myStudioProjects\`
|
|
23
|
+
- \`createStudioProject(input.teamIds?)\`
|
|
24
|
+
- \`myTeams\`
|
|
25
|
+
- \`projectTeams(projectId)\`
|
|
26
|
+
- \`setProjectTeams(projectId, teamIds)\`
|
|
27
|
+
|
|
28
|
+
## UI shell behavior
|
|
29
|
+
|
|
30
|
+
Studio and Sandbox both use a shared shell:
|
|
31
|
+
|
|
32
|
+
- Project selector → Module navigation → Environment selector
|
|
33
|
+
- Always-on Assistant button (floating)
|
|
34
|
+
- Learning journey progress (Studio persists learning events; Sandbox stays local-only)
|
|
35
|
+
|
|
36
|
+
## Routing
|
|
37
|
+
|
|
38
|
+
- \`/studio/projects\`: create/select/delete projects (organization-first).
|
|
39
|
+
- \`/studio/{projectSlug}/*\`: project modules (canvas/specs/deploy/integrations/evolution/learning).
|
|
40
|
+
- \`/studio/learning\`: learning hub without selecting a project.
|
|
41
|
+
`}]);
|