@takagaki/cortex-decisions-viewer 0.12.286 → 0.12.293

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.
@@ -28,6 +28,7 @@ exports.configIntentSig = configIntentSig;
28
28
  exports.configReqOk = configReqOk;
29
29
  exports.configNewReq = configNewReq;
30
30
  exports.configClassify = configClassify;
31
+ exports.configCheckOf = configCheckOf;
31
32
  exports.configUnlinkedNotify = configUnlinkedNotify;
32
33
  exports.configDriveFolderId = configDriveFolderId;
33
34
  exports.configAddTarget = configAddTarget;
@@ -40,6 +41,9 @@ exports.configDuplicateLines = configDuplicateLines;
40
41
  exports.configNightReadOf = configNightReadOf;
41
42
  exports.configCapRowCount = configCapRowCount;
42
43
  exports.configFleetRowsOf = configFleetRowsOf;
44
+ // 訳の語の表(cortex-engine #3142・束ねた原本)。configClassify が足す時の断りの語を照らす。分解して受けるので、関数の中は表の名前のまま(画面へ toString で流せる)
45
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
46
+ const { CONNECTION_WORDS } = require("./engine/connection-words");
43
47
  /** `op=state` / `op=config` の応答の `mode`。**無い・知らない値は `file`**(古い intake は `mode` を返さない) */
44
48
  function configModeOf(body) {
45
49
  return body && typeof body === "object" && body.mode === "table" ? "table" : "file";
@@ -207,9 +211,64 @@ function configClassify(status, body, formKind) {
207
211
  }
208
212
  if (st === 422 && j.code === "REQ_MISMATCH")
209
213
  return { type: "reqMismatch", final: true, view: null, message: message };
214
+ // 断りの訳の語(cortex-engine #3142)。語の表で足す時に出る語(`where` に `add`)だけ通し、知らない値は捨てる。
215
+ // 表は画面へ流した `CONNECTION_WORDS`(束ねた原本・写さない)。結果の 1 行は語の一手と誰がやる事かの 1 文を添える(render.ts の configNote)
216
+ const word = typeof j.word === "string" && Object.prototype.hasOwnProperty.call(CONNECTION_WORDS, j.word) && CONNECTION_WORDS[j.word].where.indexOf("add") !== -1 ? j.word : "";
210
217
  if (st >= 400 && st < 500)
211
- return { type: "failed", final: true, view: null, message: message };
212
- return { type: "retryable", final: false, view: null, message: message };
218
+ return word ? { type: "failed", final: true, view: null, message: message, word: word } : { type: "failed", final: true, view: null, message: message };
219
+ return word ? { type: "retryable", final: false, view: null, message: message, word: word } : { type: "retryable", final: false, view: null, message: message };
220
+ }
221
+ /**
222
+ * 足した行の確かめの答え(`op=config` の 200 の `check`〈1 行〉・`checks`〈複数〉・cortex-engine #3154 便 CONN-ONE-B)を 1 つに畳む。
223
+ * 確認の窓の結果の伝言にも同じ欄で載る(`{ check, checks }` を渡す)。
224
+ * - 1 件の形: `{ kind, ref, workspace?, status: "ok"|"failed", reason? }` か `{ kind, ref, workspace?, notChecked }`。形の違う件は捨てる(型を確かめた物だけ読む)
225
+ * - 畳み方: 1 つでも failed なら failed(最初の failed の行・数を添えない)。全部 ok なら ok。ほか(確かめられなかった行が混じる)は status が空
226
+ * - `answers` は行に重ねる答え(status のある件だけ・`checkedAt` は在れば・`currentName` は空でない文字列の時だけ、ほかは "")
227
+ * 読める件が 1 つも無ければ null(呼び手は受け口の今の文のまま)
228
+ */
229
+ function configCheckOf(body) {
230
+ const j = body && typeof body === "object" ? body : {};
231
+ const list = j.check !== undefined && j.check !== null ? [j.check] : Array.isArray(j.checks) ? j.checks : [];
232
+ const rows = [];
233
+ for (let i = 0; i < list.length; i++) {
234
+ const c = list[i];
235
+ if (!c || typeof c !== "object" || Array.isArray(c))
236
+ continue;
237
+ if (typeof c.kind !== "string" || !c.kind || typeof c.ref !== "string" || !c.ref)
238
+ continue;
239
+ if (c.workspace !== undefined && c.workspace !== null && typeof c.workspace !== "string")
240
+ continue;
241
+ const base = { kind: c.kind, ref: c.ref, workspace: typeof c.workspace === "string" ? c.workspace : "" };
242
+ if (c.status === "ok" || c.status === "failed") {
243
+ if (c.reason !== undefined && typeof c.reason !== "string")
244
+ continue;
245
+ rows.push({
246
+ kind: base.kind, ref: base.ref, workspace: base.workspace, status: c.status,
247
+ reason: c.status === "failed" && typeof c.reason === "string" ? c.reason : "",
248
+ checkedAt: typeof c.checkedAt === "string" ? c.checkedAt : "",
249
+ currentName: typeof c.currentName === "string" && c.currentName ? c.currentName : "",
250
+ });
251
+ }
252
+ else if (c.status === undefined && typeof c.notChecked === "string" && c.notChecked) {
253
+ rows.push({ kind: base.kind, ref: base.ref, workspace: base.workspace, status: "", reason: "", checkedAt: "", currentName: "" });
254
+ }
255
+ }
256
+ if (!rows.length)
257
+ return null;
258
+ let head = null;
259
+ for (let k = 0; k < rows.length && !head; k++)
260
+ if (rows[k].status === "failed")
261
+ head = rows[k];
262
+ if (!head && rows.every(function (r) { return r.status === "ok"; }))
263
+ head = rows[0];
264
+ return {
265
+ status: head ? head.status : "",
266
+ kind: head ? head.kind : "",
267
+ ref: head ? head.ref : "",
268
+ workspace: head ? head.workspace : "",
269
+ reason: head ? head.reason : "",
270
+ answers: rows.filter(function (r) { return r.status === "ok" || r.status === "failed"; }),
271
+ };
213
272
  }
