@contractspec/lib.contracts-library 1.56.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/.turbo/turbo-build$colon$bundle.log +12 -0
- package/.turbo/turbo-build.log +15 -0
- package/AGENTS.md +28 -0
- package/CHANGELOG.md +151 -0
- package/README.md +39 -0
- package/dist/index.d.mts +13 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +182 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +38 -0
- package/src/index.ts +1 -0
- package/src/templates/index.ts +3 -0
- package/src/templates/messaging.ts +60 -0
- package/src/templates/recipes.ts +48 -0
- package/src/templates/todos.ts +57 -0
- package/tsconfig.json +4 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
$ tsdown
|
|
2
|
+
[34mℹ[39m tsdown [2mv0.19.0[22m powered by rolldown [2mv1.0.0-beta.59[22m
|
|
3
|
+
[34mℹ[39m entry: [34msrc/index.ts[39m
|
|
4
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
5
|
+
[34mℹ[39m Build start
|
|
6
|
+
[34mℹ[39m Cleaning 4 files
|
|
7
|
+
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m4.64 kB[22m [2m│ gzip: 1.15 kB[22m
|
|
8
|
+
[34mℹ[39m [2mdist/[22mindex.mjs.map [2m6.96 kB[22m [2m│ gzip: 1.45 kB[22m
|
|
9
|
+
[34mℹ[39m [2mdist/[22mindex.d.mts.map [2m0.26 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m0.57 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
11
|
+
[34mℹ[39m 4 files, total: 12.43 kB
|
|
12
|
+
[32m✔[39m Build complete in [32m20046ms[39m
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mbun build:types && bun build:bundle[0m
|
|
3
|
+
[0m[2m[35m$[0m [2m[1mtsc --noEmit[0m
|
|
4
|
+
[0m[2m[35m$[0m [2m[1mtsdown[0m
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.19.0[22m powered by rolldown [2mv1.0.0-beta.59[22m
|
|
6
|
+
[34mℹ[39m entry: [34msrc/index.ts[39m
|
|
7
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
|
+
[34mℹ[39m Build start
|
|
9
|
+
[34mℹ[39m Cleaning 4 files
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m4.64 kB[22m [2m│ gzip: 1.15 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22mindex.mjs.map [2m6.96 kB[22m [2m│ gzip: 1.45 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22mindex.d.mts.map [2m0.26 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m0.57 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
14
|
+
[34mℹ[39m 4 files, total: 12.43 kB
|
|
15
|
+
[32m✔[39m Build complete in [32m4181ms[39m
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# lib.contracts-library
|
|
2
|
+
|
|
3
|
+
Contract definitions for library templates and local runtime.
|
|
4
|
+
|
|
5
|
+
## Quick Context
|
|
6
|
+
|
|
7
|
+
- **Type**: Library (contracts)
|
|
8
|
+
- **Consumers**: `bundle.library`
|
|
9
|
+
|
|
10
|
+
## Exports
|
|
11
|
+
|
|
12
|
+
- `./templates` — Template contracts
|
|
13
|
+
- `./templates/recipes` — Recipe specs
|
|
14
|
+
- `./templates/todos` — Todo specs
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { RecipeSpec } from '@contractspec/lib.contracts-library/templates/recipes';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Commands
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
bun build # Build library
|
|
26
|
+
bun build:types # Type check
|
|
27
|
+
bun lint # Lint code
|
|
28
|
+
```
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# @contractspec/lib.contracts-library
|
|
2
|
+
|
|
3
|
+
## 1.56.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fix: release
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @contractspec/lib.contracts@1.56.0
|
|
13
|
+
- @contractspec/lib.schema@1.56.0
|
|
14
|
+
|
|
15
|
+
## 1.55.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- fix: unpublished packages
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @contractspec/lib.contracts@1.55.0
|
|
25
|
+
- @contractspec/lib.schema@1.55.0
|
|
26
|
+
|
|
27
|
+
## 1.54.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- ec5e95c: chore: upgrade dependencies
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [ec5e95c]
|
|
36
|
+
- @contractspec/lib.contracts@1.54.0
|
|
37
|
+
- @contractspec/lib.schema@1.54.0
|
|
38
|
+
|
|
39
|
+
## 1.53.0
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- f4180d4: fix: performance improvement
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [5b371b1]
|
|
48
|
+
- Updated dependencies [f4180d4]
|
|
49
|
+
- Updated dependencies [64d84e1]
|
|
50
|
+
- @contractspec/lib.contracts@1.53.0
|
|
51
|
+
- @contractspec/lib.schema@1.53.0
|
|
52
|
+
|
|
53
|
+
## 1.52.0
|
|
54
|
+
|
|
55
|
+
### Minor Changes
|
|
56
|
+
|
|
57
|
+
- d93e6a9: fix: improve website
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [d93e6a9]
|
|
62
|
+
- @contractspec/lib.contracts@1.52.0
|
|
63
|
+
- @contractspec/lib.schema@1.52.0
|
|
64
|
+
|
|
65
|
+
## 1.51.0
|
|
66
|
+
|
|
67
|
+
### Minor Changes
|
|
68
|
+
|
|
69
|
+
- e6faefb: feat: add guide to import existing codebase
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies [23e46e9]
|
|
74
|
+
- Updated dependencies [ad1f852]
|
|
75
|
+
- Updated dependencies [e6faefb]
|
|
76
|
+
- @contractspec/lib.contracts@1.51.0
|
|
77
|
+
- @contractspec/lib.schema@1.51.0
|
|
78
|
+
|
|
79
|
+
## 1.50.0
|
|
80
|
+
|
|
81
|
+
### Minor Changes
|
|
82
|
+
|
|
83
|
+
- 5325d6b: feat: improve seo
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- Updated dependencies [5325d6b]
|
|
88
|
+
- @contractspec/lib.contracts@1.50.0
|
|
89
|
+
- @contractspec/lib.schema@1.50.0
|
|
90
|
+
|
|
91
|
+
## 1.49.0
|
|
92
|
+
|
|
93
|
+
### Minor Changes
|
|
94
|
+
|
|
95
|
+
- cafd041: fix: impact report comments within github action
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- Updated dependencies [cafd041]
|
|
100
|
+
- @contractspec/lib.contracts@1.49.0
|
|
101
|
+
- @contractspec/lib.schema@1.49.0
|
|
102
|
+
|
|
103
|
+
## 1.48.1
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- Updated dependencies [c560ee7]
|
|
108
|
+
- @contractspec/lib.contracts@1.48.1
|
|
109
|
+
|
|
110
|
+
## 1.48.0
|
|
111
|
+
|
|
112
|
+
### Minor Changes
|
|
113
|
+
|
|
114
|
+
- b0444a4: feat: reduce adoption's friction by allowing generation of contracts from an analyse of the codebase
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- Updated dependencies [b0444a4]
|
|
119
|
+
- @contractspec/lib.contracts@1.48.0
|
|
120
|
+
- @contractspec/lib.schema@1.48.0
|
|
121
|
+
|
|
122
|
+
## 1.47.0
|
|
123
|
+
|
|
124
|
+
### Minor Changes
|
|
125
|
+
|
|
126
|
+
- caf8701: feat: add cli vibe command to run workflow
|
|
127
|
+
- c69b849: feat: add api web services (mcp & website)
|
|
128
|
+
- 42b8d78: feat: add cli `contractspec vibe` workflow to simplify usage
|
|
129
|
+
- fd38e85: feat: auto-fix contractspec issues
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- e7ded36: feat: improve stability (adding ts-morph)
|
|
134
|
+
- c231a8b: test: improve workspace stability
|
|
135
|
+
- Updated dependencies [e7ded36]
|
|
136
|
+
- Updated dependencies [caf8701]
|
|
137
|
+
- Updated dependencies [c69b849]
|
|
138
|
+
- Updated dependencies [c231a8b]
|
|
139
|
+
- Updated dependencies [42b8d78]
|
|
140
|
+
- Updated dependencies [fd38e85]
|
|
141
|
+
- @contractspec/lib.contracts@1.47.0
|
|
142
|
+
- @contractspec/lib.schema@1.47.0
|
|
143
|
+
|
|
144
|
+
## 1.46.2
|
|
145
|
+
|
|
146
|
+
### Patch Changes
|
|
147
|
+
|
|
148
|
+
- 7e21625: feat: library services (landing page & api)
|
|
149
|
+
- Updated dependencies [7e21625]
|
|
150
|
+
- @contractspec/lib.contracts@1.46.2
|
|
151
|
+
- @contractspec/lib.schema@1.46.2
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @contractspec/lib.contracts-library
|
|
2
|
+
|
|
3
|
+
Contract definitions for the ContractSpec library experience including templates and local runtime.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This library provides contract specs for:
|
|
8
|
+
- Template definitions (todos, recipes)
|
|
9
|
+
- Local runtime operations
|
|
10
|
+
- Library-specific queries and commands
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
bun add @contractspec/lib.contracts-library
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Exports
|
|
19
|
+
|
|
20
|
+
- `./templates` — Template contract definitions
|
|
21
|
+
- `./templates/recipes` — Recipe template specs
|
|
22
|
+
- `./templates/todos` — Todo template specs
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { RecipeSpec } from '@contractspec/lib.contracts-library/templates/recipes';
|
|
28
|
+
import { TodoSpec } from '@contractspec/lib.contracts-library/templates/todos';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Dependencies
|
|
32
|
+
|
|
33
|
+
- `@contractspec/lib.contracts` — Core contract primitives
|
|
34
|
+
- `@contractspec/lib.schema` — Schema utilities
|
|
35
|
+
|
|
36
|
+
## Related Packages
|
|
37
|
+
|
|
38
|
+
- [`@contractspec/bundle.library`](../../bundles/library/README.md) — Implementation
|
|
39
|
+
- [`@contractspec/lib.contracts-studio`](../contracts-studio/README.md) — Studio contracts
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/templates/recipes.d.ts
|
|
4
|
+
declare const RecipeCapability: _contractspec_lib_contracts0.CapabilitySpec;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/templates/todos.d.ts
|
|
7
|
+
declare const TaskCrudCapability: _contractspec_lib_contracts0.CapabilitySpec;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/templates/messaging.d.ts
|
|
10
|
+
declare const MessagingCapability: _contractspec_lib_contracts0.CapabilitySpec;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { MessagingCapability, RecipeCapability, TaskCrudCapability };
|
|
13
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/templates/recipes.ts","../src/templates/todos.ts","../src/templates/messaging.ts"],"sourcesContent":[],"mappings":";;;cAIa,kBA2CX,4BAAA,CA3C2B;;;cCAhB,oBAoDX,4BAAA,CApD6B;;;cCAlB,qBAuDX,4BAAA,CAvD8B"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { StabilityEnum, defineCapability } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/templates/recipes.ts
|
|
4
|
+
const OWNERS$2 = ["platform.contractspec-studio"];
|
|
5
|
+
const RecipeCapability = defineCapability({
|
|
6
|
+
meta: {
|
|
7
|
+
key: "template.recipes.browse",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
kind: "api",
|
|
10
|
+
title: "Template Recipe Browser",
|
|
11
|
+
description: "Internationalized recipe browsing, search, and detail operations for template applications.",
|
|
12
|
+
domain: "templates",
|
|
13
|
+
owners: [...OWNERS$2],
|
|
14
|
+
tags: [
|
|
15
|
+
"templates",
|
|
16
|
+
"recipes",
|
|
17
|
+
"i18n",
|
|
18
|
+
"content"
|
|
19
|
+
],
|
|
20
|
+
stability: StabilityEnum.Stable
|
|
21
|
+
},
|
|
22
|
+
provides: [
|
|
23
|
+
{
|
|
24
|
+
surface: "operation",
|
|
25
|
+
key: "template.recipe.list",
|
|
26
|
+
version: "1.0.0",
|
|
27
|
+
description: "List recipes with category, difficulty, and locale filters."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
surface: "operation",
|
|
31
|
+
key: "template.recipe.get",
|
|
32
|
+
version: "1.0.0",
|
|
33
|
+
description: "Fetch a recipe detail view including localized content."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
surface: "operation",
|
|
37
|
+
key: "template.recipe.search",
|
|
38
|
+
version: "1.0.0",
|
|
39
|
+
description: "Search recipes by ingredient, tag, or free text with i18n support."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
surface: "operation",
|
|
43
|
+
key: "template.recipe.favorite",
|
|
44
|
+
version: "1.0.0",
|
|
45
|
+
description: "Toggle recipe favorites for showcasing personalization patterns."
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
requires: [{
|
|
49
|
+
key: "studio.project",
|
|
50
|
+
version: "1.0.0"
|
|
51
|
+
}]
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/templates/todos.ts
|
|
56
|
+
const OWNERS$1 = ["platform.contractspec-studio"];
|
|
57
|
+
const TaskCrudCapability = defineCapability({
|
|
58
|
+
meta: {
|
|
59
|
+
key: "template.todos.crud",
|
|
60
|
+
version: "1.0.0",
|
|
61
|
+
kind: "api",
|
|
62
|
+
title: "Template Tasks CRUD",
|
|
63
|
+
description: "Create, read, update, delete, and toggle template tasks with categories and priorities.",
|
|
64
|
+
domain: "templates",
|
|
65
|
+
owners: [...OWNERS$1],
|
|
66
|
+
tags: [
|
|
67
|
+
"templates",
|
|
68
|
+
"todos",
|
|
69
|
+
"productivity"
|
|
70
|
+
],
|
|
71
|
+
stability: StabilityEnum.Stable
|
|
72
|
+
},
|
|
73
|
+
provides: [
|
|
74
|
+
{
|
|
75
|
+
surface: "operation",
|
|
76
|
+
key: "template.task.create",
|
|
77
|
+
version: "1.0.0",
|
|
78
|
+
description: "Create a new task for a Studio project template."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
surface: "operation",
|
|
82
|
+
key: "template.task.update",
|
|
83
|
+
version: "1.0.0",
|
|
84
|
+
description: "Update task metadata such as title, due date, or category."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
surface: "operation",
|
|
88
|
+
key: "template.task.delete",
|
|
89
|
+
version: "1.0.0",
|
|
90
|
+
description: "Delete or archive a task from a template project."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
surface: "operation",
|
|
94
|
+
key: "template.task.toggle",
|
|
95
|
+
version: "1.0.0",
|
|
96
|
+
description: "Mark a task as completed or active."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
surface: "operation",
|
|
100
|
+
key: "template.task.list",
|
|
101
|
+
version: "1.0.0",
|
|
102
|
+
description: "List tasks with filtering, search, and sorting."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
surface: "operation",
|
|
106
|
+
key: "template.task.category",
|
|
107
|
+
version: "1.0.0",
|
|
108
|
+
description: "Manage categories and tags for tasks."
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
requires: [{
|
|
112
|
+
key: "studio.project",
|
|
113
|
+
version: "1.0.0"
|
|
114
|
+
}]
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/templates/messaging.ts
|
|
119
|
+
const OWNERS = ["platform.contractspec-studio"];
|
|
120
|
+
const MessagingCapability = defineCapability({
|
|
121
|
+
meta: {
|
|
122
|
+
key: "template.messaging.core",
|
|
123
|
+
version: "1.0.0",
|
|
124
|
+
kind: "api",
|
|
125
|
+
title: "Template Messaging Core",
|
|
126
|
+
description: "Real-time messaging primitives for template applications, including conversations, participants, and delivery events.",
|
|
127
|
+
domain: "templates",
|
|
128
|
+
owners: [...OWNERS],
|
|
129
|
+
tags: [
|
|
130
|
+
"templates",
|
|
131
|
+
"messaging",
|
|
132
|
+
"realtime"
|
|
133
|
+
],
|
|
134
|
+
stability: StabilityEnum.Experimental
|
|
135
|
+
},
|
|
136
|
+
provides: [
|
|
137
|
+
{
|
|
138
|
+
surface: "operation",
|
|
139
|
+
key: "template.messaging.conversation.create",
|
|
140
|
+
version: "1.0.0",
|
|
141
|
+
description: "Create a direct or group conversation scoped to a Studio project."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
surface: "operation",
|
|
145
|
+
key: "template.messaging.conversation.list",
|
|
146
|
+
version: "1.0.0",
|
|
147
|
+
description: "List conversations with pagination, unread counts, and filters."
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
surface: "operation",
|
|
151
|
+
key: "template.messaging.message.send",
|
|
152
|
+
version: "1.0.0",
|
|
153
|
+
description: "Send a message with attachments and optimistic delivery state."
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
surface: "operation",
|
|
157
|
+
key: "template.messaging.message.read",
|
|
158
|
+
version: "1.0.0",
|
|
159
|
+
description: "Mark messages as read and update participant cursors."
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
surface: "event",
|
|
163
|
+
key: "template.messaging.message.received",
|
|
164
|
+
version: "1.0.0",
|
|
165
|
+
description: "Emitted when a participant receives a new message."
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
surface: "event",
|
|
169
|
+
key: "template.messaging.typing",
|
|
170
|
+
version: "1.0.0",
|
|
171
|
+
description: "Emitted when a participant is typing in a conversation."
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
requires: [{
|
|
175
|
+
key: "studio.project",
|
|
176
|
+
version: "1.0.0"
|
|
177
|
+
}]
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
//#endregion
|
|
181
|
+
export { MessagingCapability, RecipeCapability, TaskCrudCapability };
|
|
182
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["OWNERS","OWNERS"],"sources":["../src/templates/recipes.ts","../src/templates/todos.ts","../src/templates/messaging.ts"],"sourcesContent":["import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';\n\nconst OWNERS = ['platform.contractspec-studio'] as const;\n\nexport const RecipeCapability = defineCapability({\n meta: {\n key: 'template.recipes.browse',\n version: '1.0.0',\n kind: 'api',\n title: 'Template Recipe Browser',\n description:\n 'Internationalized recipe browsing, search, and detail operations for template applications.',\n domain: 'templates',\n owners: [...OWNERS],\n tags: ['templates', 'recipes', 'i18n', 'content'],\n stability: StabilityEnum.Stable,\n },\n provides: [\n {\n surface: 'operation',\n key: 'template.recipe.list',\n version: '1.0.0',\n description:\n 'List recipes with category, difficulty, and locale filters.',\n },\n {\n surface: 'operation',\n key: 'template.recipe.get',\n version: '1.0.0',\n description: 'Fetch a recipe detail view including localized content.',\n },\n {\n surface: 'operation',\n key: 'template.recipe.search',\n version: '1.0.0',\n description:\n 'Search recipes by ingredient, tag, or free text with i18n support.',\n },\n {\n surface: 'operation',\n key: 'template.recipe.favorite',\n version: '1.0.0',\n description:\n 'Toggle recipe favorites for showcasing personalization patterns.',\n },\n ],\n requires: [{ key: 'studio.project', version: '1.0.0' }],\n});\n","import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';\n\nconst OWNERS = ['platform.contractspec-studio'] as const;\n\nexport const TaskCrudCapability = defineCapability({\n meta: {\n key: 'template.todos.crud',\n version: '1.0.0',\n kind: 'api',\n title: 'Template Tasks CRUD',\n description:\n 'Create, read, update, delete, and toggle template tasks with categories and priorities.',\n domain: 'templates',\n owners: [...OWNERS],\n tags: ['templates', 'todos', 'productivity'],\n stability: StabilityEnum.Stable,\n },\n provides: [\n {\n surface: 'operation',\n key: 'template.task.create',\n version: '1.0.0',\n description: 'Create a new task for a Studio project template.',\n },\n {\n surface: 'operation',\n key: 'template.task.update',\n version: '1.0.0',\n description: 'Update task metadata such as title, due date, or category.',\n },\n {\n surface: 'operation',\n key: 'template.task.delete',\n version: '1.0.0',\n description: 'Delete or archive a task from a template project.',\n },\n {\n surface: 'operation',\n key: 'template.task.toggle',\n version: '1.0.0',\n description: 'Mark a task as completed or active.',\n },\n {\n surface: 'operation',\n key: 'template.task.list',\n version: '1.0.0',\n description: 'List tasks with filtering, search, and sorting.',\n },\n {\n surface: 'operation',\n key: 'template.task.category',\n version: '1.0.0',\n description: 'Manage categories and tags for tasks.',\n },\n ],\n requires: [{ key: 'studio.project', version: '1.0.0' }],\n});\n","import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';\n\nconst OWNERS = ['platform.contractspec-studio'] as const;\n\nexport const MessagingCapability = defineCapability({\n meta: {\n key: 'template.messaging.core',\n version: '1.0.0',\n kind: 'api',\n title: 'Template Messaging Core',\n description:\n 'Real-time messaging primitives for template applications, including conversations, participants, and delivery events.',\n domain: 'templates',\n owners: [...OWNERS],\n tags: ['templates', 'messaging', 'realtime'],\n stability: StabilityEnum.Experimental,\n },\n provides: [\n {\n surface: 'operation',\n key: 'template.messaging.conversation.create',\n version: '1.0.0',\n description:\n 'Create a direct or group conversation scoped to a Studio project.',\n },\n {\n surface: 'operation',\n key: 'template.messaging.conversation.list',\n version: '1.0.0',\n description:\n 'List conversations with pagination, unread counts, and filters.',\n },\n {\n surface: 'operation',\n key: 'template.messaging.message.send',\n version: '1.0.0',\n description:\n 'Send a message with attachments and optimistic delivery state.',\n },\n {\n surface: 'operation',\n key: 'template.messaging.message.read',\n version: '1.0.0',\n description: 'Mark messages as read and update participant cursors.',\n },\n {\n surface: 'event',\n key: 'template.messaging.message.received',\n version: '1.0.0',\n description: 'Emitted when a participant receives a new message.',\n },\n {\n surface: 'event',\n key: 'template.messaging.typing',\n version: '1.0.0',\n description: 'Emitted when a participant is typing in a conversation.',\n },\n ],\n requires: [{ key: 'studio.project', version: '1.0.0' }],\n});\n"],"mappings":";;;AAEA,MAAMA,WAAS,CAAC,+BAA+B;AAE/C,MAAa,mBAAmB,iBAAiB;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,GAAGA,SAAO;EACnB,MAAM;GAAC;GAAa;GAAW;GAAQ;GAAU;EACjD,WAAW,cAAc;EAC1B;CACD,UAAU;EACR;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aACE;GACH;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aACE;GACH;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aACE;GACH;EACF;CACD,UAAU,CAAC;EAAE,KAAK;EAAkB,SAAS;EAAS,CAAC;CACxD,CAAC;;;;AC7CF,MAAMC,WAAS,CAAC,+BAA+B;AAE/C,MAAa,qBAAqB,iBAAiB;CACjD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,GAAGA,SAAO;EACnB,MAAM;GAAC;GAAa;GAAS;GAAe;EAC5C,WAAW,cAAc;EAC1B;CACD,UAAU;EACR;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACF;CACD,UAAU,CAAC;EAAE,KAAK;EAAkB,SAAS;EAAS,CAAC;CACxD,CAAC;;;;ACtDF,MAAM,SAAS,CAAC,+BAA+B;AAE/C,MAAa,sBAAsB,iBAAiB;CAClD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,MAAM;EACN,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAa;GAAa;GAAW;EAC5C,WAAW,cAAc;EAC1B;CACD,UAAU;EACR;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aACE;GACH;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aACE;GACH;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aACE;GACH;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,KAAK;GACL,SAAS;GACT,aAAa;GACd;EACF;CACD,UAAU,CAAC;EAAE,KAAK;EAAkB,SAAS;EAAS,CAAC;CACxD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@contractspec/lib.contracts-library",
|
|
3
|
+
"version": "1.56.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
7
|
+
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
8
|
+
"clean": "rm -rf dist",
|
|
9
|
+
"lint": "bun run lint:fix",
|
|
10
|
+
"lint:fix": "eslint src --fix",
|
|
11
|
+
"lint:check": "eslint src",
|
|
12
|
+
"build": "bun build:types && bun build:bundle",
|
|
13
|
+
"build:bundle": "tsdown",
|
|
14
|
+
"build:types": "tsc --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public",
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": "./dist/index.js",
|
|
22
|
+
"./templates": "./dist/templates/index.js",
|
|
23
|
+
"./templates/recipes": "./dist/templates/recipes.js",
|
|
24
|
+
"./templates/todos": "./dist/templates/todos.js"
|
|
25
|
+
},
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@contractspec/lib.contracts": "1.56.0",
|
|
30
|
+
"@contractspec/lib.schema": "1.56.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@contractspec/tool.tsdown": "1.56.0",
|
|
34
|
+
"@contractspec/tool.typescript": "1.56.0",
|
|
35
|
+
"tsdown": "^0.19.0",
|
|
36
|
+
"typescript": "^5.9.3"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './templates';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';
|
|
2
|
+
|
|
3
|
+
const OWNERS = ['platform.contractspec-studio'] as const;
|
|
4
|
+
|
|
5
|
+
export const MessagingCapability = defineCapability({
|
|
6
|
+
meta: {
|
|
7
|
+
key: 'template.messaging.core',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
kind: 'api',
|
|
10
|
+
title: 'Template Messaging Core',
|
|
11
|
+
description:
|
|
12
|
+
'Real-time messaging primitives for template applications, including conversations, participants, and delivery events.',
|
|
13
|
+
domain: 'templates',
|
|
14
|
+
owners: [...OWNERS],
|
|
15
|
+
tags: ['templates', 'messaging', 'realtime'],
|
|
16
|
+
stability: StabilityEnum.Experimental,
|
|
17
|
+
},
|
|
18
|
+
provides: [
|
|
19
|
+
{
|
|
20
|
+
surface: 'operation',
|
|
21
|
+
key: 'template.messaging.conversation.create',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
description:
|
|
24
|
+
'Create a direct or group conversation scoped to a Studio project.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
surface: 'operation',
|
|
28
|
+
key: 'template.messaging.conversation.list',
|
|
29
|
+
version: '1.0.0',
|
|
30
|
+
description:
|
|
31
|
+
'List conversations with pagination, unread counts, and filters.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
surface: 'operation',
|
|
35
|
+
key: 'template.messaging.message.send',
|
|
36
|
+
version: '1.0.0',
|
|
37
|
+
description:
|
|
38
|
+
'Send a message with attachments and optimistic delivery state.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
surface: 'operation',
|
|
42
|
+
key: 'template.messaging.message.read',
|
|
43
|
+
version: '1.0.0',
|
|
44
|
+
description: 'Mark messages as read and update participant cursors.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
surface: 'event',
|
|
48
|
+
key: 'template.messaging.message.received',
|
|
49
|
+
version: '1.0.0',
|
|
50
|
+
description: 'Emitted when a participant receives a new message.',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
surface: 'event',
|
|
54
|
+
key: 'template.messaging.typing',
|
|
55
|
+
version: '1.0.0',
|
|
56
|
+
description: 'Emitted when a participant is typing in a conversation.',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
requires: [{ key: 'studio.project', version: '1.0.0' }],
|
|
60
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';
|
|
2
|
+
|
|
3
|
+
const OWNERS = ['platform.contractspec-studio'] as const;
|
|
4
|
+
|
|
5
|
+
export const RecipeCapability = defineCapability({
|
|
6
|
+
meta: {
|
|
7
|
+
key: 'template.recipes.browse',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
kind: 'api',
|
|
10
|
+
title: 'Template Recipe Browser',
|
|
11
|
+
description:
|
|
12
|
+
'Internationalized recipe browsing, search, and detail operations for template applications.',
|
|
13
|
+
domain: 'templates',
|
|
14
|
+
owners: [...OWNERS],
|
|
15
|
+
tags: ['templates', 'recipes', 'i18n', 'content'],
|
|
16
|
+
stability: StabilityEnum.Stable,
|
|
17
|
+
},
|
|
18
|
+
provides: [
|
|
19
|
+
{
|
|
20
|
+
surface: 'operation',
|
|
21
|
+
key: 'template.recipe.list',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
description:
|
|
24
|
+
'List recipes with category, difficulty, and locale filters.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
surface: 'operation',
|
|
28
|
+
key: 'template.recipe.get',
|
|
29
|
+
version: '1.0.0',
|
|
30
|
+
description: 'Fetch a recipe detail view including localized content.',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
surface: 'operation',
|
|
34
|
+
key: 'template.recipe.search',
|
|
35
|
+
version: '1.0.0',
|
|
36
|
+
description:
|
|
37
|
+
'Search recipes by ingredient, tag, or free text with i18n support.',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
surface: 'operation',
|
|
41
|
+
key: 'template.recipe.favorite',
|
|
42
|
+
version: '1.0.0',
|
|
43
|
+
description:
|
|
44
|
+
'Toggle recipe favorites for showcasing personalization patterns.',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
requires: [{ key: 'studio.project', version: '1.0.0' }],
|
|
48
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';
|
|
2
|
+
|
|
3
|
+
const OWNERS = ['platform.contractspec-studio'] as const;
|
|
4
|
+
|
|
5
|
+
export const TaskCrudCapability = defineCapability({
|
|
6
|
+
meta: {
|
|
7
|
+
key: 'template.todos.crud',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
kind: 'api',
|
|
10
|
+
title: 'Template Tasks CRUD',
|
|
11
|
+
description:
|
|
12
|
+
'Create, read, update, delete, and toggle template tasks with categories and priorities.',
|
|
13
|
+
domain: 'templates',
|
|
14
|
+
owners: [...OWNERS],
|
|
15
|
+
tags: ['templates', 'todos', 'productivity'],
|
|
16
|
+
stability: StabilityEnum.Stable,
|
|
17
|
+
},
|
|
18
|
+
provides: [
|
|
19
|
+
{
|
|
20
|
+
surface: 'operation',
|
|
21
|
+
key: 'template.task.create',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
description: 'Create a new task for a Studio project template.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
surface: 'operation',
|
|
27
|
+
key: 'template.task.update',
|
|
28
|
+
version: '1.0.0',
|
|
29
|
+
description: 'Update task metadata such as title, due date, or category.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
surface: 'operation',
|
|
33
|
+
key: 'template.task.delete',
|
|
34
|
+
version: '1.0.0',
|
|
35
|
+
description: 'Delete or archive a task from a template project.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
surface: 'operation',
|
|
39
|
+
key: 'template.task.toggle',
|
|
40
|
+
version: '1.0.0',
|
|
41
|
+
description: 'Mark a task as completed or active.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
surface: 'operation',
|
|
45
|
+
key: 'template.task.list',
|
|
46
|
+
version: '1.0.0',
|
|
47
|
+
description: 'List tasks with filtering, search, and sorting.',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
surface: 'operation',
|
|
51
|
+
key: 'template.task.category',
|
|
52
|
+
version: '1.0.0',
|
|
53
|
+
description: 'Manage categories and tags for tasks.',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
requires: [{ key: 'studio.project', version: '1.0.0' }],
|
|
57
|
+
});
|
package/tsconfig.json
ADDED