@astrale-domains/issues 0.1.2 → 0.1.3

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +71 -15
  3. package/dist/schema/.runtime/states/issue/index.d.ts +30 -0
  4. package/dist/schema/.runtime/states/issue/index.js +11 -0
  5. package/dist/schema/comment/class.d.ts +35 -3
  6. package/dist/schema/comment/class.js +11 -2
  7. package/dist/schema/comment/contribute-to-comment-policy.d.ts +1 -0
  8. package/dist/schema/comment/contribute-to-comment-policy.js +12 -0
  9. package/dist/schema/comment/edit-own-comment-policy.d.ts +1 -0
  10. package/dist/schema/comment/edit-own-comment-policy.js +6 -0
  11. package/dist/schema/comment/index.d.ts +3 -0
  12. package/dist/schema/comment/index.js +3 -0
  13. package/dist/schema/comment/methods.js +18 -0
  14. package/dist/schema/comment/relationships.d.ts +4 -4
  15. package/dist/schema/comment/relationships.js +10 -5
  16. package/dist/schema/comment/traverse-comment-relationship-policy.d.ts +2 -0
  17. package/dist/schema/comment/traverse-comment-relationship-policy.js +17 -0
  18. package/dist/schema/index.d.ts +5 -6
  19. package/dist/schema/index.js +4 -5
  20. package/dist/schema/issue/class.d.ts +163 -4
  21. package/dist/schema/issue/class.js +21 -9
  22. package/dist/schema/issue/contribute-to-issue-policy.d.ts +1 -0
  23. package/dist/schema/issue/contribute-to-issue-policy.js +10 -0
  24. package/dist/schema/issue/index.d.ts +3 -1
  25. package/dist/schema/issue/index.js +3 -1
  26. package/dist/schema/issue/methods.js +66 -0
  27. package/dist/schema/issue/relationships.d.ts +15 -60
  28. package/dist/schema/issue/relationships.js +21 -15
  29. package/dist/schema/issue/traverse-issue-relationship-policy.d.ts +5 -0
  30. package/dist/schema/issue/traverse-issue-relationship-policy.js +55 -0
  31. package/dist/schema/project/class.d.ts +234 -0
  32. package/dist/schema/project/class.js +27 -0
  33. package/dist/schema/project/contribute-to-project-policy.d.ts +1 -0
  34. package/dist/schema/project/contribute-to-project-policy.js +6 -0
  35. package/dist/schema/project/index.d.ts +5 -0
  36. package/dist/schema/project/index.js +5 -0
  37. package/dist/schema/project/manage-project-policy.d.ts +1 -0
  38. package/dist/schema/project/manage-project-policy.js +6 -0
  39. package/dist/schema/project/methods.js +68 -0
  40. package/dist/schema/{command → project}/relationships.d.ts +9 -9
  41. package/dist/schema/project/relationships.js +15 -0
  42. package/dist/schema/project/traverse-project-relationship-policy.d.ts +4 -0
  43. package/dist/schema/project/traverse-project-relationship-policy.js +20 -0
  44. package/dist/schema/{application/index.d.ts → schema.d.ts} +454 -335
  45. package/dist/schema/schema.js +44 -0
  46. package/dist/schema/tag/class.d.ts +39 -2
  47. package/dist/schema/tag/class.js +6 -1
  48. package/dist/schema/tag/contribute-to-tag-policy.d.ts +1 -0
  49. package/dist/schema/tag/contribute-to-tag-policy.js +10 -0
  50. package/dist/schema/tag/index.d.ts +3 -1
  51. package/dist/schema/tag/index.js +3 -1
  52. package/dist/schema/tag/manage-tag-policy.d.ts +1 -0
  53. package/dist/schema/tag/manage-tag-policy.js +10 -0
  54. package/dist/schema/tag/methods.js +21 -0
  55. package/dist/schema/tag/relationships.d.ts +2 -2
  56. package/dist/schema/tag/relationships.js +11 -7
  57. package/dist/schema/value/index.js +34 -0
  58. package/package.json +16 -6
  59. package/dist/schema/application/functions.js +0 -156
  60. package/dist/schema/application/index.js +0 -49
  61. package/dist/schema/command/class.d.ts +0 -38
  62. package/dist/schema/command/class.js +0 -13
  63. package/dist/schema/command/index.d.ts +0 -2
  64. package/dist/schema/command/index.js +0 -2
  65. package/dist/schema/command/relationships.js +0 -14
  66. package/dist/schema/tracker/class.d.ts +0 -73
  67. package/dist/schema/tracker/class.js +0 -10
  68. package/dist/schema/tracker/index.d.ts +0 -2
  69. package/dist/schema/tracker/index.js +0 -2
  70. package/dist/schema/tracker/relationships.d.ts +0 -16
  71. package/dist/schema/tracker/relationships.js +0 -7
