@lssm/lib.work-spec 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -0
- package/dist/browser/capabilities.js +1 -0
- package/dist/browser/common.js +1 -0
- package/dist/browser/entities.js +1 -0
- package/dist/browser/events.js +1 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/models.js +1 -0
- package/dist/browser/object-read.js +1 -0
- package/dist/browser/operations.js +1 -0
- package/dist/browser/sync.js +1 -0
- package/dist/browser/task-status.js +1 -0
- package/dist/browser/taxonomy.js +1 -0
- package/dist/browser/work-spec.feature.js +1 -0
- package/dist/browser/workspace-revision.js +1 -0
- package/dist/capabilities.d.ts +42 -0
- package/dist/capabilities.js +2 -0
- package/dist/common.d.ts +115 -0
- package/dist/common.js +2 -0
- package/dist/entities.d.ts +1143 -0
- package/dist/entities.js +2 -0
- package/dist/events.d.ts +10057 -0
- package/dist/events.js +2 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2 -0
- package/dist/models.d.ts +1080 -0
- package/dist/models.js +2 -0
- package/dist/node/capabilities.js +1 -0
- package/dist/node/common.js +1 -0
- package/dist/node/entities.js +1 -0
- package/dist/node/events.js +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/models.js +1 -0
- package/dist/node/object-read.js +1 -0
- package/dist/node/operations.js +1 -0
- package/dist/node/sync.js +1 -0
- package/dist/node/task-status.js +1 -0
- package/dist/node/taxonomy.js +1 -0
- package/dist/node/work-spec.feature.js +1 -0
- package/dist/node/workspace-revision.js +1 -0
- package/dist/object-read.d.ts +644 -0
- package/dist/object-read.js +2 -0
- package/dist/operations.d.ts +165 -0
- package/dist/operations.js +2 -0
- package/dist/sync.d.ts +545 -0
- package/dist/sync.js +2 -0
- package/dist/task-status.d.ts +3369 -0
- package/dist/task-status.js +2 -0
- package/dist/taxonomy.d.ts +84 -0
- package/dist/taxonomy.js +2 -0
- package/dist/work-spec.feature.d.ts +11 -0
- package/dist/work-spec.feature.js +2 -0
- package/dist/work-spec.test.d.ts +1 -0
- package/dist/workspace-revision.d.ts +19 -0
- package/dist/workspace-revision.js +2 -0
- package/package.json +343 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const WorkActionClassSchema: z.ZodEnum<{
|
|
3
|
+
approval_required: "approval_required";
|
|
4
|
+
read_only: "read_only";
|
|
5
|
+
reserved_human_only: "reserved_human_only";
|
|
6
|
+
suggest_only: "suggest_only";
|
|
7
|
+
within_policy: "within_policy";
|
|
8
|
+
}>;
|
|
9
|
+
export type WorkActionClass = z.infer<typeof WorkActionClassSchema>;
|
|
10
|
+
export declare const WorkOperationKeySchema: z.ZodEnum<{
|
|
11
|
+
"work.attachment.link@2.0.0": "work.attachment.link@2.0.0";
|
|
12
|
+
"work.comment.create@2.0.0": "work.comment.create@2.0.0";
|
|
13
|
+
"work.custom_field.set@2.0.0": "work.custom_field.set@2.0.0";
|
|
14
|
+
"work.inbox.capture@2.0.0": "work.inbox.capture@2.0.0";
|
|
15
|
+
"work.object.archive@2.0.0": "work.object.archive@2.0.0";
|
|
16
|
+
"work.object.assign@2.0.0": "work.object.assign@2.0.0";
|
|
17
|
+
"work.object.bulk_mutate@2.0.0": "work.object.bulk_mutate@2.0.0";
|
|
18
|
+
"work.object.create@2.0.0": "work.object.create@2.0.0";
|
|
19
|
+
"work.object.move@2.0.0": "work.object.move@2.0.0";
|
|
20
|
+
"work.object.restore@2.0.0": "work.object.restore@2.0.0";
|
|
21
|
+
"work.object.transition@2.0.0": "work.object.transition@2.0.0";
|
|
22
|
+
"work.object.update@2.0.0": "work.object.update@2.0.0";
|
|
23
|
+
"work.recurrence.set@2.0.0": "work.recurrence.set@2.0.0";
|
|
24
|
+
"work.relationship.set@2.0.0": "work.relationship.set@2.0.0";
|
|
25
|
+
"work.search.query@2.0.0": "work.search.query@2.0.0";
|
|
26
|
+
"work.sync.connect@2.0.0": "work.sync.connect@2.0.0";
|
|
27
|
+
"work.sync.import@2.0.0": "work.sync.import@2.0.0";
|
|
28
|
+
"work.sync.push@2.0.0": "work.sync.push@2.0.0";
|
|
29
|
+
"work.sync.resolve_conflict@2.0.0": "work.sync.resolve_conflict@2.0.0";
|
|
30
|
+
"work.time.start@2.0.0": "work.time.start@2.0.0";
|
|
31
|
+
"work.time.stop@2.0.0": "work.time.stop@2.0.0";
|
|
32
|
+
}>;
|
|
33
|
+
export type WorkOperationKey = z.infer<typeof WorkOperationKeySchema>;
|
|
34
|
+
export declare const WorkMutationEnvelopeSchema: z.ZodObject<{
|
|
35
|
+
operationId: z.ZodString;
|
|
36
|
+
operationKey: z.ZodEnum<{
|
|
37
|
+
"work.attachment.link@2.0.0": "work.attachment.link@2.0.0";
|
|
38
|
+
"work.comment.create@2.0.0": "work.comment.create@2.0.0";
|
|
39
|
+
"work.custom_field.set@2.0.0": "work.custom_field.set@2.0.0";
|
|
40
|
+
"work.inbox.capture@2.0.0": "work.inbox.capture@2.0.0";
|
|
41
|
+
"work.object.archive@2.0.0": "work.object.archive@2.0.0";
|
|
42
|
+
"work.object.assign@2.0.0": "work.object.assign@2.0.0";
|
|
43
|
+
"work.object.bulk_mutate@2.0.0": "work.object.bulk_mutate@2.0.0";
|
|
44
|
+
"work.object.create@2.0.0": "work.object.create@2.0.0";
|
|
45
|
+
"work.object.move@2.0.0": "work.object.move@2.0.0";
|
|
46
|
+
"work.object.restore@2.0.0": "work.object.restore@2.0.0";
|
|
47
|
+
"work.object.transition@2.0.0": "work.object.transition@2.0.0";
|
|
48
|
+
"work.object.update@2.0.0": "work.object.update@2.0.0";
|
|
49
|
+
"work.recurrence.set@2.0.0": "work.recurrence.set@2.0.0";
|
|
50
|
+
"work.relationship.set@2.0.0": "work.relationship.set@2.0.0";
|
|
51
|
+
"work.search.query@2.0.0": "work.search.query@2.0.0";
|
|
52
|
+
"work.sync.connect@2.0.0": "work.sync.connect@2.0.0";
|
|
53
|
+
"work.sync.import@2.0.0": "work.sync.import@2.0.0";
|
|
54
|
+
"work.sync.push@2.0.0": "work.sync.push@2.0.0";
|
|
55
|
+
"work.sync.resolve_conflict@2.0.0": "work.sync.resolve_conflict@2.0.0";
|
|
56
|
+
"work.time.start@2.0.0": "work.time.start@2.0.0";
|
|
57
|
+
"work.time.stop@2.0.0": "work.time.stop@2.0.0";
|
|
58
|
+
}>;
|
|
59
|
+
scope: z.ZodObject<{
|
|
60
|
+
tenantId: z.ZodString;
|
|
61
|
+
organizationId: z.ZodString;
|
|
62
|
+
workspaceId: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
actor: z.ZodObject<{
|
|
65
|
+
principalId: z.ZodString;
|
|
66
|
+
principalKind: z.ZodEnum<{
|
|
67
|
+
contractor: "contractor";
|
|
68
|
+
guest: "guest";
|
|
69
|
+
member: "member";
|
|
70
|
+
service_principal: "service_principal";
|
|
71
|
+
}>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
kind: z.ZodEnum<{
|
|
76
|
+
activity: "activity";
|
|
77
|
+
agent_reference: "agent_reference";
|
|
78
|
+
approval_reference: "approval_reference";
|
|
79
|
+
attachment: "attachment";
|
|
80
|
+
automation_reference: "automation_reference";
|
|
81
|
+
bug: "bug";
|
|
82
|
+
canvas_reference: "canvas_reference";
|
|
83
|
+
capture_reference: "capture_reference";
|
|
84
|
+
collection: "collection";
|
|
85
|
+
comment: "comment";
|
|
86
|
+
contractor: "contractor";
|
|
87
|
+
cross_organization_acl_grant: "cross_organization_acl_grant";
|
|
88
|
+
custom_field_definition: "custom_field_definition";
|
|
89
|
+
custom_field_value: "custom_field_value";
|
|
90
|
+
cycle: "cycle";
|
|
91
|
+
dependency: "dependency";
|
|
92
|
+
document_reference: "document_reference";
|
|
93
|
+
epic: "epic";
|
|
94
|
+
estimate: "estimate";
|
|
95
|
+
evidence_reference: "evidence_reference";
|
|
96
|
+
external_binding: "external_binding";
|
|
97
|
+
focus_policy: "focus_policy";
|
|
98
|
+
folder_projection: "folder_projection";
|
|
99
|
+
form: "form";
|
|
100
|
+
guest: "guest";
|
|
101
|
+
habit: "habit";
|
|
102
|
+
inbox_item: "inbox_item";
|
|
103
|
+
initiative: "initiative";
|
|
104
|
+
issue: "issue";
|
|
105
|
+
key_result: "key_result";
|
|
106
|
+
list: "list";
|
|
107
|
+
member: "member";
|
|
108
|
+
mention: "mention";
|
|
109
|
+
milestone: "milestone";
|
|
110
|
+
objective: "objective";
|
|
111
|
+
occurrence: "occurrence";
|
|
112
|
+
organization: "organization";
|
|
113
|
+
planning_intent: "planning_intent";
|
|
114
|
+
portfolio: "portfolio";
|
|
115
|
+
program: "program";
|
|
116
|
+
project: "project";
|
|
117
|
+
proofing_request: "proofing_request";
|
|
118
|
+
reaction: "reaction";
|
|
119
|
+
recurrence_template: "recurrence_template";
|
|
120
|
+
relationship: "relationship";
|
|
121
|
+
roadmap: "roadmap";
|
|
122
|
+
saved_view: "saved_view";
|
|
123
|
+
schedule_binding_reference: "schedule_binding_reference";
|
|
124
|
+
service_principal: "service_principal";
|
|
125
|
+
status_workflow: "status_workflow";
|
|
126
|
+
story: "story";
|
|
127
|
+
subtask: "subtask";
|
|
128
|
+
sync_conflict: "sync_conflict";
|
|
129
|
+
sync_cursor: "sync_cursor";
|
|
130
|
+
task: "task";
|
|
131
|
+
team: "team";
|
|
132
|
+
template: "template";
|
|
133
|
+
time_entry: "time_entry";
|
|
134
|
+
tombstone: "tombstone";
|
|
135
|
+
workspace: "workspace";
|
|
136
|
+
}>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
expectedRevision: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
idempotencyKey: z.ZodString;
|
|
140
|
+
correlationId: z.ZodString;
|
|
141
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
142
|
+
evidenceRef: z.ZodString;
|
|
143
|
+
actionClass: z.ZodEnum<{
|
|
144
|
+
approval_required: "approval_required";
|
|
145
|
+
read_only: "read_only";
|
|
146
|
+
reserved_human_only: "reserved_human_only";
|
|
147
|
+
suggest_only: "suggest_only";
|
|
148
|
+
within_policy: "within_policy";
|
|
149
|
+
}>;
|
|
150
|
+
approvalRef: z.ZodOptional<z.ZodString>;
|
|
151
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
export type WorkMutationEnvelope = z.infer<typeof WorkMutationEnvelopeSchema>;
|
|
154
|
+
export declare function mutationRequiresApproval(mutation: WorkMutationEnvelope): boolean;
|
|
155
|
+
/** Managed hosts keep verified authority and canonical Work effects in one transaction. */
|
|
156
|
+
export declare const WORK_MANAGED_COMMIT_AUTHORITY_CONTRACT: {
|
|
157
|
+
readonly key: 'work.managed-commit-authority';
|
|
158
|
+
readonly version: '1.2.0';
|
|
159
|
+
readonly invariants: readonly ['Aggregate commits serialize by tenant and object identity and cannot change an existing aggregate scope. Projection workers cannot overwrite a newer revision with an older one.', 'Object reads use a projection only at the committed event head; lagging projections replay current events, including archives and restores, and expose the current aggregate revision.', 'Projection lookups validate object identity and the complete tenant/organization/workspace scope, on both materialized and event-replay paths.', 'Mutation services reject foreign or mismatched current objects and replay receipts before returning data or committing effects.', 'Organization, session, workspace and applicable team grants are re-proven and locked on the same transaction as event and outbox persistence.', 'Canonical scope and principal must match verified authority; caller-selected read_only or suggest_only labels cannot authorize mutation.', 'Authorized idempotent retries resolve the persisted receipt before object-existence or current-revision validation.', 'Approval-required and reserved mutations remain denied until an actual approval verifier is composed.'];
|
|
160
|
+
};
|
|
161
|
+
export declare const WORK_CANONICAL_SCOPE_BINDING_CONTRACT: {
|
|
162
|
+
readonly key: 'work.canonical-scope-binding';
|
|
163
|
+
readonly version: '1.0.0';
|
|
164
|
+
readonly invariants: readonly ['New actor bindings reuse canonical tenant, organization and workspace IDs for the same verified legacy scope.', 'A principal retains its canonical identity across workspaces within a tenant.', 'Existing bindings and immutable Work events are never silently rewritten. Ambiguous legacy parents block new allocation until reviewed reconciliation.', 'Allocation is serialized per legacy tenant and enforced by the database during mixed-version rollout.'];
|
|
165
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as e}from"zod";import{z as o}from"zod";import{z as n}from"zod";var c=n.enum(["organization","workspace","team","member","guest","contractor","service_principal","cross_organization_acl_grant","portfolio","initiative","program","objective","key_result","roadmap","project","cycle","milestone","task","issue","bug","story","epic","subtask","recurrence_template","occurrence","dependency","relationship","estimate","time_entry","collection","list","folder_projection","status_workflow","custom_field_definition","custom_field_value","saved_view","form","template","comment","mention","reaction","activity","attachment","document_reference","canvas_reference","proofing_request","approval_reference","inbox_item","habit","focus_policy","planning_intent","capture_reference","automation_reference","agent_reference","schedule_binding_reference","external_binding","sync_cursor","sync_conflict","tombstone","evidence_reference"]),k=n.enum(["backlog","unstarted","started","completed","cancelled"]),f=n.enum(["parent","child","blocks","blocked_by","relates_to","duplicates","duplicated_by","supersedes","multi_homed_in"]);var d=/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,t=o.string().regex(d,"UUIDv7 required"),s=o.string().datetime({offset:!0}),p=o.object({id:t,kind:c}),r=o.object({principalId:t,principalKind:o.enum(["member","guest","contractor","service_principal"])}),a=o.object({tenantId:t,organizationId:t,workspaceId:t}),b=o.object({scope:a,createdAt:s,createdBy:r,updatedAt:s,updatedBy:r,revision:o.number().int().nonnegative()});var l=e.enum(["read_only","suggest_only","within_policy","approval_required","reserved_human_only"]),m=e.enum(["work.object.create@2.0.0","work.object.update@2.0.0","work.object.archive@2.0.0","work.object.restore@2.0.0","work.object.bulk_mutate@2.0.0","work.object.move@2.0.0","work.object.assign@2.0.0","work.object.transition@2.0.0","work.relationship.set@2.0.0","work.recurrence.set@2.0.0","work.time.start@2.0.0","work.time.stop@2.0.0","work.comment.create@2.0.0","work.attachment.link@2.0.0","work.custom_field.set@2.0.0","work.inbox.capture@2.0.0","work.search.query@2.0.0","work.sync.connect@2.0.0","work.sync.import@2.0.0","work.sync.push@2.0.0","work.sync.resolve_conflict@2.0.0"]),W=e.object({operationId:t,operationKey:m,scope:a,actor:r,target:p.optional(),expectedRevision:e.number().int().nonnegative().optional(),idempotencyKey:e.string().min(1).max(255),correlationId:t,causationId:t.optional(),evidenceRef:e.string().min(1),actionClass:l,approvalRef:e.string().min(1).optional(),payload:e.record(e.string(),e.unknown())});function x(i){return i.actionClass==="approval_required"||i.actionClass==="reserved_human_only"}var S={key:"work.managed-commit-authority",version:"1.2.0",invariants:["Aggregate commits serialize by tenant and object identity and cannot change an existing aggregate scope. Projection workers cannot overwrite a newer revision with an older one.","Object reads use a projection only at the committed event head; lagging projections replay current events, including archives and restores, and expose the current aggregate revision.","Projection lookups validate object identity and the complete tenant/organization/workspace scope, on both materialized and event-replay paths.","Mutation services reject foreign or mismatched current objects and replay receipts before returning data or committing effects.","Organization, session, workspace and applicable team grants are re-proven and locked on the same transaction as event and outbox persistence.","Canonical scope and principal must match verified authority; caller-selected read_only or suggest_only labels cannot authorize mutation.","Authorized idempotent retries resolve the persisted receipt before object-existence or current-revision validation.","Approval-required and reserved mutations remain denied until an actual approval verifier is composed."]},j={key:"work.canonical-scope-binding",version:"1.0.0",invariants:["New actor bindings reuse canonical tenant, organization and workspace IDs for the same verified legacy scope.","A principal retains its canonical identity across workspaces within a tenant.","Existing bindings and immutable Work events are never silently rewritten. Ambiguous legacy parents block new allocation until reviewed reconciliation.","Allocation is serialized per legacy tenant and enforced by the database during mixed-version rollout."]};export{j as WORK_CANONICAL_SCOPE_BINDING_CONTRACT,S as WORK_MANAGED_COMMIT_AUTHORITY_CONTRACT,l as WorkActionClassSchema,W as WorkMutationEnvelopeSchema,m as WorkOperationKeySchema,x as mutationRequiresApproval};
|