214
273
  /** 取り込み設定に結びついていない宛先(契約の `unlinked: true` の通知先の行)。種別を絞る */
215
274
  function configUnlinkedNotify(view, kind) {
@@ -250,7 +250,9 @@ var R = Object.freeze({
250
250
  keyMissing: "key_missing",
251
251
  keyRejected: "key_rejected",
252
252
  permissionMissing: "permission_missing",
253
+ unclearAccess: "unclear_access",
253
254
  notMember: "not_member",
255
+ notConnected: "not_connected",
254
256
  notFound: "not_found",
255
257
  approvalPending: "approval_pending",
256
258
  notAllowed: "not_allowed",
@@ -291,7 +293,13 @@ var BROKER_DENIALS = Object.freeze({
291
293
  repo_org_mismatch: R.notFound,
292
294
  not_selected_by_app: R.notMember,
293
295
  // App に、その場を読む権限(permission)が許されていない(`github-app-token.mjs` の断りの語)
294
- perm_not_granted: R.permissionMissing
296
+ perm_not_granted: R.permissionMissing,
297
+ // tools の受け口の窓口の呼び手(`github-broker-ops.mjs`)が返す断りの語(cortex-engine #3142)。
298
+ // その GitHub の組織が、この Cortex の組織に登録されていない(§23・他の組織と同じ応答)/案件の会社の App がつながっていない → 利用者の側で App を入れる。
299
+ // ほかの窓口の拒否(`denied`)は、このプロジェクトに鍵を出さない= Cortex の設定。どれも今までは値の表に無く `unreadable`(Cortex 側で対応中)に落ちていた
300
+ org_not_in_tenant: R.notConnected,
301
+ app_not_connected: R.notConnected,
302
+ denied: R.notAllowed
295
303
  });
296
304
  var stateOf = (s) => Object.freeze({
297
305
  toolName: s.toolName,
@@ -317,8 +325,8 @@ var TOOL_CATALOG = Object.freeze({
317
325
  placeName: "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8",
318
326
  countUnit: "\u4EF6",
319
327
  keyName: "API \u30AD\u30FC",
320
- // 403 は IP 制限か権限(窓口からは区別できない)・404 は API キーの発行者がプロジェクトのメンバーでないときも返る
321
- answers: { status: { 401: R.keyRejected, 403: R.permissionMissing, 404: R.notFound, 429: R.busy, "5xx": R.busy, 0: R.busy } }
328
+ // 403 は IP 制限か権限(窓口からは区別できない=訳を見分けられない・cortex-engine #3142)・404 は API キーの発行者がプロジェクトのメンバーでないときも返る
329
+ answers: { status: { 401: R.keyRejected, 403: R.unclearAccess, 404: R.notFound, 429: R.busy, "5xx": R.busy, 0: R.busy } }
322
330
  })
323
331
  }),
324
332
  github: Object.freeze({
@@ -407,8 +415,8 @@ var TOOL_CATALOG = Object.freeze({
407
415
  toolName: "Figma",
408
416
  placeName: "\u30D5\u30A1\u30A4\u30EB",
409
417
  keyName: "API \u30AD\u30FC",
410
- // Figma は失効したトークンも 403 で返す(`figma-gate.mjs`)。権限不足と区別できないので権限に寄せ、直し方の文で両方を言う
411
- answers: { status: { 401: R.keyRejected, 403: R.permissionMissing, 404: R.notFound, 429: R.busy, "5xx": R.busy, 0: R.busy } }
418
+ // Figma は失効したトークンも 403 で返す(`figma-gate.mjs`)。権限不足と区別できないので、訳を見分けられない語にし、画面は試せる順を出す(cortex-engine #3142)
419
+ answers: { status: { 401: R.keyRejected, 403: R.unclearAccess, 404: R.notFound, 429: R.busy, "5xx": R.busy, 0: R.busy } }
412
420
  })
413
421
  }),
414
422
  "google-drive": Object.freeze({
@@ -519,6 +527,7 @@ var GITHUB_REPO_RE = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;
519
527
  var GITHUB_READS = Object.freeze(["issues", "discussions"]);
520
528
  var FIGMA_KEY_RE = /^[A-Za-z0-9_-]{8,}$/;
521
529
  var DRIVE_FOLDER_ID_RE = /^[A-Za-z0-9_-]+$/;
530
+ var PORTAL_USER_ID_RE = /^[0-9A-HJKMNP-TV-Z]{26}$/;
522
531
  var GUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
523
532
  var TEAMS_CHANNEL_RE = /^19:\S+$/;
524
533
  var TEAMS_FOLDER_RE = /^\S+$/;
@@ -583,7 +592,7 @@ function checkItems(conn, listKey, { at, errors, idKey, re, what, allowed, seen,
583
592
  }
584
593
  checkKeys(item, [idKey, ...allowed, ...NOTE_KEYS], iat, errors);
585
594
  checkNotes(item, iat, errors);
586
- for (const k of allowed) if (k !== "read") checkOptionalStr(item, k, iat, errors);
595
+ for (const k of allowed) if (k !== "read" && k !== "principal") checkOptionalStr(item, k, iat, errors);
587
596
  const id = item[idKey];
588
597
  if (typeof id !== "string" || !re.test(id)) {
589
598
  errors.push(`${iat}.${idKey} \u304C${what}\u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ${JSON.stringify(id)}`);
@@ -719,9 +728,23 @@ function checkDrive(conn, at, errors, ctx) {
719
728
  idKey: "id",
720
729
  re: DRIVE_FOLDER_ID_RE,
721
730
  what: "Drive \u306E\u30D5\u30A9\u30EB\u30C0 ID",
722
- allowed: ["name"],
731
+ allowed: ["name", "principal"],
723
732
  seen: ctx.driveFolders
724
733
  });
734
+ for (const [i, f] of (Array.isArray(conn.folders) ? conn.folders : []).entries()) {
735
+ if (!isObj(f) || !("principal" in f)) continue;
736
+ const pat = `${at}.folders[${i}].principal`;
737
+ const p = f.principal;
738
+ if (!isObj(p)) {
739
+ errors.push(`${pat} \u306F { "kind": "person", "userId": \u2026 } \u3067\u3059\uFF08\u66F8\u304B\u306A\u3051\u308C\u3070\u6A5F\u68B0\u306E\u8A31\u53EF\u3067\u8AAD\u307F\u307E\u3059\uFF09: ${JSON.stringify(p)}`);
740
+ continue;
741
+ }
742
+ checkKeys(p, ["kind", "userId"], pat, errors);
743
+ if (p.kind !== "person") errors.push(`${pat}.kind \u306F person \u3060\u3051\u3067\u3059: ${JSON.stringify(p.kind)}`);
744
+ if (typeof p.userId !== "string" || !PORTAL_USER_ID_RE.test(p.userId)) {
745
+ errors.push(`${pat}.userId \u304C\u30DD\u30FC\u30BF\u30EB\u306E\u4EBA\u306E ID\uFF08\u5927\u6587\u5B57\u306E 26 \u5B57\uFF09\u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ${JSON.stringify(p.userId)}`);
746
+ }
747
+ }
725
748
  }
726
749
  function checkMeet(conn, at, errors, ctx) {
727
750
  if ("calendarOwner" in conn && !CALENDAR_OWNERS.includes(conn.calendarOwner)) {
@@ -1015,6 +1038,7 @@ var INTENT_TABLE = Object.freeze({
1015
1038
  resume: { req: [], opt: [], expectsRow: false }
1016
1039
  }
1017
1040
  });
1041
+ var SOURCE_NOT_CHECKED = Object.freeze(["closed", "owner", "deadline", "fixed-ip", "wait", "limited", "not-reached", "unknown", "config", "error"]);
1018
1042
 
1019
1043
  // ../infra/lambda/shared/config-v2-view.mjs
1020
1044
  var SOURCES_CONFIG_PATH = memoryPathIn(LEGACY_DIR, import_memory_root.MEMORY_CONFIG_FILES.sources);
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // ../infra/lambda/shared/connection-words.mjs
21
+ var connection_words_exports = {};
22
+ __export(connection_words_exports, {
23
+ CONNECTION_WORDS: () => CONNECTION_WORDS,
24
+ WORD_ACTS: () => WORD_ACTS,
25
+ WORD_FIXERS: () => WORD_FIXERS,
26
+ WORD_PLACES: () => WORD_PLACES,
27
+ WORD_TOOL_NOUNS: () => WORD_TOOL_NOUNS,
28
+ connectionWordLines: () => connectionWordLines
29
+ });
30
+ module.exports = __toCommonJS(connection_words_exports);
31
+ var WORD_ACTS = Object.freeze(["check", "key", "owner", "connect", "remove"]);
32
+ var WORD_PLACES = Object.freeze(["row", "add"]);
33
+ var WORD_FIXERS = Object.freeze(["user", "cortex", "wait"]);
34
+ var step = (act, text, needs = []) => Object.freeze({ act, text, needs: Object.freeze(needs) });
35
+ var word = (w) => Object.freeze({ ...w, where: Object.freeze(w.where), steps: Object.freeze(w.steps) });
36
+ var CONNECTION_WORDS = Object.freeze({
37
+ key_missing: word({
38
+ where: ["row"],
39
+ fixer: "user",
40
+ transient: false,
41
+ why: "{key}\u304C\u307E\u3060\u5165\u3063\u3066\u3044\u307E\u305B\u3093\u3002",
42
+ steps: [step("key", "\u300C{key}\u3092\u5909\u66F4\u3059\u308B\u300D\u3067\u5165\u308C\u3066\u304F\u3060\u3055\u3044\u3002")],
43
+ who: null
44
+ }),
45
+ key_rejected: word({
46
+ where: ["row"],
47
+ fixer: "user",
48
+ transient: false,
49
+ why: "\u5165\u308C\u3066\u3042\u308B{key}\u304C\u3001{tool}\u3067\u4F7F\u3048\u306A\u304F\u306A\u3063\u3066\u3044\u307E\u3059\uFF08\u671F\u9650\u5207\u308C\u30FB\u53D6\u308A\u6D88\u3057\uFF09\u3002",
50
+ steps: [
51
+ step("key", "\u65B0\u3057\u3044{key}\u3092\u767A\u884C\u3057\u3066\u3001\u300C{key}\u3092\u5909\u66F4\u3059\u308B\u300D\u3067\u5165\u308C\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["key"]),
52
+ step("connect", "\u300C{connect}\u300D\u3067\u3064\u306A\u304E\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["connect"])
53
+ ],
54
+ who: null
55
+ }),
56
+ unclear_access: word({
57
+ where: ["row", "add"],
58
+ fixer: "user",
59
+ transient: false,
60
+ why: "{tool}\u304C\u8AAD\u307E\u305B\u3066\u304F\u308C\u307E\u305B\u3093\u3002{tool}\u306E\u7B54\u3048\u304B\u3089\u306F\u3001\u8A33\u3092\u898B\u5206\u3051\u3089\u308C\u307E\u305B\u3093\u3002",
61
+ steps: [
62
+ step("connect", "{partner}\u304C Cortex \u306B\u3064\u306A\u304C\u3063\u3066\u3044\u306A\u3051\u308C\u3070\u3001\u300C{connect}\u300D\u3067\u3064\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002", ["connect"]),
63
+ step("key", "{key}\u3092\u5165\u308C\u3066\u304B\u3089\u65E5\u304C\u7D4C\u3063\u3066\u3044\u308C\u3070\u3001\u300C{key}\u3092\u5909\u66F4\u3059\u308B\u300D\u3067\u5165\u308C\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["key"]),
64
+ step(null, "{place}\u306B Cortex \u3092{join}\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["join"]),
65
+ step("check", "\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"])
66
+ ],
67
+ who: null
68
+ }),
69
+ permission_missing: word({
70
+ where: ["row"],
71
+ fixer: "user",
72
+ transient: false,
73
+ why: "{tool}\u304C\u3001\u3053\u306E{place}\u3092\u8AAD\u3080\u6A29\u9650\u304C\u8DB3\u308A\u306A\u3044\u3068\u7B54\u3048\u307E\u3057\u305F\u3002",
74
+ steps: [step("check", "\u6A29\u9650\u3092\u8DB3\u3057\u305F\u5F8C\u306B\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
75
+ who: "\u6A29\u9650\u3092\u8DB3\u305B\u308B\u306E\u306F\u3001{tool}\u306E{partner}\u306E\u7BA1\u7406\u8005\u3067\u3059\u3002"
76
+ }),
77
+ not_member: word({
78
+ where: ["row"],
79
+ fixer: "user",
80
+ transient: false,
81
+ why: "Cortex \u304C\u3053\u306E{place}\u306B\u5165\u3063\u3066\u3044\u307E\u305B\u3093\u3002",
82
+ steps: [step("check", "{place}\u306B Cortex \u3092{join}\u3057\u3066\u304B\u3089\u3001\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
83
+ who: null
84
+ }),
85
+ not_connected: word({
86
+ where: ["row", "add"],
87
+ fixer: "user",
88
+ transient: false,
89
+ why: "{tool}\u306E{partner}\u304C\u3001\u307E\u3060 Cortex \u306B\u3064\u306A\u304C\u3063\u3066\u3044\u307E\u305B\u3093\u3002",
90
+ steps: [step("connect", "\u300C{connect}\u300D\u3067\u3064\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002", ["connect"])],
91
+ who: "\u3064\u306A\u3052\u308B\u306E\u306F\u3001\u305D\u306E{partner}\u306E\u7BA1\u7406\u8005\u3067\u3059\u3002"
92
+ }),
93
+ not_found: word({
94
+ where: ["row"],
95
+ fixer: "user",
96
+ transient: false,
97
+ why: "\u3053\u306E{place}\u304C{tool}\u3067\u898B\u3064\u304B\u308A\u307E\u305B\u3093\uFF08\u6D88\u3055\u308C\u305F\u30FB\u79FB\u3055\u308C\u305F\u30FBURL \u304C\u9055\u3046\uFF09\u3002",
98
+ steps: [
99
+ step("check", "{tool}\u3067\u3053\u306E{place}\u304C\u3042\u308B\u304B\u3092\u78BA\u304B\u3081\u3066\u3001\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"]),
100
+ step("remove", "\u7121\u3051\u308C\u3070\u300C\u3053\u306E\u63A5\u7D9A\u5148\u3092\u5916\u3059\u300D\u3067\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"])
101
+ ],
102
+ who: null
103
+ }),
104
+ approval_pending: word({
105
+ where: ["row"],
106
+ fixer: "user",
107
+ transient: false,
108
+ why: "{tool}\u306E\u7BA1\u7406\u8005\u306E\u627F\u8A8D\u3092\u5F85\u3063\u3066\u3044\u307E\u3059\u3002",
109
+ steps: [step("check", "\u627F\u8A8D\u306E\u5F8C\u306B\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
110
+ who: "\u627F\u8A8D\u3067\u304D\u308B\u306E\u306F\u3001{partner}\u306E\u7BA1\u7406\u8005\u3067\u3059\u3002"
111
+ }),
112
+ not_allowed: word({
113
+ where: ["row"],
114
+ fixer: "cortex",
115
+ transient: false,
116
+ why: "\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u306F\u3001\u3053\u306E{place}\u3092\u8AAD\u3080\u8A31\u53EF\u304C\u3042\u308A\u307E\u305B\u3093\u3002",
117
+ steps: [],
118
+ who: null
119
+ }),
120
+ wrong_owner: word({
121
+ where: ["row"],
122
+ fixer: "user",
123
+ transient: false,
124
+ why: "\u3053\u306E{place}\u306F\u3001\u3042\u306A\u305F\u306E\u7D44\u7E54\u306E\u7269\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002",
125
+ steps: [step("remove", "\u300C\u3053\u306E\u63A5\u7D9A\u5148\u3092\u5916\u3059\u300D\u3067\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"])],
126
+ who: null
127
+ }),
128
+ owner_unconfirmed: word({
129
+ where: ["row"],
130
+ fixer: "user",
131
+ transient: false,
132
+ why: "\u3053\u306E{place}\u304C\u3042\u306A\u305F\u306E\u7D44\u7E54\u306E\u7269\u304B\u3092\u3001\u307E\u3060\u78BA\u304B\u3081\u3066\u3044\u307E\u305B\u3093\u3002\u78BA\u304B\u3081\u308B\u307E\u3067\u8AAD\u307F\u307E\u305B\u3093\u3002",
133
+ steps: [step("owner", "\u300C{confirm}\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
134
+ who: "\u78BA\u304B\u3081\u3089\u308C\u308B\u306E\u306F\u3001\u3053\u306E{place}\u3092\u958B\u3051\u308B Google \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4EBA\u3067\u3059\u3002"
135
+ }),
136
+ busy: word({
137
+ where: ["row"],
138
+ fixer: "wait",
139
+ transient: true,
140
+ why: "{tool}\u304C\u6DF7\u3093\u3067\u3044\u3066\u3001\u78BA\u304B\u3081\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
141
+ steps: [step("check", "\u3057\u3070\u3089\u304F\u3057\u3066\u81EA\u52D5\u3067\u78BA\u304B\u3081\u76F4\u3057\u307E\u3059\uFF08\u4ECA\u3059\u3050\u306A\u3089\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\uFF09\u3002")],
142
+ who: null
143
+ }),
144
+ rate_locked: word({
145
+ where: ["row"],
146
+ fixer: "user",
147
+ transient: false,
148
+ why: "{tool}\u306E\u5229\u7528\u67A0\u3092\u4F7F\u3044\u5207\u3063\u3066\u3044\u307E\u3059\u3002{until}",
149
+ steps: [
150
+ step(null, "{tool}\u306E\u30D7\u30E9\u30F3\u3084\u3001{key}\u306E\u6301\u3061\u4E3B\u306E\u5E2D\u3092\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002", ["key"]),
151
+ step(null, "{tool}\u306E\u30D7\u30E9\u30F3\u3092\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002", ["nokey"])
152
+ ],
153
+ who: "\u30D7\u30E9\u30F3\u3084\u5E2D\u3092\u898B\u76F4\u305B\u308B\u306E\u306F\u3001{tool}\u306E{partner}\u306E\u7BA1\u7406\u8005\u3067\u3059\u3002"
154
+ }),
155
+ notes_not_received: word({
156
+ where: ["row"],
157
+ fixer: "wait",
158
+ transient: true,
159
+ why: "\u7D42\u308F\u3063\u305F\u4F1A\u8B70\u306E\u30E1\u30E2\u304C\u3001Cortex \u306B\u5C4A\u3044\u3066\u3044\u307E\u305B\u3093\u3002",
160
+ steps: [step(null, "\u4F1A\u8B70\u306E\u30E1\u30E2\u3092 ON \u306B\u3057\u3001\u30E1\u30E2\u306E\u9001\u308A\u5148\u3092\u300C\u62DB\u5F85\u3057\u305F\u4EBA\u5168\u54E1\uFF08\u7D44\u7E54\u306E\u5916\u3082\u542B\u3080\uFF09\u300D\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u6B21\u306E\u4F1A\u8B70\u306E\u30E1\u30E2\u304C\u5C4A\u304F\u3068\u3001\u81EA\u52D5\u3067\u300C\u63A5\u7D9AOK\u300D\u306B\u623B\u308A\u307E\u3059\u3002")],
161
+ who: "\u8A2D\u5B9A\u3067\u304D\u308B\u306E\u306F\u3001\u4F1A\u8B70\u306E\u4E3B\u50AC\u8005\u3067\u3059\u3002"
162
+ }),
163
+ config_busy: word({
164
+ where: ["add"],
165
+ fixer: "wait",
166
+ transient: true,
167
+ why: "\u8A2D\u5B9A\u3092\u66F8\u3044\u3066\u3044\u308B\u6700\u4E2D\uFF08\u8A18\u61B6\u306E\u66F4\u65B0\u306E\u6700\u4E2D\u306A\u3069\uFF09\u3067\u3001\u4ECA\u306F\u8DB3\u305B\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
168
+ steps: [step(null, "\u3057\u3070\u3089\u304F\u3057\u3066\u300C\u8FFD\u52A0\u300D\u3092\u3082\u3046\u4E00\u5EA6\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
169
+ who: null
170
+ }),
171
+ input_invalid: word({
172
+ where: ["add"],
173
+ fixer: "user",
174
+ transient: false,
175
+ why: "\u8CBC\u3089\u308C\u305F\u7269\u3092\u3001{tool}\u306E{place}\u3068\u3057\u3066\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093\u3002",
176
+ steps: [step(null, "\u6B63\u3057\u3044\u5F62\u3067\u8CBC\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
177
+ who: null
178
+ }),
179
+ paused: word({
180
+ where: ["add"],
181
+ fixer: "user",
182
+ transient: false,
183
+ why: "\u3053\u306E\u7A2E\u985E\u306E\u53D6\u308A\u8FBC\u307F\u306F\u6B62\u3081\u3066\u3042\u308A\u307E\u3059\u3002",
184
+ steps: [step(null, "\u518D\u958B\u3057\u3066\u304B\u3089\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
185
+ who: null
186
+ }),
187
+ unreadable: word({
188
+ where: ["row", "add"],
189
+ fixer: "cortex",
190
+ transient: false,
191
+ why: "{tool}\u306E\u7B54\u3048\u3092\u3001Cortex \u304C\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
192
+ steps: [
193
+ step("check", "\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"]),
194
+ step("key", "{key}\u3092\u5165\u308C\u3066\u304B\u3089\u65E5\u304C\u7D4C\u3063\u3066\u3044\u308C\u3070\u3001\u300C{key}\u3092\u5909\u66F4\u3059\u308B\u300D\u3067\u5165\u308C\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["key"])
195
+ ],
196
+ who: null
197
+ })
198
+ });
199
+ var WORD_TOOL_NOUNS = Object.freeze({
200
+ backlog: Object.freeze({ partner: "\u30B9\u30DA\u30FC\u30B9", confirm: null, connect: null }),
201
+ github: Object.freeze({ partner: "\u7D44\u7E54", confirm: null, connect: "App \u3092\u5165\u308C\u308B" }),
202
+ slack: Object.freeze({ partner: "\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9", confirm: null, connect: "\u63A5\u7D9A\u3059\u308B" }),
203
+ "google-chat": Object.freeze({ partner: "Google Workspace", confirm: "Google \u3067\u78BA\u8A8D\u3059\u308B", connect: null }),
204
+ figma: Object.freeze({ partner: "\u30C1\u30FC\u30E0", confirm: null, connect: null }),
205
+ "google-drive": Object.freeze({ partner: "Google Workspace", confirm: "Google \u3067\u78BA\u8A8D\u3059\u308B", connect: null }),
206
+ "google-meet": Object.freeze({ partner: "Google Workspace", confirm: null, connect: null })
207
+ });
208
+ function connectionWordLines(w, nouns, o) {
209
+ const opt = o || {};
210
+ const code = Object.prototype.hasOwnProperty.call(CONNECTION_WORDS, w) ? w : "unreadable";
211
+ const d = CONNECTION_WORDS[code];
212
+ const n = nouns || {};
213
+ const toolName = String(n.toolName || "");
214
+ const tool = /[A-Za-z0-9]$/.test(toolName) ? toolName + " " : toolName;
215
+ const partnerRaw = n.partner ? String(n.partner) : "";
216
+ const partner = /[A-Za-z0-9]$/.test(partnerRaw) ? partnerRaw + " " : partnerRaw;
217
+ const has = { key: !!n.keyName, nokey: !n.keyName, join: !!n.joinWord, connect: !!n.connect, row: opt.place !== "add" };
218
+ const fill = (x) => String(x).split("{tool}").join(tool).split("{place}").join(String(n.placeName || "\u63A5\u7D9A\u5148")).split("{join}").join(String(n.joinWord || "\u8FFD\u52A0")).split("{key}").join(String(n.keyName || "\u9375")).split("{partner}").join(partner || "\u7BA1\u7406\u5143").split("{confirm}").join(String(n.confirm || "\u78BA\u8A8D\u3059\u308B")).split("{connect}").join(String(n.connect || "\u63A5\u7D9A\u3059\u308B")).split("{until}").join(String(opt.until || "")).replace(/ (?=[、。」)])/g, "").replace(/「[^」]*」|([ぁ-んァ-ヶー一-龯々])(?=[A-Za-z])/g, (m, c) => c ? c + " " : m).trim();
219
+ const steps = d.steps.filter((s) => s.needs.every((k) => has[k])).map((s) => ({ act: s.act, text: fill(s.text) }));
220
+ return { word: code, why: fill(d.why), steps, who: d.who ? fill(d.who) : "", fixer: d.fixer, transient: d.transient };
221
+ }
222
+ // Annotate the CommonJS export names for ESM import in node:
223
+ 0 && (module.exports = {
224
+ CONNECTION_WORDS,
225
+ WORD_ACTS,
226
+ WORD_FIXERS,
227
+ WORD_PLACES,
228
+ WORD_TOOL_NOUNS,
229
+ connectionWordLines
230
+ });