@@ -0,0 +1,44 @@
1
+ import { KernelSchema, defineSchema, view } from '@astrale-os/sdk/schema';
2
+ import { Comment, ContributeToComment, EditOwnComment, TraverseCommentRelationship, comment_authored_by, issue_has_comment, } from './comment/index.js';
3
+ import { ContributeToIssue, Issue, TraverseIssueAssignee, TraverseIssueComment, TraverseIssueParent, TraverseIssueReporter, TraverseIssueTag, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './issue/index.js';
4
+ import { ContributeToProject, ManageProject, Project, TraverseProjectIssue, TraverseProjectMember, TraverseProjectOwner, TraverseProjectTag, project_has_member, project_owned_by, } from './project/index.js';
5
+ import { ContributeToTag, ManageTag, Tag, issue_tagged_with, project_contains_tag, } from './tag/index.js';
6
+ export const schema = defineSchema('issues.astrale.ai', {
7
+ dependencies: { kernel: KernelSchema },
8
+ classes: {
9
+ Project,
10
+ Issue,
11
+ Comment,
12
+ Tag,
13
+ project_owned_by,
14
+ project_has_member,
15
+ project_contains_issue,
16
+ issue_reported_by,
17
+ issue_assigned_to,
18
+ issue_subtask_of,
19
+ issue_has_comment,
20
+ comment_authored_by,
21
+ project_contains_tag,
22
+ issue_tagged_with,
23
+ },
24
+ policies: {
25
+ ManageProject,
26
+ ContributeToProject,
27
+ ContributeToIssue,
28
+ ContributeToTag,
29
+ ManageTag,
30
+ ContributeToComment,
31
+ EditOwnComment,
32
+ TraverseProjectOwner,
33
+ TraverseProjectMember,
34
+ TraverseProjectIssue,
35
+ TraverseProjectTag,
36
+ TraverseIssueReporter,
37
+ TraverseIssueAssignee,
38
+ TraverseIssueParent,
39
+ TraverseIssueComment,
40
+ TraverseIssueTag,
41
+ TraverseCommentRelationship,
42
+ },
43
+ views: { application: view({}) },
44
+ });
@@ -38,7 +38,27 @@ export declare const Tag: import("@astrale-os/sdk/schema").NodeClass<{
38
38
  readonly slug: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "slug", "self">;
39
39
  readonly color: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "color", "self">;
40
40
  };
41
- readonly methods: Readonly<Record<never, never>>;
41
+ readonly methods: {
42
+ readonly edit: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
43
+ name?: string | undefined;
44
+ color?: string | null | undefined;
45
+ }, {
46
+ readonly mode: 'value';
47
+ readonly value: {
48
+ id: string;
49
+ name: string;
50
+ slug: string;
51
+ color?: string | undefined;
52
+ };
53
+ }, "authorized", false, "default">>;
54
+ readonly delete: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
55
+ readonly mode: 'value';
56
+ readonly value: {
57
+ tagId: string;
58
+ deleted: true;
59
+ };
60
+ }, "authorized", false, "default">>;
61
+ };
42
62
  readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "color", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "slug", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
43
63
  readonly name: "createdAt";
44
64
  readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
@@ -49,6 +69,23 @@ export declare const Tag: import("@astrale-os/sdk/schema").NodeClass<{
49
69
  readonly name: "updatedAt";
50
70
  readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
51
71
  });
52
- readonly effectiveInstanceMethods: never;
72
+ readonly effectiveInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
73
+ readonly mode: 'value';
74
+ readonly value: {
75
+ tagId: string;
76
+ deleted: true;
77
+ };
78
+ }, "authorized", false, "default">>, "delete", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
79
+ name?: string | undefined;
80
+ color?: string | null | undefined;
81
+ }, {
82
+ readonly mode: 'value';
83
+ readonly value: {
84
+ id: string;
85
+ name: string;
86
+ slug: string;
87
+ color?: string | undefined;
88
+ };
89
+ }, "authorized", false, "default">>, "edit", "self">;
53
90
  readonly effectiveStaticMethods: never;
