@nestos/kanban 0.0.0-stage → 0.5.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.
Files changed (99) hide show
  1. package/README.md +121 -2
  2. package/dist/activity-C6xDM-cg.d.cts +232 -0
  3. package/dist/activity-Dw8DOw0L.d.ts +232 -0
  4. package/dist/activity.cjs +288 -0
  5. package/dist/activity.cjs.map +1 -0
  6. package/dist/activity.d.cts +34 -0
  7. package/dist/activity.d.ts +34 -0
  8. package/dist/activity.js +288 -0
  9. package/dist/activity.js.map +1 -0
  10. package/dist/chunk-2YFPV5GF.cjs +16 -0
  11. package/dist/chunk-2YFPV5GF.cjs.map +1 -0
  12. package/dist/chunk-4KF7KUAI.cjs +221 -0
  13. package/dist/chunk-4KF7KUAI.cjs.map +1 -0
  14. package/dist/chunk-4XF6LQSU.cjs +9 -0
  15. package/dist/chunk-4XF6LQSU.cjs.map +1 -0
  16. package/dist/chunk-5DLZWW5Y.js +148 -0
  17. package/dist/chunk-5DLZWW5Y.js.map +1 -0
  18. package/dist/chunk-5XKOCKY2.js +58 -0
  19. package/dist/chunk-5XKOCKY2.js.map +1 -0
  20. package/dist/chunk-6MN3H3YF.cjs +183 -0
  21. package/dist/chunk-6MN3H3YF.cjs.map +1 -0
  22. package/dist/chunk-ATUFFNLV.js +221 -0
  23. package/dist/chunk-ATUFFNLV.js.map +1 -0
  24. package/dist/chunk-DFTOTBGF.js +439 -0
  25. package/dist/chunk-DFTOTBGF.js.map +1 -0
  26. package/dist/chunk-G6FCDLDF.js +16 -0
  27. package/dist/chunk-G6FCDLDF.js.map +1 -0
  28. package/dist/chunk-IUI5CI2S.cjs +439 -0
  29. package/dist/chunk-IUI5CI2S.cjs.map +1 -0
  30. package/dist/chunk-KYNYPKKH.cjs +71 -0
  31. package/dist/chunk-KYNYPKKH.cjs.map +1 -0
  32. package/dist/chunk-L44TM4EE.cjs +1498 -0
  33. package/dist/chunk-L44TM4EE.cjs.map +1 -0
  34. package/dist/chunk-LSE6JG5I.cjs +20 -0
  35. package/dist/chunk-LSE6JG5I.cjs.map +1 -0
  36. package/dist/chunk-O4OGAAV4.js +71 -0
  37. package/dist/chunk-O4OGAAV4.js.map +1 -0
  38. package/dist/chunk-OHQTKGQN.js +1498 -0
  39. package/dist/chunk-OHQTKGQN.js.map +1 -0
  40. package/dist/chunk-PSKQAFDF.cjs +58 -0
  41. package/dist/chunk-PSKQAFDF.cjs.map +1 -0
  42. package/dist/chunk-QTMTBEBA.js +20 -0
  43. package/dist/chunk-QTMTBEBA.js.map +1 -0
  44. package/dist/chunk-RQP77ZTY.js +9 -0
  45. package/dist/chunk-RQP77ZTY.js.map +1 -0
  46. package/dist/chunk-T7P5EIC4.cjs +148 -0
  47. package/dist/chunk-T7P5EIC4.cjs.map +1 -0
  48. package/dist/chunk-TB2RZGDV.js +183 -0
  49. package/dist/chunk-TB2RZGDV.js.map +1 -0
  50. package/dist/content-CAIp1njn.d.cts +35 -0
  51. package/dist/content-CGMJdyH_.d.ts +35 -0
  52. package/dist/contracts/index.cjs +21 -0
  53. package/dist/contracts/index.cjs.map +1 -0
  54. package/dist/contracts/index.d.cts +4 -0
  55. package/dist/contracts/index.d.ts +4 -0
  56. package/dist/contracts/index.js +21 -0
  57. package/dist/contracts/index.js.map +1 -0
  58. package/dist/discovery-DxpirOz3.d.cts +61 -0
  59. package/dist/discovery-gSqWpuRm.d.ts +61 -0
  60. package/dist/discovery.cjs +379 -0
  61. package/dist/discovery.cjs.map +1 -0
  62. package/dist/discovery.d.cts +22 -0
  63. package/dist/discovery.d.ts +22 -0
  64. package/dist/discovery.js +379 -0
  65. package/dist/discovery.js.map +1 -0
  66. package/dist/execution.cjs +368 -0
  67. package/dist/execution.cjs.map +1 -0
  68. package/dist/execution.d.cts +89 -0
  69. package/dist/execution.d.ts +89 -0
  70. package/dist/execution.js +368 -0
  71. package/dist/execution.js.map +1 -0
  72. package/dist/index.cjs +76 -0
  73. package/dist/index.cjs.map +1 -0
  74. package/dist/index.d.cts +61 -0
  75. package/dist/index.d.ts +61 -0
  76. package/dist/index.js +76 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/module-BbvwdCDF.d.cts +11 -0
  79. package/dist/module-CWNK2BMj.d.ts +11 -0
  80. package/dist/planning-CcFZYdIL.d.cts +844 -0
  81. package/dist/planning-CcFZYdIL.d.ts +844 -0
  82. package/dist/ports-Bn6ro2FB.d.ts +142 -0
  83. package/dist/ports-CaL6geqR.d.cts +142 -0
  84. package/dist/storage.cjs +289 -0
  85. package/dist/storage.cjs.map +1 -0
  86. package/dist/storage.d.cts +71 -0
  87. package/dist/storage.d.ts +71 -0
  88. package/dist/storage.js +289 -0
  89. package/dist/storage.js.map +1 -0
  90. package/dist/store-Ct0gOAAg.d.ts +28 -0
  91. package/dist/store-q63eSMoT.d.cts +28 -0
  92. package/dist/ui/index.cjs +1961 -0
  93. package/dist/ui/index.cjs.map +1 -0
  94. package/dist/ui/index.d.cts +209 -0
  95. package/dist/ui/index.d.ts +209 -0
  96. package/dist/ui/index.js +1961 -0
  97. package/dist/ui/index.js.map +1 -0
  98. package/dist/ui/kanban.css +194 -0
  99. package/package.json +113 -4
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/li/share/prj/x1/release/local-libraries/work/1ca933a0-6fe7-4e9c-b13b-76d7f318e0fb/source/libraries/kanban/dist/chunk-4KF7KUAI.cjs","../src/discovery-state.ts","../src/configuration.ts","../src/rules.ts","../src/identity.ts"],"names":["executable"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACNO,SAAS,cAAA,CAAe,KAAA,EAAmF;AAC9G,EAAA,uBAAO,KAAA,2BAAO,WAAA;AAClB;ADQA;AACA;AERO,SAAS,MAAA,CAAO,MAAA,EAA+B,CAAC,CAAA,EAAiB;AACpE,EAAA,OAAO;AAAA,IAAC,cAAA,EAAgB,KAAA;AAAA,IAAU,OAAA,EAAS,GAAA;A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KAAA,CAAM,EAAE,CAAA;AAAG,IAAA,YAAA,CAAa,CAAC,OAAA,EAAS,OAAA,EAAS,SAAS,CAAA,CAAE,QAAA,CAAS,KAAA,CAAM,IAAI,CAAA,EAAG,mBAAmB,CAAA;AACxG,IAAA,YAAA,CAAa,OAAA,CAAQ,GAAA,CAAI,YAAA,CAAa,KAAK,CAAC,CAAA,EAAG,KAAA,CAAM,KAAA,IAAS,QAAA,EAAU,uBAAA,EAAyB,yBAAyB,CAAA;AAAA,EAC9H;AACJ;AAEO,SAAS,cAAA,CAAe,KAAA,EAAiC;AAC5D,EAAA,MAAM,MAAA,EAAQ,SAAA,CAAU,KAAK,CAAA;AAC7B,EAAA,OAAO,KAAA,CAAM,KAAA,IAAS,QAAA,EAAU,EAAC,OAAA,EAAS,KAAA,CAAM,EAAA,EAAI,SAAA,EAAW,KAAA,CAAM,SAAA,EAAW,MAAA,EAAQ,KAAA,CAAM,OAAM,EAAA,EAC9F,EAAC,IAAA,EAAM,KAAA,CAAM,IAAA,EAAM,EAAA,EAAI,KAAA,CAAM,GAAE,CAAA;AACzC;AJ0JA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,+pBAAC","file":"/home/li/share/prj/x1/release/local-libraries/work/1ca933a0-6fe7-4e9c-b13b-76d7f318e0fb/source/libraries/kanban/dist/chunk-4KF7KUAI.cjs","sourcesContent":[null,"import type {KanbanDiscoveryState} from './scan-ports';\n\nexport function discoveryState(state: {discovery?: unknown} | null | undefined): KanbanDiscoveryState | undefined {\n return state?.discovery as KanbanDiscoveryState | undefined;\n}\n","import {DEFAULT_KANBAN_WORK_TYPES, executableWorkItem} from './contracts';\nimport type {KanbanBoard, KanbanPolicy, KanbanWorkType} from './contracts';\nimport {identity, requireValue, text} from './rules';\nimport {principalKey, roster} from './identity';\n\nexport function policy(input: Partial<KanbanPolicy> = {}): KanbanPolicy {\n return {claimTimeoutMs: 86400000, leaseMs: 600000, progressTimeoutMs: 3600000, transferTimeoutMs: 1800000,\n maxComplexity: 10, maxWorkUnits: 100, maxDurationMs: 28800000, escalationSessionIds: [], ...input};\n}\nexport function workTypes(board: KanbanBoard): readonly KanbanWorkType[] {return board.workTypes ?? DEFAULT_KANBAN_WORK_TYPES;}\nexport function workType(board: KanbanBoard, id: string): KanbanWorkType {\n const found = workTypes(board).find(type => type.id === id); requireValue(found, 'UNKNOWN_WORK_TYPE'); return found;\n}\nexport function executable(board: KanbanBoard, item: {planning?: {kind: string; execution?: 'direct'|'children'}}): boolean {\n workType(board, item.planning?.kind ?? board.defaultWorkType ?? 'task');\n return executableWorkItem(board,item);\n}\nexport function validateConfiguration(board: KanbanBoard): void {\n const types = workTypes(board); requireValue(types.length > 0 && types.length <= 20, 'WORK_TYPE_LIMIT');\n requireValue(new Set(types.map(t => t.id)).size === types.length, 'DUPLICATE_WORK_TYPE');\n for (const type of types) {\n identity(type.id); text(type.label); requireValue(Number.isInteger(type.rank) && type.rank >= 0 && type.rank <= 9 && typeof type.executable === 'boolean', 'INVALID_WORK_TYPE');\n }\n workType(board, board.defaultWorkType ?? 'task');\n const members = roster(board); requireValue(members.length > 0, 'MEMBER_ROSTER_REQUIRED');\n requireValue(new Set(members.map(principalKey)).size === members.length, 'DUPLICATE_MEMBER');\n for (const member of members) {identity(member.id); requireValue(['agent', 'human', 'service'].includes(member.kind), 'INVALID_PRINCIPAL');}\n for (const member of board.members ?? []) {\n text(member.responsibility); requireValue(!member.roles || member.roles.every(r => ['worker', 'reviewer', 'coordinator'].includes(r)), 'INVALID_MEMBER_ROLE');\n }\n validateColumns(board);\n for (const [kind, value] of Object.entries(board.notifications?.rules ?? {}))\n requireValue(/^[a-z][a-z0-9.-]{0,79}$/.test(kind) && ['info', 'error', 'none'].includes(value), 'INVALID_NOTIFICATION_RULE');\n}\nfunction validateColumns(board: KanbanBoard): void {\n if (!board.columns) return;\n const states = board.columns.flatMap(c => c.states);\n requireValue(states.length === 7 && new Set(states).size === 7 && ['proposed', 'backlog', 'open', 'claimed', 'review', 'completed', 'cancelled'].every(s => states.includes(s as never)), 'INVALID_COLUMNS');\n requireValue(new Set(board.columns.map(c => c.id)).size === board.columns.length, 'DUPLICATE_COLUMN');\n for (const column of board.columns) {identity(column.id); text(column.label); requireValue(column.states.length > 0, 'EMPTY_COLUMN');}\n}\n","import type { KanbanActor, KanbanBoard, KanbanEstimate, KanbanItem, KanbanParticipant } from './contracts';\nimport {validateConfiguration} from './configuration';\nimport {sameOwner} from './identity';\nimport { KanbanError } from './ports';\n\nexport function requireValue(condition: unknown, code: string): asserts condition {\n if (!condition) throw new KanbanError(code);\n}\nexport function text(value: string): void { requireValue(typeof value === 'string' && value.trim().length > 0 && value.length <= 8000, 'INVALID_TEXT'); }\nexport function identity(value: string): void { requireValue(typeof value === 'string' && value.length > 0 && value.length <= 256 && !['__proto__', 'prototype', 'constructor'].includes(value), 'INVALID_ID'); }\nexport function positive(value: number): void { requireValue(Number.isFinite(value) && value > 0, 'INVALID_THRESHOLD'); }\nexport function validateEstimate(estimate: KanbanEstimate): void {\n positive(estimate.complexity); positive(estimate.workUnits); positive(estimate.durationMs);\n requireValue(['low', 'medium', 'high'].includes(estimate.confidence), 'INVALID_CONFIDENCE');\n}\nexport function validateBoard(board: KanbanBoard): void {\n identity(board.id); text(board.title);\n requireValue(['system', 'project', 'collection'].includes(board.scope.kind), 'INVALID_SCOPE');\n if (board.scope.kind === 'project') identity(board.scope.projectId);\n if (board.scope.kind === 'collection') {identity(board.scope.namespace); identity(board.scope.id);}\n validateConfiguration(board);\n for (const agent of board.agents ?? []) { identity(agent.agentId); text(agent.responsibility); }\n requireValue(new Set((board.agents ?? []).map(a => a.agentId)).size === (board.agents ?? []).length, 'DUPLICATE_AGENT');\n const p = board.policy;\n for (const value of [p.maxReady, p.maxInProgress, p.maxInProgressPerAgent, p.maxInProgressPerAssignee]) if (value !== undefined) requireValue(Number.isSafeInteger(value) && value > 0, 'INVALID_LIMIT');\n requireValue(p.maxInProgressPerAgent === undefined || p.maxInProgressPerAssignee === undefined || p.maxInProgressPerAgent === p.maxInProgressPerAssignee, 'POLICY_LIMIT_CONFLICT');\n for (const value of [p.archiveAfterMs, p.backlogReviewMs]) if (value !== undefined) positive(value);\n for (const value of [p.claimTimeoutMs, p.leaseMs, p.progressTimeoutMs, p.transferTimeoutMs,\n p.maxComplexity, p.maxWorkUnits, p.maxDurationMs]) positive(value);\n requireValue(Array.isArray(p.escalationSessionIds), 'INVALID_ESCALATION_TARGETS');\n requireValue(p.review === undefined || ['independent', 'assignee'].includes(p.review), 'INVALID_REVIEW_POLICY');\n requireValue(p.requireEstimate === undefined || typeof p.requireEstimate === 'boolean', 'INVALID_ESTIMATE_POLICY');\n p.escalationSessionIds.forEach(identity);\n}\nexport function participant(list: KanbanParticipant[], sessionId: string, agentId: string | undefined,\n role: KanbanParticipant['roles'][number], subscribed: boolean, now: number): void {\n identity(sessionId);\n requireValue(['creator', 'owner', 'consultant', 'reviewer', 'observer', 'escalation'].includes(role), 'INVALID_ROLE');\n let entry = list.find(value => value.sessionId === sessionId);\n if (!entry) { entry = { sessionId, agentId, roles: [], subscribed, joinedAt: now }; list.push(entry); }\n if (entry.agentId && agentId) requireValue(entry.agentId === agentId, 'SESSION_AGENT_CONFLICT');\n entry.agentId ??= agentId;\n if (!entry.roles.includes(role)) entry.roles.push(role);\n entry.subscribed = subscribed;\n}\nexport function owned(item: KanbanItem, actor: KanbanActor, token: string, now: number): void {\n requireValue(item.status === 'claimed', 'ITEM_NOT_RUNNING');\n requireValue(item.owner && sameOwner(item.owner, actor) && item.owner.token === token, 'OWNER_MISMATCH');\n requireValue(item.owner.leaseUntil > now, 'LEASE_EXPIRED');\n}\n","import type {KanbanActor, KanbanAssignment, KanbanBoard, KanbanItem, KanbanPrincipal} from './contracts';\nimport {identity, requireValue} from './rules';\n\nexport function principal(actor: KanbanActor): KanbanPrincipal {\n const kind = actor.kind ?? 'agent', id = kind === 'agent' ? actor.agentId ?? actor.id : actor.id;\n requireValue(['agent', 'human', 'service'].includes(kind) && id, 'INVALID_ACTOR'); identity(id);\n if (kind === 'agent') {requireValue(!actor.agentId || !actor.id || actor.agentId === actor.id, 'ACTOR_ID_MISMATCH'); if (actor.sessionId !== undefined) identity(actor.sessionId); if (actor.taskId !== undefined) identity(actor.taskId);}\n return {kind, id};\n}\nexport function principalKey(value: KanbanPrincipal): string {return JSON.stringify([value.kind, value.id]);}\nexport function assigneeKey(value: KanbanAssignment): string {\n return value.principalId ?? principalKey({kind: 'agent', id: value.agentId!});\n}\nexport function sameOwner(owner: KanbanAssignment, actor: KanbanActor): boolean {\n const value = principal(actor);\n return assigneeKey(owner) === principalKey(value) && (value.kind !== 'agent' || owner.sessionId === actor.sessionId && owner.taskId === actor.taskId);\n}\nexport function roster(board: KanbanBoard): KanbanPrincipal[] {\n return [...(board.agents ?? []).map(a => ({kind: 'agent' as const, id: a.agentId})), ...(board.members ?? [])];\n}\nexport function candidates(board: KanbanBoard, item: KanbanItem): KanbanPrincipal[] {\n if (item.eligibleAgentIds === undefined && item.eligiblePrincipals === undefined)\n return [...(board.agents ?? []).map(a => ({kind: 'agent' as const, id: a.agentId})),\n ...(board.members ?? []).filter(m => !m.roles || m.roles.includes('worker'))];\n return [...(item.eligibleAgentIds ?? []).map(id => ({kind: 'agent' as const, id})), ...(item.eligiblePrincipals ?? [])];\n}\nexport function eligible(board: KanbanBoard, item: KanbanItem, actor: KanbanActor): void {\n const key = principalKey(principal(actor));\n requireValue(candidates(board, item).some(p => principalKey(p) === key), actor.kind && actor.kind !== 'agent' ? 'ASSIGNEE_NOT_ELIGIBLE' : 'AGENT_NOT_ELIGIBLE');\n}\nexport function validateCandidates(board: KanbanBoard, item: KanbanItem, executable: boolean): void {\n const allowed = new Set(roster(board).map(principalKey)), values = candidates(board, item);\n requireValue(!executable || values.length > 0, 'ELIGIBLE_ASSIGNEES_REQUIRED');\n for (const value of values) {\n identity(value.id); requireValue(['agent', 'human', 'service'].includes(value.kind), 'INVALID_PRINCIPAL');\n requireValue(allowed.has(principalKey(value)), value.kind === 'agent' ? 'AGENT_NOT_REGISTERED' : 'ASSIGNEE_NOT_REGISTERED');\n }\n}\n\nexport function normalizeActor(actor: KanbanActor): KanbanActor {\n const value = principal(actor);\n return value.kind === 'agent' ? {agentId: value.id, sessionId: actor.sessionId, taskId: actor.taskId}\n : {kind: value.kind, id: value.id};\n}\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/execution-observation.ts
2
+ function executionObservationChanged(current, next) {
3
+ return current.outcome !== next.outcome || current.code !== next.code || JSON.stringify(_nullishCoalesce(current.outputs, () => ( []))) !== JSON.stringify(_nullishCoalesce(next.outputs, () => ( []))) || next.executionSessionId !== void 0 && current.executionSessionId !== next.executionSessionId || next.controlCapabilities !== void 0 && JSON.stringify(current.controlCapabilities) !== JSON.stringify(next.controlCapabilities);
4
+ }
5
+
6
+
7
+
8
+ exports.executionObservationChanged = executionObservationChanged;
9
+ //# sourceMappingURL=chunk-4XF6LQSU.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/li/share/prj/x1/release/local-libraries/work/1ca933a0-6fe7-4e9c-b13b-76d7f318e0fb/source/libraries/kanban/dist/chunk-4XF6LQSU.cjs","../src/execution-observation.ts"],"names":[],"mappings":"AAAA;ACIO,SAAS,2BAAA,CAA4B,OAAA,EAAsB,IAAA,EAA4B;AAC1F,EAAA,OAAO,OAAA,CAAQ,QAAA,IAAY,IAAA,CAAK,QAAA,GAAW,OAAA,CAAQ,KAAA,IAAS,IAAA,CAAK,KAAA,GAC1D,IAAA,CAAK,SAAA,kBAAU,OAAA,CAAQ,OAAA,UAAW,CAAC,GAAC,EAAA,IAAM,IAAA,CAAK,SAAA,kBAAU,IAAA,CAAK,OAAA,UAAW,CAAC,GAAC,EAAA,GAC3E,IAAA,CAAK,mBAAA,IAAuB,KAAA,EAAA,GAAa,OAAA,CAAQ,mBAAA,IAAuB,IAAA,CAAK,mBAAA,GAC7E,IAAA,CAAK,oBAAA,IAAwB,KAAA,EAAA,GAAa,IAAA,CAAK,SAAA,CAAU,OAAA,CAAQ,mBAAmB,EAAA,IAAM,IAAA,CAAK,SAAA,CAAU,IAAA,CAAK,mBAAmB,CAAA;AAC5I;ADLA;AACA;AACE;AACF,kEAAC","file":"/home/li/share/prj/x1/release/local-libraries/work/1ca933a0-6fe7-4e9c-b13b-76d7f318e0fb/source/libraries/kanban/dist/chunk-4XF6LQSU.cjs","sourcesContent":[null,"import type {KanbanDispatch} from './contracts';\n\ntype Observation = Pick<KanbanDispatch, 'outcome' | 'code' | 'outputs' | 'executionSessionId' | 'controlCapabilities'>;\n/** A lease renewal is operational state, separate from observable execution changes. */\nexport function executionObservationChanged(current: Observation, next: Observation): boolean {\n return current.outcome !== next.outcome || current.code !== next.code\n || JSON.stringify(current.outputs ?? []) !== JSON.stringify(next.outputs ?? [])\n || next.executionSessionId !== undefined && current.executionSessionId !== next.executionSessionId\n || next.controlCapabilities !== undefined && JSON.stringify(current.controlCapabilities) !== JSON.stringify(next.controlCapabilities);\n}\n"]}
@@ -0,0 +1,148 @@
1
+ import {
2
+ allocateBoardNumber,
3
+ archiveKey,
4
+ boardCounterKey,
5
+ boardKey,
6
+ boardNumberKey,
7
+ counter,
8
+ decodeRow,
9
+ encodeBoard,
10
+ encodeRow,
11
+ hydrate,
12
+ indexedView,
13
+ numberEntities,
14
+ patchBoardNumber,
15
+ receiptDigest,
16
+ rowChanges,
17
+ rowKeys,
18
+ verifyReceipt,
19
+ viewFromState
20
+ } from "./chunk-OHQTKGQN.js";
21
+ import {
22
+ KanbanError
23
+ } from "./chunk-G6FCDLDF.js";
24
+
25
+ // src/store.ts
26
+ import { FSError } from "@nestos/vfs-core";
27
+ var SeqKanbanStore = class _SeqKanbanStore {
28
+ constructor(fs, path, bodies) {
29
+ this.fs = fs;
30
+ this.path = path;
31
+ this.bodies = bodies ?? { read: async (hash) => {
32
+ const body = await fs.meta.assets.getAsset(path, `${hash}.json`);
33
+ if (body === null || body instanceof ArrayBuffer) return body;
34
+ throw new KanbanError("BODY_INTEGRITY");
35
+ }, write: async (hash, bytes) => {
36
+ await fs.meta.assets.putAsset(path, `${hash}.json`, bytes);
37
+ } };
38
+ }
39
+ bodies;
40
+ static async open(fs, directory = "/kanban", bodies) {
41
+ if (!fs.meta.seq?.transaction) throw new KanbanError("TRANSACTION_REQUIRED");
42
+ try {
43
+ await fs.driver.createFile({ parentPath: directory, name: "boards.seq", type: "seqfile", recursive: true });
44
+ } catch (error) {
45
+ if (!(error instanceof FSError) || error.code !== "EEXIST") throw error;
46
+ }
47
+ return new _SeqKanbanStore(fs, `${directory}/boards.seq`, bodies);
48
+ }
49
+ async boardId(number) {
50
+ return this.fs.meta.seq.getEntry(this.path, boardNumberKey(number));
51
+ }
52
+ async ids() {
53
+ return JSON.parse(await this.fs.meta.seq.getEntry(this.path, "index") ?? "[]");
54
+ }
55
+ async events(id, after, limit, through) {
56
+ const end = Math.min(through, after + limit);
57
+ const keys = Array.from({ length: Math.max(0, end - after) }, (_, index) => `event/${encodeURIComponent(id)}/${String(after + index + 1).padStart(16, "0")}`);
58
+ if (!keys.length) return [];
59
+ const rows = await this.fs.meta.seq.getEntries(this.path, keys);
60
+ return keys.filter((key) => rows[key] !== void 0).map((key) => JSON.parse(rows[key]));
61
+ }
62
+ async archived(boardId, itemId) {
63
+ const raw = await this.fs.meta.seq.getEntry(this.path, archiveKey(boardId, itemId));
64
+ if (!raw) return null;
65
+ const record = await decodeRow(raw, this.bodies);
66
+ record.item.number ??= (await this.view(boardId))?.state.archiveIndex?.find((item) => item.id === itemId)?.number;
67
+ return record;
68
+ }
69
+ async load(id, receiptKey) {
70
+ return this.fs.meta.seq.transaction(async (tx) => {
71
+ const raw = await tx.getEntry(this.path, boardKey(id));
72
+ return { raw, rows: await tx.getEntries(this.path, rowKeys(raw)), receipt: receiptKey ? await tx.getEntry(this.path, receiptKey) : void 0 };
73
+ });
74
+ }
75
+ async view(id) {
76
+ const raw = await this.fs.meta.seq.getEntry(this.path, boardKey(id));
77
+ const indexed = indexedView(raw);
78
+ if (indexed) return indexed;
79
+ const state = await this.read(id);
80
+ return state ? viewFromState(state) : null;
81
+ }
82
+ async read(id) {
83
+ return hydrate(await this.load(id), this.bodies);
84
+ }
85
+ async update(id, operationId, fingerprint, change) {
86
+ const receiptKey = `receipt/${encodeURIComponent(id)}/${encodeURIComponent(operationId)}`;
87
+ const before = await this.load(id, receiptKey), current = await hydrate(before, this.bodies), receipt = before.receipt;
88
+ if (receipt) {
89
+ verifyReceipt(receipt, fingerprint);
90
+ if (!current) throw new KanbanError("CORRUPT_RECEIPT");
91
+ return current;
92
+ }
93
+ const original = JSON.stringify(current), next = change(current);
94
+ numberEntities(next);
95
+ if (JSON.stringify(next) === original) return next;
96
+ return this.persist(id, receiptKey, fingerprint, before, next);
97
+ }
98
+ async persist(id, receiptKey, fingerprint, before, next) {
99
+ const events = [...next.events], archives = await Promise.all((next.archiveWrites ?? []).map(async (write) => ({ key: archiveKey(id, write.id), value: write.value ? await encodeRow(write.value, this.bodies) : null })));
100
+ delete next.archiveWrites;
101
+ next.events = [];
102
+ const encoded = await encodeBoard(next, this.bodies);
103
+ const committed = await this.fs.meta.seq.transaction(async (tx) => {
104
+ const latestReceipt = await tx.getEntry(this.path, receiptKey);
105
+ if (latestReceipt) {
106
+ verifyReceipt(latestReceipt, fingerprint);
107
+ return null;
108
+ }
109
+ if (await tx.getEntry(this.path, boardKey(id)) !== before.raw) throw new KanbanError("REVISION_CONFLICT");
110
+ await commitBoardNumber(tx, this.path, id, before, next, encoded);
111
+ const eventRows = events.map((event) => ({ key: `event/${encodeURIComponent(id)}/${String(event.sequence).padStart(16, "0")}`, value: JSON.stringify(event) }));
112
+ await writeRows(tx, this.path, [
113
+ ...eventRows,
114
+ ...rowChanges(before, encoded),
115
+ ...archives,
116
+ { key: boardKey(id), value: encoded.raw },
117
+ { key: receiptKey, value: receiptDigest(fingerprint) }
118
+ ]);
119
+ const ids = JSON.parse(await tx.getEntry(this.path, "index") ?? "[]");
120
+ if (!ids.includes(id)) await tx.setEntry(this.path, "index", JSON.stringify([...ids, id]));
121
+ return next;
122
+ });
123
+ if (committed) return committed;
124
+ const replay = await this.read(id);
125
+ if (!replay) throw new KanbanError("CORRUPT_RECEIPT");
126
+ return replay;
127
+ }
128
+ };
129
+ async function writeRows(tx, path, rows) {
130
+ for (const row of rows) {
131
+ if (row.value === null) await tx.deleteEntry(path, row.key);
132
+ else await tx.setEntry(path, row.key, row.value);
133
+ }
134
+ }
135
+ async function commitBoardNumber(tx, path, id, before, next, encoded) {
136
+ const previous = counter(await tx.getEntry(path, boardCounterKey));
137
+ next.board.number = allocateBoardNumber(before.raw, previous);
138
+ const owner = await tx.getEntry(path, boardNumberKey(next.board.number));
139
+ if (owner !== null && owner !== id) throw new KanbanError("INVALID_NUMBERING");
140
+ encoded.raw = patchBoardNumber(encoded.raw, next.board.number);
141
+ await tx.setEntry(path, boardCounterKey, String(Math.max(previous, next.board.number)));
142
+ await tx.setEntry(path, boardNumberKey(next.board.number), id);
143
+ }
144
+
145
+ export {
146
+ SeqKanbanStore
147
+ };
148
+ //# sourceMappingURL=chunk-5DLZWW5Y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/store.ts"],"sourcesContent":["import {numberEntities, boardCounterKey, boardNumberKey, counter, allocateBoardNumber, patchBoardNumber} from './numbering';\nimport type { KanbanEvent, KanbanArchivedItem } from './contracts';\nimport { FSError, type IFileSystem } from '@nestos/vfs-core';\nimport { KanbanError, type KanbanState, type KanbanStore } from './ports';\nimport {indexedView, viewFromState, archiveKey, boardKey as key, rowKeys, hydrate, encodeBoard, rowChanges, encodeRow, decodeRow, receiptDigest, verifyReceipt, type StoredBoard, type KanbanBodyStore} from './storage-codec';\n\n/** One user-scoped journal, with atomic board/index/receipt commits. */\nexport class SeqKanbanStore implements KanbanStore {\n private readonly bodies: KanbanBodyStore;\n private constructor(private readonly fs: IFileSystem, private readonly path: string, bodies?: KanbanBodyStore) {\n this.bodies = bodies ?? {read: async hash => {\n const body = await fs.meta.assets.getAsset(path, `${hash}.json`);\n if (body === null || body instanceof ArrayBuffer) return body;\n throw new KanbanError('BODY_INTEGRITY');\n }, write: async (hash, bytes) => {await fs.meta.assets.putAsset(path, `${hash}.json`, bytes);}};\n }\n static async open(fs: IFileSystem, directory = '/kanban', bodies?: KanbanBodyStore): Promise<SeqKanbanStore> {\n if (!fs.meta.seq?.transaction) throw new KanbanError('TRANSACTION_REQUIRED');\n try { await fs.driver.createFile({ parentPath: directory, name: 'boards.seq', type: 'seqfile', recursive: true }); }\n catch (error) { if (!(error instanceof FSError) || error.code !== 'EEXIST') throw error; }\n return new SeqKanbanStore(fs, `${directory}/boards.seq`, bodies);\n }\n async boardId(number: number): Promise<string | null> {return this.fs.meta.seq!.getEntry(this.path, boardNumberKey(number));}\n async ids(): Promise<string[]> {\n return JSON.parse(await this.fs.meta.seq!.getEntry(this.path, 'index') ?? '[]');\n }\n async events(id: string, after: number, limit: number, through: number): Promise<KanbanEvent[]> {\n const end = Math.min(through, after + limit);\n const keys = Array.from({length: Math.max(0, end - after)}, (_, index) =>\n `event/${encodeURIComponent(id)}/${String(after + index + 1).padStart(16, '0')}`);\n if (!keys.length) return [];\n // The committed sequence freezes this immutable prefix; bulk key reads avoid history scans.\n const rows = await this.fs.meta.seq!.getEntries(this.path, keys);\n return keys.filter(key => rows[key] !== undefined).map(key => JSON.parse(rows[key]) as KanbanEvent);\n }\n\n async archived(boardId: string, itemId: string): Promise<KanbanArchivedItem | null> {\n const raw = await this.fs.meta.seq!.getEntry(this.path, archiveKey(boardId, itemId));\n if (!raw) return null; const record = await decodeRow<KanbanArchivedItem>(raw, this.bodies);\n record.item.number ??= (await this.view(boardId))?.state.archiveIndex?.find(item => item.id === itemId)?.number; return record;\n }\n private async load(id: string, receiptKey?: string): Promise<StoredBoard & {receipt?: string | null}> {\n return this.fs.meta.seq!.transaction!(async tx => {\n const raw = await tx.getEntry(this.path, key(id));\n return {raw, rows: await tx.getEntries(this.path, rowKeys(raw)), receipt: receiptKey ? await tx.getEntry(this.path, receiptKey) : undefined};\n });\n }\n async view(id: string) {\n const raw = await this.fs.meta.seq!.getEntry(this.path, key(id));\n const indexed = indexedView(raw); if (indexed) return indexed;\n const state = await this.read(id); return state ? viewFromState(state) : null;\n }\n async read(id: string): Promise<KanbanState | null> {return hydrate(await this.load(id), this.bodies);}\n async update(id: string, operationId: string, fingerprint: string,\n change: (state: KanbanState | null) => KanbanState): Promise<KanbanState> {\n const receiptKey = `receipt/${encodeURIComponent(id)}/${encodeURIComponent(operationId)}`;\n const before = await this.load(id, receiptKey), current = await hydrate(before, this.bodies), receipt = before.receipt;\n if (receipt) {verifyReceipt(receipt, fingerprint); if (!current) throw new KanbanError('CORRUPT_RECEIPT'); return current;}\n const original = JSON.stringify(current), next = change(current);\n numberEntities(next);\n if (JSON.stringify(next) === original) return next;\n return this.persist(id, receiptKey, fingerprint, before, next);\n }\n private async persist(id: string, receiptKey: string, fingerprint: string, before: StoredBoard, next: KanbanState): Promise<KanbanState> {\n const events = [...next.events], archives = await Promise.all((next.archiveWrites ?? []).map(async write =>\n ({key: archiveKey(id, write.id), value: write.value ? await encodeRow(write.value, this.bodies) : null})));\n delete next.archiveWrites; next.events = [];\n // No asset I/O runs under the SeqFile transaction: it may use the same backend.\n const encoded = await encodeBoard(next, this.bodies);\n const committed = await this.fs.meta.seq!.transaction!(async tx => {\n const latestReceipt = await tx.getEntry(this.path, receiptKey);\n if (latestReceipt) {verifyReceipt(latestReceipt, fingerprint); return null;}\n if (await tx.getEntry(this.path, key(id)) !== before.raw) throw new KanbanError('REVISION_CONFLICT');\n await commitBoardNumber(tx, this.path, id, before, next, encoded);\n const eventRows = events.map(event => ({key: `event/${encodeURIComponent(id)}/${String(event.sequence).padStart(16, '0')}`, value: JSON.stringify(event)}));\n await writeRows(tx, this.path, [...eventRows, ...rowChanges(before, encoded), ...archives,\n {key: key(id), value: encoded.raw!}, {key: receiptKey, value: receiptDigest(fingerprint)}]);\n const ids: string[] = JSON.parse(await tx.getEntry(this.path, 'index') ?? '[]');\n if (!ids.includes(id)) await tx.setEntry(this.path, 'index', JSON.stringify([...ids, id]));\n return next;\n });\n if (committed) return committed;\n const replay = await this.read(id); if (!replay) throw new KanbanError('CORRUPT_RECEIPT'); return replay;\n }\n}\nasync function writeRows(tx: import('@nestos/vfs-core').ISeqFileTransaction, path: string, rows: Array<{key: string; value: string | null}>): Promise<void> {\n for (const row of rows) {\n if (row.value === null) await tx.deleteEntry(path, row.key);\n else await tx.setEntry(path, row.key, row.value);\n }\n}\n\nasync function commitBoardNumber(tx: import('@nestos/vfs-core').ISeqFileTransaction, path: string, id: string, before: StoredBoard, next: KanbanState, encoded: StoredBoard): Promise<void> {\n const previous = counter(await tx.getEntry(path, boardCounterKey));\n next.board.number = allocateBoardNumber(before.raw, previous);\n const owner = await tx.getEntry(path, boardNumberKey(next.board.number));\n if (owner !== null && owner !== id) throw new KanbanError('INVALID_NUMBERING');\n encoded.raw = patchBoardNumber(encoded.raw!, next.board.number);\n await tx.setEntry(path, boardCounterKey, String(Math.max(previous, next.board.number)));\n await tx.setEntry(path, boardNumberKey(next.board.number), id);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,eAAiC;AAKnC,IAAM,iBAAN,MAAM,gBAAsC;AAAA,EAEvC,YAA6B,IAAkC,MAAc,QAA0B;AAA1E;AAAkC;AACnE,SAAK,SAAS,UAAU,EAAC,MAAM,OAAM,SAAQ;AACzC,YAAM,OAAO,MAAM,GAAG,KAAK,OAAO,SAAS,MAAM,GAAG,IAAI,OAAO;AAC/D,UAAI,SAAS,QAAQ,gBAAgB,YAAa,QAAO;AACzD,YAAM,IAAI,YAAY,gBAAgB;AAAA,IAC1C,GAA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QAAQ,UAAU,GAAI,OAAM,IAAI,YAAY,mBAAmB;AAC7E,UAAQ,MAAM,iBAAiB,QAAQ,KAAM,KAAK,MAAM,MAAM;AAC9D,QAAM,GAAG,SAAS,MAAM,iBAAiB,OAAO,KAAK,IAAI,UAAU,KAAK,MAAM,MAAM,CAAC,CAAC;AACtF,QAAM,GAAG,SAAS,MAAM,eAAe,KAAK,MAAM,MAAM,GAAG,EAAE;AACjE;","names":[]}
@@ -0,0 +1,58 @@
1
+ // src/contracts/references.ts
2
+ function kanbanReference(board, entity) {
3
+ const prefix = board.number ? `KB-${board.number}` : board.id;
4
+ if (!entity) return prefix;
5
+ if (!entity.number) return `${prefix}/${entity.id}`;
6
+ return entity.kind ? `${prefix}/${entity.kind === "log" ? "L" : "D"}-${entity.number}` : `${prefix}#${entity.number}`;
7
+ }
8
+
9
+ // src/contracts/configuration.ts
10
+ var DEFAULT_KANBAN_WORK_TYPES = [
11
+ { id: "initiative", label: "Goal", rank: 0, executable: false },
12
+ { id: "feature", label: "Group", rank: 1, executable: false },
13
+ { id: "task", label: "Action", rank: 2, executable: true },
14
+ { id: "fix", label: "Fix", rank: 2, executable: true },
15
+ { id: "subtask", label: "Subtask", rank: 3, executable: true }
16
+ ];
17
+ function executableWorkItem(board, item) {
18
+ return item.planning?.execution !== "children" && (board.workTypes ?? DEFAULT_KANBAN_WORK_TYPES).some((type) => type.id === (item.planning?.kind ?? board.defaultWorkType ?? "task") && type.executable);
19
+ }
20
+
21
+ // src/contracts/discovery.ts
22
+ var DEFAULT_KANBAN_SCAN_POLICY = {
23
+ idleMs: 3e5,
24
+ includeArchived: true,
25
+ maxSessions: 20,
26
+ maxInputBytes: 128 * 1024,
27
+ leaseMs: 6e5,
28
+ autoCreate: false
29
+ };
30
+
31
+ // src/contracts/automation.ts
32
+ function sameAutomationBinding(left, right) {
33
+ const signature = (value) => JSON.stringify([
34
+ value?.planner?.system,
35
+ value?.planner?.id,
36
+ value?.planner?.revision,
37
+ value?.executor?.system,
38
+ value?.executor?.id,
39
+ value?.executor?.revision,
40
+ value?.coordinator?.kind,
41
+ value?.coordinator?.id,
42
+ value?.worker?.kind,
43
+ value?.worker?.id,
44
+ value?.autoAccept,
45
+ value?.preparation,
46
+ Object.entries(value?.preparationOptions ?? {}).sort(([a], [b]) => a.localeCompare(b))
47
+ ]);
48
+ return signature(left) === signature(right);
49
+ }
50
+
51
+ export {
52
+ kanbanReference,
53
+ DEFAULT_KANBAN_WORK_TYPES,
54
+ executableWorkItem,
55
+ DEFAULT_KANBAN_SCAN_POLICY,
56
+ sameAutomationBinding
57
+ };
58
+ //# sourceMappingURL=chunk-5XKOCKY2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/contracts/references.ts","../src/contracts/configuration.ts","../src/contracts/discovery.ts","../src/contracts/automation.ts"],"sourcesContent":["import type {KanbanBoard} from './contracts';\n\nexport interface KanbanReferenceTarget {boardId: string; itemId?: string; recordId?: string; reference: string; scope: KanbanBoard['scope']}\nexport function kanbanReference(board: {id: string; number?: number}, entity?: {id: string; number?: number; kind?: 'log' | 'decision'}): string {\n const prefix = board.number ? `KB-${board.number}` : board.id;\n if (!entity) return prefix;\n if (!entity.number) return `${prefix}/${entity.id}`;\n return entity.kind ? `${prefix}/${entity.kind === 'log' ? 'L' : 'D'}-${entity.number}` : `${prefix}#${entity.number}`;\n}\n","import type {KanbanItem, KanbanBoard} from './contracts';\n\nexport interface KanbanPrincipal {kind: 'agent' | 'human' | 'service'; id: string}\nexport interface KanbanMember extends KanbanPrincipal {\n responsibility: string; roles?: Array<'worker' | 'reviewer' | 'coordinator'>;\n}\nexport interface KanbanWorkType {id: string; label: string; rank: number; executable: boolean}\nexport interface KanbanColumn {id: string; label: string; states: KanbanItem['status'][]}\nexport interface KanbanNotificationPolicy {rules?: Record<string, 'info' | 'error' | 'none'>}\nexport const DEFAULT_KANBAN_WORK_TYPES: readonly KanbanWorkType[] = [\n {id: 'initiative', label: 'Goal', rank: 0, executable: false},\n {id: 'feature', label: 'Group', rank: 1, executable: false},\n {id: 'task', label: 'Action', rank: 2, executable: true},\n {id: 'fix', label: 'Fix', rank: 2, executable: true},\n {id: 'subtask', label: 'Subtask', rank: 3, executable: true},\n];\n\nexport interface KanbanExternalReference {system: string; id: string; revision?: string}\n\n/** A composite work item delegates execution to its children. */\nexport function executableWorkItem(board:Pick<KanbanBoard,'workTypes'|'defaultWorkType'>, item:{planning?:{kind:string;execution?:'direct'|'children'}}):boolean {\n return item.planning?.execution!=='children'&&(board.workTypes??DEFAULT_KANBAN_WORK_TYPES)\n .some(type=>type.id===(item.planning?.kind??board.defaultWorkType??'task')&&type.executable);\n}\n","import type {KanbanItemSummary} from './planning';\nimport type {KanbanBoard} from './contracts';\n\nexport type {KanbanSourceRef, KanbanDiscoveryChange, KanbanDiscoveryBatch} from './source';\nimport type {KanbanDiscoveryChange} from './source';\nexport interface KanbanScanSession {\n id: string; revision: string; updatedAt: number | null; idleSince: number | null;\n activity: 'idle' | 'active' | 'waiting' | 'unknown'; archived: boolean; scannerOwned?: boolean;\n}\nexport interface KanbanScanText {\n session: KanbanScanSession; complete: boolean;\n messages: Array<{id: string; role: 'user' | 'assistant'; text: string}>;\n}\nexport interface KanbanScanConnection {\n kind: 'local' | 'remote'; connectionId: string;\n /** Explicit consent for moving source text to a different execution boundary. */\n allowContentTransfer: boolean;\n}\nexport interface KanbanScanPolicy {\n idleMs: number; includeArchived: boolean; maxSessions: number; maxInputBytes: number; leaseMs: number;\n autoCreate: boolean; connection: KanbanScanConnection;\n}\nexport interface KanbanScanInput {\n projectContext?: {totalRecords: number; excludedRecords?: number; omittedRecords: number; records: import('./context').KanbanProjectRecord[]};\n context?: {totalItems: number; omittedItems: number; archivedTotal: number; archivedItems: KanbanItemSummary[]};\n runId: string; executorId: string; board: KanbanBoard; sessions: KanbanScanText[]; connection: KanbanScanConnection;\n}\nexport const DEFAULT_KANBAN_SCAN_POLICY: Omit<KanbanScanPolicy, 'connection'> = {\n idleMs: 300000, includeArchived: true, maxSessions: 20, maxInputBytes: 128 * 1024, leaseMs: 600000, autoCreate: false,\n};\n\nexport interface KanbanDiscoveryResult {changes: KanbanDiscoveryChange[]; records?: import('./context').KanbanRecordInput[]}\n","import type {KanbanExternalReference, KanbanPrincipal} from './configuration';\n\nexport interface KanbanAutomationSettings {\n preparation?: KanbanExternalReference;\n preparationOptions?: Record<string, string>;\n enabled: boolean; planner: KanbanExternalReference; executor: KanbanExternalReference;\n coordinator: KanbanPrincipal; worker: KanbanPrincipal; autoAccept: boolean;\n}\nexport interface KanbanAutomationOption {\n name: string; label: string; defaultValue?: string;\n choices?: Array<{value: string; label: string}>;\n}\nexport interface KanbanAutomationTarget {reference: KanbanExternalReference; label: string; options?: KanbanAutomationOption[]}\nexport interface KanbanAutomationCatalog {\n preparations?: KanbanAutomationTarget[];\n targets: KanbanAutomationTarget[]; coordinator: KanbanPrincipal; worker: KanbanPrincipal;\n}\nexport interface KanbanAnalysisStatus {\n itemId: string; state: 'analyzing' | 'ready' | 'clarification' | 'failed' | 'unknown';\n reason?: string; code?: string; dependencies?: string[];\n}\nexport function sameAutomationBinding(left?: KanbanAutomationSettings, right?: KanbanAutomationSettings): boolean {\n const signature = (value?: KanbanAutomationSettings) => JSON.stringify([value?.planner?.system, value?.planner?.id, value?.planner?.revision,\n value?.executor?.system, value?.executor?.id, value?.executor?.revision, value?.coordinator?.kind, value?.coordinator?.id,\n value?.worker?.kind, value?.worker?.id, value?.autoAccept, value?.preparation, Object.entries(value?.preparationOptions ?? {}).sort(([a], [b]) => a.localeCompare(b))]);\n return signature(left) === signature(right);\n}\n"],"mappings":";AAGO,SAAS,gBAAgB,OAAsC,QAA2E;AAC7I,QAAM,SAAS,MAAM,SAAS,MAAM,MAAM,MAAM,KAAK,MAAM;AAC3D,MAAI,CAAC,OAAQ,QAAO;AACpB,MAAI,CAAC,OAAO,OAAQ,QAAO,GAAG,MAAM,IAAI,OAAO,EAAE;AACjD,SAAO,OAAO,OAAO,GAAG,MAAM,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GAAG,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAAA,EAAC,CAAC;AAC1K,SAAO,UAAU,IAAI,MAAM,UAAU,KAAK;AAC9C;","names":[]}
@@ -0,0 +1,183 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/utils/random.ts
2
+ function randomUUID() {
3
+ const webCrypto = globalThis.crypto;
4
+ if (typeof _optionalChain([webCrypto, 'optionalAccess', _ => _.randomUUID]) === "function") {
5
+ try {
6
+ return webCrypto.randomUUID();
7
+ } catch (e2) {
8
+ }
9
+ }
10
+ return formatV4(randomBytes(16));
11
+ }
12
+ function randomBytes(length) {
13
+ const bytes = new Uint8Array(length);
14
+ if (typeof _optionalChain([globalThis, 'access', _2 => _2.crypto, 'optionalAccess', _3 => _3.getRandomValues]) === "function") {
15
+ globalThis.crypto.getRandomValues(bytes);
16
+ return bytes;
17
+ }
18
+ for (let i = 0; i < length; i++) bytes[i] = Math.floor(Math.random() * 256);
19
+ return bytes;
20
+ }
21
+ function formatV4(bytes) {
22
+ bytes[6] = bytes[6] & 15 | 64;
23
+ bytes[8] = bytes[8] & 63 | 128;
24
+ const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, "0"));
25
+ return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
26
+ }
27
+
28
+ // src/utils/digest.ts
29
+ var SHA256_K = new Uint32Array([
30
+ 1116352408,
31
+ 1899447441,
32
+ 3049323471,
33
+ 3921009573,
34
+ 961987163,
35
+ 1508970993,
36
+ 2453635748,
37
+ 2870763221,
38
+ 3624381080,
39
+ 310598401,
40
+ 607225278,
41
+ 1426881987,
42
+ 1925078388,
43
+ 2162078206,
44
+ 2614888103,
45
+ 3248222580,
46
+ 3835390401,
47
+ 4022224774,
48
+ 264347078,
49
+ 604807628,
50
+ 770255983,
51
+ 1249150122,
52
+ 1555081692,
53
+ 1996064986,
54
+ 2554220882,
55
+ 2821834349,
56
+ 2952996808,
57
+ 3210313671,
58
+ 3336571891,
59
+ 3584528711,
60
+ 113926993,
61
+ 338241895,
62
+ 666307205,
63
+ 773529912,
64
+ 1294757372,
65
+ 1396182291,
66
+ 1695183700,
67
+ 1986661051,
68
+ 2177026350,
69
+ 2456956037,
70
+ 2730485921,
71
+ 2820302411,
72
+ 3259730800,
73
+ 3345764771,
74
+ 3516065817,
75
+ 3600352804,
76
+ 4094571909,
77
+ 275423344,
78
+ 430227734,
79
+ 506948616,
80
+ 659060556,
81
+ 883997877,
82
+ 958139571,
83
+ 1322822218,
84
+ 1537002063,
85
+ 1747873779,
86
+ 1955562222,
87
+ 2024104815,
88
+ 2227730452,
89
+ 2361852424,
90
+ 2428436474,
91
+ 2756734187,
92
+ 3204031479,
93
+ 3329325298
94
+ ]);
95
+ var SHA256_H = new Uint32Array([
96
+ 1779033703,
97
+ 3144134277,
98
+ 1013904242,
99
+ 2773480762,
100
+ 1359893119,
101
+ 2600822924,
102
+ 528734635,
103
+ 1541459225
104
+ ]);
105
+ var rotateRight = (value, bits) => (value >>> bits | value << 32 - bits) >>> 0;
106
+ function toBytes(input) {
107
+ if (typeof input === "string") return new TextEncoder().encode(input);
108
+ if (input instanceof Uint8Array && input.buffer instanceof ArrayBuffer) {
109
+ return input;
110
+ }
111
+ if (ArrayBuffer.isView(input)) {
112
+ const source = new Uint8Array(input.buffer, input.byteOffset, input.byteLength);
113
+ const copy = new Uint8Array(input.byteLength);
114
+ copy.set(source);
115
+ return copy;
116
+ }
117
+ return new Uint8Array(input);
118
+ }
119
+ function toHex(bytes) {
120
+ return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
121
+ }
122
+ function paddedMessage(message) {
123
+ const padded = new Uint8Array((Math.floor((message.length + 8) / 64) + 1) * 64);
124
+ padded.set(message);
125
+ padded[message.length] = 128;
126
+ const view = new DataView(padded.buffer);
127
+ const bitLength = message.length * 8;
128
+ view.setUint32(padded.length - 8, Math.floor(bitLength / 4294967296));
129
+ view.setUint32(padded.length - 4, bitLength >>> 0);
130
+ return padded;
131
+ }
132
+ function blockSchedule(view, offset) {
133
+ const words = new Uint32Array(64);
134
+ for (let i = 0; i < 16; i++) words[i] = view.getUint32(offset + i * 4);
135
+ for (let i = 16; i < 64; i++) {
136
+ const s0 = rotateRight(words[i - 15], 7) ^ rotateRight(words[i - 15], 18) ^ words[i - 15] >>> 3;
137
+ const s1 = rotateRight(words[i - 2], 17) ^ rotateRight(words[i - 2], 19) ^ words[i - 2] >>> 10;
138
+ words[i] = words[i - 16] + s0 + words[i - 7] + s1 >>> 0;
139
+ }
140
+ return words;
141
+ }
142
+ function compressBlock(state, words) {
143
+ let [a, b, c, d, e, f, g, h] = state;
144
+ for (let i = 0; i < 64; i++) {
145
+ const sigma1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
146
+ const choose = e & f ^ ~e & g;
147
+ const temp1 = h + sigma1 + choose + SHA256_K[i] + words[i] >>> 0;
148
+ const sigma0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
149
+ const majority = a & b ^ a & c ^ b & c;
150
+ const temp2 = sigma0 + majority >>> 0;
151
+ h = g;
152
+ g = f;
153
+ f = e;
154
+ e = d + temp1 >>> 0;
155
+ d = c;
156
+ c = b;
157
+ b = a;
158
+ a = temp1 + temp2 >>> 0;
159
+ }
160
+ const next = [a, b, c, d, e, f, g, h];
161
+ for (let i = 0; i < 8; i++) state[i] = state[i] + next[i] >>> 0;
162
+ }
163
+ function sha256Bytes(input) {
164
+ const padded = paddedMessage(toBytes(input));
165
+ const view = new DataView(padded.buffer);
166
+ const state = SHA256_H.slice();
167
+ for (let offset = 0; offset < padded.length; offset += 64) {
168
+ compressBlock(state, blockSchedule(view, offset));
169
+ }
170
+ const out = new Uint8Array(32);
171
+ const outView = new DataView(out.buffer);
172
+ for (let i = 0; i < 8; i++) outView.setUint32(i * 4, state[i]);
173
+ return out;
174
+ }
175
+ function sha256HexSync(input) {
176
+ return toHex(sha256Bytes(input));
177
+ }
178
+
179
+
180
+
181
+
182
+ exports.randomUUID = randomUUID; exports.sha256HexSync = sha256HexSync;
183
+ //# sourceMappingURL=chunk-6MN3H3YF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/li/share/prj/x1/release/local-libraries/work/1ca933a0-6fe7-4e9c-b13b-76d7f318e0fb/source/libraries/kanban/dist/chunk-6MN3H3YF.cjs","../src/utils/random.ts","../src/utils/digest.ts"],"names":[],"mappings":"AAAA;ACWO,SAAS,UAAA,CAAA,EAAqB;AACjC,EAAA,MAAM,UAAA,EAAY,UAAA,CAAW,MAAA;AAC7B,EAAA,GAAA,CAAI,uBAAO,SAAA,2BAAW,aAAA,IAAe,UAAA,EAAY;AAC7C,IAAA,IAAI;AACA,MAAA,OAAO,SAAA,CAAU,UAAA,CAAW,CAAA;AAAA,IAChC,EAAA,WAAQ;AAAA,IAER;AAAA,EACJ;AACA,EAAA,OAAO,QAAA,CAAS,WAAA,CAAY,EAAE,CAAC,CAAA;AACnC;AAEA,SAAS,WAAA,CAAY,MAAA,EAA4B;AAC7C,EAAA,MAAM,MAAA,EAAQ,IAAI,UAAA,CAAW,MAAM,CAAA;AACnC,EAAA,GAAA,CAAI,uBAAO,UAAA,qBAAW,MAAA,6BAAQ,kBAAA,IAAoB,UAAA,EAAY;AAC1D,IAAA,UAAA,CAAW,MAAA,CAAO,eAAA,CAAgB,KAAK,CAAA;AACvC,IAAA,OAAO,KAAA;AAAA,EACX;AACA,EA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AAY,EAAA;AAAY,EAAA;AACpF,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AACpF,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AACvF;AAEK;AACF,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AAAY,EAAA;AACvF;AAEK;AAGG;AACD,EAAA;AACA,EAAA;AACA,IAAA;AACJ,EAAA;AACI,EAAA;AAEM,IAAA;AACA,IAAA;AACD,IAAA;AACL,IAAA;AACJ,EAAA;AACO,EAAA;AACX;AAES;AACG,EAAA;AACZ;AAES;AACC,EAAA;AACC,EAAA;AACA,EAAA;AACD,EAAA;AACA,EAAA;AACD,EAAA;AACA,EAAA;AACE,EAAA;AACX;AAES;AACC,EAAA;AACN,EAAA;AACA,EAAA;AACU,IAAA;AACA,IAAA;AACA,IAAA;AACV,EAAA;AACO,EAAA;AACX;AAES;AACG,EAAA;AACR,EAAA;AACU,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACF,IAAA;AAAO,IAAA;AAAO,IAAA;AAAQ,IAAA;AACtB,IAAA;AAAO,IAAA;AAAO,IAAA;AAAQ,IAAA;AAC9B,EAAA;AACM,EAAA;AACN,EAAA;AACJ;AAGgB;AACN,EAAA;AACA,EAAA;AACA,EAAA;AACN,EAAA;AACI,IAAA;AACJ,EAAA;AACM,EAAA;AACA,EAAA;AACN,EAAA;AACO,EAAA;AACX;AAiBgB;AACL,EAAA;AACX;AFwDU;AACA;AACA;AACA;AACA","file":"/home/li/share/prj/x1/release/local-libraries/work/1ca933a0-6fe7-4e9c-b13b-76d7f318e0fb/source/libraries/kanban/dist/chunk-6MN3H3YF.cjs","sourcesContent":[null,"/**\n * @file common/utils/random.ts\n * @description UUID v4 that also works outside a secure context.\n *\n * `crypto.randomUUID()` is secure-context-only: it is undefined over plain-HTTP\n * LAN origins (e.g. http://192.168.x.x:3000) and in WebKitGTK, so calling it\n * directly throws \"crypto.randomUUID is not a function\". `crypto.getRandomValues()`\n * stays available everywhere, so it backs the fallback below.\n */\n\n/** UUID v4 — native WebCrypto when available, `getRandomValues` otherwise. */\nexport function randomUUID(): string {\n const webCrypto = globalThis.crypto;\n if (typeof webCrypto?.randomUUID === 'function') {\n try {\n return webCrypto.randomUUID();\n } catch {\n // Present but unusable (insecure context) — fall through.\n }\n }\n return formatV4(randomBytes(16));\n}\n\nfunction randomBytes(length: number): Uint8Array {\n const bytes = new Uint8Array(length);\n if (typeof globalThis.crypto?.getRandomValues === 'function') {\n globalThis.crypto.getRandomValues(bytes);\n return bytes;\n }\n for (let i = 0; i < length; i++) bytes[i] = Math.floor(Math.random() * 256);\n return bytes;\n}\n\nfunction formatV4(bytes: Uint8Array): string {\n bytes[6] = (bytes[6] & 0x0f) | 0x40; // version 4\n bytes[8] = (bytes[8] & 0x3f) | 0x80; // RFC 4122 variant\n const hex = [...bytes].map(byte => byte.toString(16).padStart(2, '0'));\n return `${hex.slice(0, 4).join('')}-${hex.slice(4, 6).join('')}-${hex.slice(6, 8).join('')}-${hex.slice(8, 10).join('')}-${hex.slice(10).join('')}`;\n}\n","/**\n * @file common/utils/digest.ts\n * @description SHA-256 that does not require WebCrypto.\n *\n * `crypto.subtle` only exists in a secure context (HTTPS or localhost) and is\n * absent in WebKitGTK, so `crypto.subtle.digest(...)` throws \"Cannot read\n * properties of undefined (reading 'digest')\" when the app is opened over a LAN\n * HTTP origin (e.g. http://192.168.x.x:3000) or in the packaged Linux app. The\n * pure-JS fallback below computes the very same SHA-256, so digests stay stable\n * across environments.\n */\n\n/** Any input a caller may want hashed. */\nexport type DigestInput = string | ArrayBuffer | ArrayBufferView;\n\nconst SHA256_K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n]);\n\nconst SHA256_H = new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n\nconst rotateRight = (value: number, bits: number): number =>\n ((value >>> bits) | (value << (32 - bits))) >>> 0;\n\nfunction toBytes(input: DigestInput): Uint8Array<ArrayBuffer> {\n if (typeof input === 'string') return new TextEncoder().encode(input);\n if (input instanceof Uint8Array && input.buffer instanceof ArrayBuffer) {\n return input as Uint8Array<ArrayBuffer>;\n }\n if (ArrayBuffer.isView(input)) {\n // Copy so WebCrypto gets a plain ArrayBuffer (never a SharedArrayBuffer view).\n const source = new Uint8Array(input.buffer as ArrayBufferLike, input.byteOffset, input.byteLength);\n const copy = new Uint8Array(input.byteLength);\n copy.set(source);\n return copy;\n }\n return new Uint8Array(input);\n}\n\nfunction toHex(bytes: Uint8Array): string {\n return [...bytes].map(byte => byte.toString(16).padStart(2, '0')).join('');\n}\n\nfunction paddedMessage(message: Uint8Array): Uint8Array {\n const padded = new Uint8Array((Math.floor((message.length + 8) / 64) + 1) * 64);\n padded.set(message);\n padded[message.length] = 0x80;\n const view = new DataView(padded.buffer);\n const bitLength = message.length * 8;\n view.setUint32(padded.length - 8, Math.floor(bitLength / 0x1_0000_0000));\n view.setUint32(padded.length - 4, bitLength >>> 0);\n return padded;\n}\n\nfunction blockSchedule(view: DataView, offset: number): Uint32Array {\n const words = new Uint32Array(64);\n for (let i = 0; i < 16; i++) words[i] = view.getUint32(offset + i * 4);\n for (let i = 16; i < 64; i++) {\n const s0 = rotateRight(words[i - 15], 7) ^ rotateRight(words[i - 15], 18) ^ (words[i - 15] >>> 3);\n const s1 = rotateRight(words[i - 2], 17) ^ rotateRight(words[i - 2], 19) ^ (words[i - 2] >>> 10);\n words[i] = (words[i - 16] + s0 + words[i - 7] + s1) >>> 0;\n }\n return words;\n}\n\nfunction compressBlock(state: Uint32Array, words: Uint32Array): void {\n let [a, b, c, d, e, f, g, h] = state;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);\n const choose = (e & f) ^ (~e & g);\n const temp1 = (h + sigma1 + choose + SHA256_K[i] + words[i]) >>> 0;\n const sigma0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);\n const majority = (a & b) ^ (a & c) ^ (b & c);\n const temp2 = (sigma0 + majority) >>> 0;\n h = g; g = f; f = e; e = (d + temp1) >>> 0;\n d = c; c = b; b = a; a = (temp1 + temp2) >>> 0;\n }\n const next = [a, b, c, d, e, f, g, h];\n for (let i = 0; i < 8; i++) state[i] = (state[i] + next[i]) >>> 0;\n}\n\n/** Pure-JS SHA-256 usable where WebCrypto is unavailable. */\nexport function sha256Bytes(input: DigestInput): Uint8Array {\n const padded = paddedMessage(toBytes(input));\n const view = new DataView(padded.buffer);\n const state = SHA256_H.slice();\n for (let offset = 0; offset < padded.length; offset += 64) {\n compressBlock(state, blockSchedule(view, offset));\n }\n const out = new Uint8Array(32);\n const outView = new DataView(out.buffer);\n for (let i = 0; i < 8; i++) outView.setUint32(i * 4, state[i]);\n return out;\n}\n\n/** SHA-256 hex digest — WebCrypto when available, pure JS otherwise. */\nexport async function sha256Hex(input: DigestInput): Promise<string> {\n const bytes = toBytes(input);\n const subtle = globalThis.crypto?.subtle;\n if (subtle?.digest) {\n try {\n return toHex(new Uint8Array(await subtle.digest('SHA-256', bytes)));\n } catch {\n // WebCrypto present but unusable (e.g. blocked by an insecure context).\n }\n }\n return toHex(sha256Bytes(bytes));\n}\n\n/** Synchronous SHA-256 hex digest (pure JS, no WebCrypto). */\nexport function sha256HexSync(input: DigestInput): string {\n return toHex(sha256Bytes(input));\n}\n"]}