@things-factory/board-ai 10.1.37 → 10.1.39

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.
@@ -17,7 +17,6 @@ const graphql_yoga_1 = require("graphql-yoga");
17
17
  const shell_1 = require("@things-factory/shell");
18
18
  const patch_entry_js_1 = require("./patch-entry.js");
19
19
  const board_patch_broadcast_js_1 = require("./board-patch-broadcast.js");
20
- const ai_assistant_1 = require("@things-factory/ai-assistant");
21
20
  var board_patch_broadcast_js_2 = require("./board-patch-broadcast.js");
22
21
  Object.defineProperty(exports, "BOARD_PATCH_TOPIC", { enumerable: true, get: function () { return board_patch_broadcast_js_2.BOARD_PATCH_TOPIC; } });
23
22
  Object.defineProperty(exports, "boardPatchFilter", { enumerable: true, get: function () { return board_patch_broadcast_js_2.boardPatchFilter; } });
@@ -47,7 +46,7 @@ tslib_1.__decorate([
47
46
  subscribe: async ({ args, context }) => {
48
47
  const { domain, user } = context.state;
49
48
  const { boardId } = args;
50
- await (0, ai_assistant_1.assertDomainSubscribeAllowed)(domain, user, (d, u) => process.superUserGranted(d, u));
49
+ await (0, shell_1.assertDomainSubscribeAllowed)(domain, user, (d, u) => process.superUserGranted(d, u));
51
50
  return (0, graphql_yoga_1.pipe)(shell_1.pubsub.subscribe(board_patch_broadcast_js_1.BOARD_PATCH_TOPIC), (0, graphql_yoga_1.filter)((0, board_patch_broadcast_js_1.boardPatchFilter)(domain.id, boardId)));
52
51
  }
53
52
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"board-patch-subscription.js","sourceRoot":"","sources":["../../../server/service/patch-entry/board-patch-subscription.ts"],"names":[],"mappings":";;;AAuBA,8CAOC;;AA9BD;;;;;;;;GAQG;AACH,+CAAgE;AAChE,+CAA2C;AAC3C,iDAA8C;AAC9C,qDAA6C;AAC7C,yEAAwG;AACxG,+DAA2E;AAE3E,uEAAgF;AAAvE,6HAAA,iBAAiB,OAAA;AAAE,4HAAA,gBAAgB,OAAA;A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Board-AI C1 — op-브로드캐스트 spine).\n *\n * PatchEntry(AI 또는 user-direct 편집) 가 생성될 때마다 같은 board 구독자에게 방송 →\n * 실시간 공동편집의 척추. 클라이언트(C2)가 구독해 원격 patch 를 applyScenePatch 로 적용.\n *\n * 전송/패턴은 기존 board-service/board-subscription.ts 복제 (PubSub + graphql-ws, domain 격리).\n * 순수 로직(토픽/필터)은 board-patch-broadcast.ts (테스트 가능). 여기엔 pubsub 의존만.\n */\nimport { Resolver, Subscription, Root, Arg } from 'type-graphql'\nimport { filter, pipe } from 'graphql-yoga'\nimport { pubsub } from '@things-factory/shell'\nimport { PatchEntry } from './patch-entry.js'\nimport { BOARD_PATCH_TOPIC, boardPatchFilter, type BoardPatchPayload } from './board-patch-broadcast.js'\nimport { assertDomainSubscribeAllowed } from '@things-factory/ai-assistant'\n\nexport { BOARD_PATCH_TOPIC, boardPatchFilter } from './board-patch-broadcast.js'\nexport type { BoardPatchPayload } from './board-patch-broadcast.js'\n\n/**\n * PatchEntry 생성 직후 호출 — 같은 board 구독자에게 방송.\n * boardId 없으면(세션 미연결) skip. pubsub 미가용/실패해도 본 흐름(영속 완료)을 막지 않는다.\n */\nexport function publishBoardPatch(payload: BoardPatchPayload): void {\n if (!payload.boardId) return\n try {\n pubsub.publish(BOARD_PATCH_TOPIC, payload)\n } catch {\n /* 방송 생략 — 영속은 이미 끝남 */\n }\n}\n\n@Resolver(PatchEntry)\nexport class BoardPatchSubscription {\n @Subscription({\n description:\n 'Subscribes to board edit patches (AI or user-direct) for real-time collaboration on a board.',\n subscribe: async ({ args, context }) => {\n const { domain, user } = context.state\n const { boardId } = args\n\n await assertDomainSubscribeAllowed(domain, user, (d, u) => process.superUserGranted(d, u))\n\n return pipe(pubsub.subscribe(BOARD_PATCH_TOPIC), filter(boardPatchFilter(domain.id, boardId)))\n }\n })\n boardPatchActivity(@Root() payload: BoardPatchPayload, @Arg('boardId') boardId: string): PatchEntry {\n return payload.patch\n }\n}\n"]}
1
+ {"version":3,"file":"board-patch-subscription.js","sourceRoot":"","sources":["../../../server/service/patch-entry/board-patch-subscription.ts"],"names":[],"mappings":";;;AAsBA,8CAOC;;AA7BD;;;;;;;;GAQG;AACH,+CAAgE;AAChE,+CAA2C;AAC3C,iDAA4E;AAC5E,qDAA6C;AAC7C,yEAAwG;AAExG,uEAAgF;AAAvE,6HAAA,iBAAiB,OAAA;AAAE,4HAAA,gBAAgB,OAAA;AAG5C;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,OAA0B;IAC1D,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,OAAM;IAC5B,IAAI,CAAC;QACH,cAAM,CAAC,OAAO,CAAC,4CAAiB,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,uBAAuB;IACzB,CAAC;AACH,CAAC;AAGM,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAajC,kBAAkB,CAAS,OAA0B,EAAkB,OAAe;QACpF,OAAO,OAAO,CAAC,KAAK,CAAA;IACtB,CAAC;CACF,CAAA;AAhBY,wDAAsB;AAajC;IAZC,IAAA,2BAAY,EAAC;QACZ,WAAW,EACT,8FAA8F;QAChG,SAAS,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;YACrC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;YACtC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;YAExB,MAAM,IAAA,oCAA4B,EAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;YAE1F,OAAO,IAAA,mBAAI,EAAC,cAAM,CAAC,SAAS,CAAC,4CAAiB,CAAC,EAAE,IAAA,qBAAM,EAAC,IAAA,2CAAgB,EAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;QAChG,CAAC;KACF,CAAC;IACkB,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAA8B,mBAAA,IAAA,kBAAG,EAAC,SAAS,CAAC,CAAA;;;4CAAmB,2BAAU;gEAElG;iCAfU,sBAAsB;IADlC,IAAA,uBAAQ,EAAC,2BAAU,CAAC;GACR,sBAAsB,CAgBlC","sourcesContent":["/*\n * BoardPatchSubscription (Phase Board-AI C1 — op-브로드캐스트 spine).\n *\n * PatchEntry(AI 또는 user-direct 편집) 가 생성될 때마다 같은 board 구독자에게 방송 →\n * 실시간 공동편집의 척추. 클라이언트(C2)가 구독해 원격 patch 를 applyScenePatch 로 적용.\n *\n * 전송/패턴은 기존 board-service/board-subscription.ts 복제 (PubSub + graphql-ws, domain 격리).\n * 순수 로직(토픽/필터)은 board-patch-broadcast.ts (테스트 가능). 여기엔 pubsub 의존만.\n */\nimport { Resolver, Subscription, Root, Arg } from 'type-graphql'\nimport { filter, pipe } from 'graphql-yoga'\nimport { assertDomainSubscribeAllowed, pubsub } from '@things-factory/shell'\nimport { PatchEntry } from './patch-entry.js'\nimport { BOARD_PATCH_TOPIC, boardPatchFilter, type BoardPatchPayload } from './board-patch-broadcast.js'\n\nexport { BOARD_PATCH_TOPIC, boardPatchFilter } from './board-patch-broadcast.js'\nexport type { BoardPatchPayload } from './board-patch-broadcast.js'\n\n/**\n * PatchEntry 생성 직후 호출 — 같은 board 구독자에게 방송.\n * boardId 없으면(세션 미연결) skip. pubsub 미가용/실패해도 본 흐름(영속 완료)을 막지 않는다.\n */\nexport function publishBoardPatch(payload: BoardPatchPayload): void {\n if (!payload.boardId) return\n try {\n pubsub.publish(BOARD_PATCH_TOPIC, payload)\n } catch {\n /* 방송 생략 — 영속은 이미 끝남 */\n }\n}\n\n@Resolver(PatchEntry)\nexport class BoardPatchSubscription {\n @Subscription({\n description:\n 'Subscribes to board edit patches (AI or user-direct) for real-time collaboration on a board.',\n subscribe: async ({ args, context }) => {\n const { domain, user } = context.state\n const { boardId } = args\n\n await assertDomainSubscribeAllowed(domain, user, (d, u) => process.superUserGranted(d, u))\n\n return pipe(pubsub.subscribe(BOARD_PATCH_TOPIC), filter(boardPatchFilter(domain.id, boardId)))\n }\n })\n boardPatchActivity(@Root() payload: BoardPatchPayload, @Arg('boardId') boardId: string): PatchEntry {\n return payload.patch\n }\n}\n"]}