54
91
  }>;
@@ -1,10 +1,15 @@
1
1
  import { K, nodeClass, property } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
+ import { ContributeToTag } from './contribute-to-tag-policy.js';
4
+ import { deleteTagMethod, editTagMethod } from './methods.js';
3
5
  export const Tag = nodeClass({
4
- description: 'One Tracker-local label with a canonical slug.',
6
+ description: 'One Project-local label with a canonical slug.',
7
+ icon: 'tag',
5
8
  extends: [K.classes.Named, K.classes.Timestamped],
6
9
  properties: {
7
10
  slug: z.string().min(1).max(80),
8
11
  color: property(z.string().min(7).max(7), { required: false }),
9
12
  },
13
+ methods: { edit: editTagMethod, delete: deleteTagMethod },
14
+ policies: { read: () => ContributeToTag },
10
15
  });
@@ -0,0 +1 @@
1
+ export declare const ContributeToTag: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,10 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { Project, project_has_member, project_owned_by } from '../project/index.js';
3
+ import { project_contains_tag } from './relationships.js';
4
+ export const ContributeToTag = policy({
5
+ description: 'The caller owns or belongs to the Project containing this Tag.',
6
+ match: ({ allOf, anyOf, edge, exists, object, subject }) => exists(({ node }) => {
7
+ const project = node(() => Project);
8
+ return allOf(anyOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: subject, class: () => project_has_member, target: project })), edge({ source: project, class: () => project_contains_tag, target: object }));
9
+ }),
10
+ });
@@ -1,2 +1,4 @@
1
1
  export { Tag } from './class.js';
2
- export { issue_tagged_with, tracker_contains_tag } from './relationships.js';
2
+ export { ContributeToTag } from './contribute-to-tag-policy.js';
3
+ export { ManageTag } from './manage-tag-policy.js';
4
+ export { issue_tagged_with, project_contains_tag } from './relationships.js';
@@ -1,2 +1,4 @@
1
1
  export { Tag } from './class.js';
2
- export { issue_tagged_with, tracker_contains_tag } from './relationships.js';
2
+ export { ContributeToTag } from './contribute-to-tag-policy.js';
3
+ export { ManageTag } from './manage-tag-policy.js';
4
+ export { issue_tagged_with, project_contains_tag } from './relationships.js';
@@ -0,0 +1 @@
1
+ export declare const ManageTag: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,10 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { Project, project_owned_by } from '../project/index.js';
3
+ import { project_contains_tag } from './relationships.js';
4
+ export const ManageTag = policy({
5
+ description: 'The caller owns the Project containing this Tag.',
6
+ match: ({ allOf, edge, exists, object, subject }) => exists(({ node }) => {
7
+ const project = node(() => Project);
8
+ return allOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: project, class: () => project_contains_tag, target: object }));
9
+ }),
10
+ });
@@ -0,0 +1,21 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { nodeIdValue, tagValue } from '../value/index.js';
4
+ import { ManageTag } from './manage-tag-policy.js';
5
+ export const editTagMethod = method({
6
+ description: 'Edit this Project-local Tag.',
7
+ auth: 'authorized',
8
+ policy: ({ check, self }) => check(ManageTag, self),
9
+ input: z.strictObject({
10
+ name: z.string().min(1).max(64).optional(),
11
+ color: z.string().nullable().optional(),
12
+ }),
13
+ output: tagValue,
14
+ });
15
+ export const deleteTagMethod = method({
16
+ description: 'Detach and delete this Project-local Tag when it labels at most 2,046 Issues; unlink larger sets first.',
17
+ auth: 'authorized',
18
+ policy: ({ check, self }) => check(ManageTag, self),
19
+ input: z.strictObject({}),
20
+ output: z.strictObject({ tagId: nodeIdValue, deleted: z.literal(true) }),
21
+ });
@@ -1,10 +1,10 @@
1
- export declare const tracker_contains_tag: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
1
+ export declare const project_contains_tag: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
2
2
  readonly depth: 0;
3
3
  readonly abstract: false;
4
4
  readonly extends: readonly [];
5
5
  readonly properties: never;
6
6
  readonly source: {
7
- readonly as: "tracker";
7
+ readonly as: "project";
8
8
  readonly outgoing: "0..*";
9
9
  };
10
10
  readonly target: {
@@ -1,12 +1,16 @@
1
1
  import { edgeClass } from '@astrale-os/sdk/schema';
2
- import { Issue } from '#schema/issue';
3
- import { Tracker } from '#schema/tracker';
2
+ import { Issue, TraverseIssueTag } from '../issue/index.js';
3
+ import { Project, TraverseProjectTag } from '../project/index.js';
4
4
  import { Tag } from './class.js';
5
- export const tracker_contains_tag = edgeClass.directed({
6
- source: { as: 'tracker', accepts: [Tracker], outgoing: '0..*' },
7
- target: { as: 'tag', accepts: [Tag], incoming: '1' },
5
+ export const project_contains_tag = edgeClass.directed({
6
+ description: 'One Project owns one local Tag vocabulary entry.',
7
+ source: { as: 'project', accepts: [() => Project], outgoing: '0..*' },
8
+ target: { as: 'tag', accepts: [() => Tag], incoming: '1' },
9
+ policies: { traverse: () => TraverseProjectTag },
8
10
  });
9
11
  export const issue_tagged_with = edgeClass.directed({
10
- source: { as: 'issue', accepts: [Issue], outgoing: '0..*' },
11
- target: { as: 'tag', accepts: [Tag], incoming: '0..*' },
12
+ description: 'One Issue is classified by one Tag from the same Project.',
13
+ source: { as: 'issue', accepts: [() => Issue], outgoing: '0..*' },
14
+ target: { as: 'tag', accepts: [() => Tag], incoming: '0..*' },
15
+ policies: { traverse: () => TraverseIssueTag },
12
16
  });
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ import { issueLifecycle } from '../.runtime/states/issue/index.js';
3
+ export const nodeIdValue = z.string().min(1);
4
+ export const projectValue = z.strictObject({
5
+ id: nodeIdValue,
6
+ key: z.string().min(2).max(10),
7
+ name: z.string().min(1).max(120),
8
+ description: z.string().max(5_000),
9
+ archived: z.boolean(),
10
+ });
11
+ export const membershipChangeValue = z.strictObject({
12
+ projectId: nodeIdValue,
13
+ memberId: nodeIdValue,
14
+ changed: z.boolean(),
15
+ });
16
+ export const issueValue = z.strictObject({
17
+ id: nodeIdValue,
18
+ reference: z.string().min(1).max(32),
19
+ title: z.string().min(1).max(200),
20
+ description: z.string().max(50_000),
21
+ status: issueLifecycle.stateSchema,
22
+ priority: z.number().int().min(0).max(4),
23
+ archived: z.boolean(),
24
+ });
25
+ export const commentValue = z.strictObject({
26
+ id: nodeIdValue,
27
+ body: z.string().min(1).max(50_000),
28
+ });
29
+ export const tagValue = z.strictObject({
30
+ id: nodeIdValue,
31
+ name: z.string().min(1).max(64),
32
+ slug: z.string().min(1).max(80),
33
+ color: z.string().min(7).max(7).optional(),
34
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-domains/issues",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/astrale-os/domains.git",
@@ -28,26 +28,33 @@
28
28
  "registry": "https://registry.npmjs.org/"
29
29
  },
30
30
  "dependencies": {
31
- "@astrale-os/sdk": "0.5.0-beta.51",
31
+ "@astrale-os/sdk": "0.5.0-beta.64",
32
32
  "zod": "^4.4.3"
33
33
  },
34
34
  "devDependencies": {
35
- "@astrale-os/adapter-astrale": "0.5.0-beta.47",
36
- "@astrale-os/adapter-cloudflare": "0.5.0-beta.54",
35
+ "@astrale-os/adapter-cloudflare": "0.5.0-beta.67",
37
36
  "@astrale-os/ox": ">=0.1.3 <1.0.0",
38
- "@astrale-os/shell": "0.4.2-beta.6",
37
+ "@astrale-os/shell": "0.4.2-beta.7",
39
38
  "@astrale-os/shell-react": "0.3.2-beta.3",
39
+ "@astrale-os/ui": "0.3.0-beta.9",
40
40
  "@tailwindcss/vite": "^4.0.6",
41
41
  "@tanstack/react-router": "1.170.17",
42
42
  "@tanstack/router-plugin": "1.168.19",
43
+ "@testing-library/react": "16.3.2",
44
+ "@testing-library/user-event": "14.6.1",
43
45
  "@types/node": "^22.0.0",
44
46
  "@types/react": "^19.2.0",
45
47
  "@types/react-dom": "^19.2.0",
46
48
  "@vitejs/plugin-react": "^6.0.5",
49
+ "jsdom": "30.0.1",
50
+ "mermaid": "^11.17.0",
47
51
  "oxlint": ">=1.78.0 <2.0.0",
48
52
  "react": "^19.2.0",
49
53
  "react-dom": "^19.2.0",
54
+ "react-markdown": "^10.1.0",
55
+ "remark-gfm": "^4.0.1",
50
56
  "tailwindcss": "^4.0.6",
57
+ "type-fest": "^4.41.0",
51
58
  "typescript": "7.0.2",
52
59
  "vite": "^8.2.1",
53
60
  "vitest": "^4.1.10"
@@ -69,7 +76,10 @@
69
76
  "lint:fix": "astrale-domain lint --fix",
70
77
  "package": "astrale-domain package",
71
78
  "typecheck": "tsc --noEmit",
72
- "test": "vitest run --config vitest.config.ts",
79
+ "test": "vitest run --config vitest.config.ts && node --test scripts/**/*.test.mjs",
80
+ "legacy:snapshot": "node scripts/legacy-issues-import/import-tracker-domain.mjs snapshot",
81
+ "legacy:deprovision": "node scripts/legacy-issues-import/import-tracker-domain.mjs deprovision",
82
+ "legacy:import": "node scripts/legacy-issues-import/import-tracker-domain.mjs import",
73
83
  "frontend:dev": "vite",
74
84
  "frontend:build": "vite build"
75
85
  }
@@ -1,156 +0,0 @@
1
- import { func } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- const id = z.string().min(1);
4
- const idempotencyKey = z.string().min(1).max(200);
5
- const status = z.enum(['open', 'in_progress', 'resolved', 'canceled']);
6
- const priority = z.number().int().min(0).max(4);
7
- const tracker = z.strictObject({
8
- id,
9
- key: z.string().min(2).max(10),
10
- name: z.string().min(1),
11
- description: z.string(),
12
- });
13
- const issue = z.strictObject({
14
- id,
15
- reference: z.string().min(1),
16
- title: z.string().min(1),
17
- description: z.string(),
18
- status,
19
- priority,
20
- });
21
- const comment = z.strictObject({ id, body: z.string().min(1) });
22
- const tag = z.strictObject({
23
- id,
24
- name: z.string().min(1),
25
- slug: z.string().min(1),
26
- color: z.string().optional(),
27
- });
28
- export const listTrackers = func({
29
- description: 'List Trackers owned by the authenticated caller.',
30
- auth: 'authenticated',
31
- input: z.strictObject({}),
32
- output: z.array(tracker),
33
- });
34
- export const createTracker = func({
35
- description: 'Create one caller-owned Tracker.',
36
- auth: 'authenticated',
37
- input: z.strictObject({
38
- key: z.string().min(1),
39
- name: z.string().min(1).max(120),
40
- description: z.string().max(5_000).optional(),
41
- idempotencyKey,
42
- }),
43
- output: tracker,
44
- });
45
- export const listIssues = func({
46
- description: 'List Issues in one caller-owned Tracker.',
47
- auth: 'authenticated',
48
- input: z.strictObject({ trackerId: id }),
49
- output: z.array(issue),
50
- });
51
- export const createIssue = func({
52
- description: 'Create one numbered Issue in a caller-owned Tracker.',
53
- auth: 'authenticated',
54
- input: z.strictObject({
55
- trackerId: id,
56
- title: z.string().min(1).max(200),
57
- description: z.string().max(50_000).optional(),
58
- priority: priority.optional(),
59
- idempotencyKey,
60
- }),
61
- output: issue,
62
- });
63
- export const updateIssue = func({
64
- description: 'Update one caller-owned Issue.',
65
- auth: 'authenticated',
66
- input: z.strictObject({
67
- issueId: id,
68
- title: z.string().min(1).max(200).optional(),
69
- description: z.string().max(50_000).optional(),
70
- status: status.optional(),
71
- priority: priority.optional(),
72
- idempotencyKey,
73
- }),
74
- output: issue,
75
- });
76
- export const deleteIssue = func({
77
- description: 'Delete one caller-owned Issue.',
78
- auth: 'authenticated',
79
- input: z.strictObject({ issueId: id, idempotencyKey }),
80
- output: z.strictObject({ deleted: z.literal(true) }),
81
- });
82
- export const addComment = func({
83
- description: 'Add one Comment to a caller-owned Issue.',
84
- auth: 'authenticated',
85
- input: z.strictObject({ issueId: id, body: z.string().min(1).max(50_000), idempotencyKey }),
86
- output: comment,
87
- });
88
- export const editComment = func({
89
- description: 'Edit one Comment in a caller-owned Tracker.',
90
- auth: 'authenticated',
91
- input: z.strictObject({ commentId: id, body: z.string().min(1).max(50_000), idempotencyKey }),
92
- output: comment,
93
- });
94
- export const deleteComment = func({
95
- description: 'Delete one Comment in a caller-owned Tracker.',
96
- auth: 'authenticated',
97
- input: z.strictObject({ commentId: id, idempotencyKey }),
98
- output: z.strictObject({ deleted: z.literal(true) }),
99
- });
100
- export const createTag = func({
101
- description: 'Create one Tag in a caller-owned Tracker.',
102
- auth: 'authenticated',
103
- input: z.strictObject({
104
- trackerId: id,
105
- name: z.string().min(1).max(64),
106
- color: z.string().optional(),
107
- idempotencyKey,
108
- }),
109
- output: tag,
110
- });
111
- export const editTag = func({
112
- description: 'Edit one Tag in a caller-owned Tracker.',
113
- auth: 'authenticated',
114
- input: z.strictObject({
115
- tagId: id,
116
- name: z.string().min(1).max(64).optional(),
117
- color: z.string().optional(),
118
- idempotencyKey,
119
- }),
120
- output: tag,
121
- });
122
- export const deleteTag = func({
123
- description: 'Delete one Tag in a caller-owned Tracker.',
124
- auth: 'authenticated',
125
- input: z.strictObject({ tagId: id, idempotencyKey }),
126
- output: z.strictObject({ deleted: z.literal(true) }),
127
- });
128
- export const changeIssueTag = func({
129
- description: 'Add or remove a Tracker-local Tag on an Issue.',
130
- auth: 'authenticated',
131
- input: z.strictObject({
132
- issueId: id,
133
- tagId: id,
134
- change: z.enum(['add', 'remove']),
135
- idempotencyKey,
136
- }),
137
- output: z.strictObject({ issueId: id, changed: z.boolean() }),
138
- });
139
- export const relateIssue = func({
140
- description: 'Add or remove one relation between caller-owned Issues.',
141
- auth: 'authenticated',
142
- input: z.strictObject({
143
- issueId: id,
144
- targetId: id,
145
- relation: z.enum(['blocks', 'duplicates', 'relates_to', 'subtask_of']),
146
- change: z.enum(['add', 'remove']),
147
- idempotencyKey,
148
- }),
149
- output: z.strictObject({ issueId: id, changed: z.boolean() }),
150
- });
151
- export const exportTracker = func({
152
- description: 'Export the current visible Issue snapshot for one Tracker.',
153
- auth: 'authenticated',
154
- input: z.strictObject({ trackerId: id }),
155
- output: z.strictObject({ issues: z.array(issue) }),
156
- });
@@ -1,49 +0,0 @@
1
- import { KernelSchema, defineSchema, view } from '@astrale-os/sdk/schema';
2
- import { Command, command_requested_by, command_targets_primary } from '#schema/command';
3
- import { Comment, comment_authored_by, issue_has_comment } from '#schema/comment';
4
- import { Issue, issue_assigned_to, issue_blocks, issue_duplicates, issue_relates_to, issue_reported_by, issue_subtask_of, tracker_contains_issue, } from '#schema/issue';
5
- import { Tag, issue_tagged_with, tracker_contains_tag } from '#schema/tag';
6
- import { Tracker, tracker_owned_by } from '#schema/tracker';
7
- import { addComment, changeIssueTag, createIssue, createTag, createTracker, deleteComment, deleteIssue, deleteTag, editComment, editTag, exportTracker, listIssues, listTrackers, relateIssue, updateIssue, } from './functions.js';
8
- export const schema = defineSchema('issues.astrale.ai', {
9
- dependencies: { kernel: KernelSchema },
10
- classes: {
11
- Tracker,
12
- Issue,
13
- Comment,
14
- Tag,
15
- Command,
16
- tracker_owned_by,
17
- tracker_contains_issue,
18
- issue_reported_by,
19
- issue_assigned_to,
20
- issue_blocks,
21
- issue_duplicates,
22
- issue_relates_to,
23
- issue_subtask_of,
24
- issue_has_comment,
25
- comment_authored_by,
26
- tracker_contains_tag,
27
- issue_tagged_with,
28
- command_requested_by,
29
- command_targets_primary,
30
- },
31
- functions: {
32
- listTrackers,
33
- createTracker,
34
- listIssues,
35
- createIssue,
36
- updateIssue,
37
- deleteIssue,
38
- addComment,
39
- editComment,
40
- deleteComment,
41
- createTag,
42
- editTag,
43
- deleteTag,
44
- changeIssueTag,
45
- relateIssue,
46
- exportTracker,
47
- },
48
- views: { application: view({}) },
49
- });
@@ -1,38 +0,0 @@
1
- export declare const Command: import("@astrale-os/sdk/schema").NodeClass<{
2
- readonly depth: 1;
3
- readonly abstract: false;
4
- readonly extends: readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
5
- readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Timestamped"> & {
6
- readonly origin: "kernel.astrale.ai";
7
- };
8
- readonly kind: 'node';
9
- readonly abstract: true;
10
- }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Timestamped"> & {
11
- readonly origin: "kernel.astrale.ai";
12
- }, "kernel.astrale.ai:class.Timestamped", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
13
- readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
14
- readonly origin: "kernel.astrale.ai";
15
- };
16
- readonly kind: 'node';
17
- readonly abstract: true;
18
- }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
19
- readonly origin: "kernel.astrale.ai";
20
- }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt">, never, never>];
21
- readonly properties: {
22
- readonly kind: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "kind", "self">;
23
- readonly idempotencyKey: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "idempotencyKey", "self">;
24
- readonly fingerprint: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "fingerprint", "self">;
25
- readonly changed: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<boolean, boolean, true, "changed", "self">;
26
- readonly reference: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "reference", "self">;
27
- };
28
- readonly methods: Readonly<Record<never, never>>;
29
- readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<boolean, boolean, true, "changed", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "fingerprint", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "idempotencyKey", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "kind", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "reference", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
30
- readonly name: "createdAt";
31
- readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
32
- }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
33
- readonly name: "updatedAt";
34
- readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
35
- });
36
- readonly effectiveInstanceMethods: never;
37
- readonly effectiveStaticMethods: never;
38
- }>;
@@ -1,13 +0,0 @@
1
- import { K, nodeClass, property } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- export const Command = nodeClass({
4
- description: 'Private exact-once receipt for one caller command.',
5
- extends: [K.classes.Timestamped],
6
- properties: {
7
- kind: z.string().min(1).max(80),
8
- idempotencyKey: z.string().min(1).max(200),
9
- fingerprint: z.string().min(1).max(500),
10
- changed: z.boolean(),
11
- reference: property(z.string().min(1).max(80), { required: false }),
12
- },
13
- });
@@ -1,2 +0,0 @@
1
- export { Command } from './class.js';
2
- export { command_requested_by, command_targets_primary } from './relationships.js';
@@ -1,2 +0,0 @@
1
- export { Command } from './class.js';
2
- export { command_requested_by, command_targets_primary } from './relationships.js';
@@ -1,14 +0,0 @@
1
- import { K, edgeClass } from '@astrale-os/sdk/schema';
2
- import { Comment } from '#schema/comment';
3
- import { Issue } from '#schema/issue';
4
- import { Tag } from '#schema/tag';
5
- import { Tracker } from '#schema/tracker';
6
- import { Command } from './class.js';
7
- export const command_requested_by = edgeClass.directed({
8
- source: { as: 'command', accepts: [Command], outgoing: '1' },
9
- target: { as: 'requester', accepts: [K.classes.Identity], incoming: '0..*' },
10
- });
11
- export const command_targets_primary = edgeClass.directed({
12
- source: { as: 'command', accepts: [Command], outgoing: '0..1' },
13
- target: { as: 'primary', accepts: [Tracker, Issue, Comment, Tag], incoming: '0..*' },
14
- });