@takagaki/cortex-decisions-viewer 0.12.278 → 0.12.283
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine/config-view.js +20 -4
- package/dist/engine/source-state-view.js +205 -9
- package/dist/engine/source-state.js +43 -0
- package/dist/forward-reads.js +1 -1
- package/dist/intake-scope.js +2 -1
- package/dist/member-page.js +11 -2
- package/dist/project-icon-edit.js +100 -0
- package/dist/render.js +197 -31
- package/dist/source-rows.js +71 -22
- package/package.json +1 -1
|
@@ -257,15 +257,27 @@ var R = Object.freeze({
|
|
|
257
257
|
wrongOwner: "wrong_owner",
|
|
258
258
|
ownerUnconfirmed: "owner_unconfirmed",
|
|
259
259
|
busy: "busy",
|
|
260
|
+
rateLocked: "rate_locked",
|
|
260
261
|
notesNotReceived: "notes_not_received",
|
|
261
262
|
unreadable: "unreadable"
|
|
262
263
|
});
|
|
263
264
|
var answers = (a) => Object.freeze({
|
|
264
265
|
broker: Object.freeze({ ...a.broker || {} }),
|
|
265
|
-
|
|
266
|
+
// 取り込みの理由の語のうち HTTP の状態を言い直した語(`ingest/plan.mjs`・台の便りの `reason`)は、その道具の状態の数の行と同じ符号に写す
|
|
267
|
+
// (R0 の回の終わりの振り分けも画面と同じ `judgeAnswer` 1 本を通す・#3018 設計レビュー 6947654750。道具ごとの違い〈Drive の 403=共有されていない〉は数の行が持つ)。
|
|
268
|
+
// 道具が自分の語で同じ綴りを持てば、そちらが勝つ。
|
|
269
|
+
// `rate_locked`(相手が言う戻る時刻が待ちの線より先の枠切れ・#3047)は、どの道具でも同じ綴りの符号 `rate_locked`(① 利用者が直す・専用の文。
|
|
270
|
+
// `permission_missing` の「権限が足りない」の文にしない=権限は足りている・#3052 リーダーの決め 6968542988 の 1。道具の名前で分けない)
|
|
271
|
+
error: Object.freeze({ ...ingestWordsOf(a.status || {}), rate_locked: R.rateLocked, ...a.error || {} }),
|
|
266
272
|
reason: Object.freeze({ ...a.reason || {} }),
|
|
267
273
|
status: Object.freeze({ ...a.status || {} })
|
|
268
274
|
});
|
|
275
|
+
var INGEST_STATUS_WORDS = Object.freeze({ unauthorized: "401", forbidden: "403", not_found: "404", rate_limited: "429" });
|
|
276
|
+
function ingestWordsOf(status) {
|
|
277
|
+
const out = {};
|
|
278
|
+
for (const [word, st] of Object.entries(INGEST_STATUS_WORDS)) if (Object.hasOwn(status, st)) out[word] = status[st];
|
|
279
|
+
return out;
|
|
280
|
+
}
|
|
269
281
|
var REASON_CODES = Object.freeze(Object.values(R));
|
|
270
282
|
var BROKER_DENIALS = Object.freeze({
|
|
271
283
|
repo_unknown: R.notAllowed,
|
|
@@ -374,7 +386,8 @@ var TOOL_CATALOG = Object.freeze({
|
|
|
374
386
|
placeName: "\u30B9\u30DA\u30FC\u30B9",
|
|
375
387
|
joinWord: "\u8FFD\u52A0",
|
|
376
388
|
answers: {
|
|
377
|
-
|
|
389
|
+
// `not_in_space`・`admin_approval_pending` は台の取り込みの理由の語(404・403 と同じ意味・#3018)
|
|
390
|
+
error: { other_customer: R.wrongOwner, unconfirmed: R.ownerUnconfirmed, token_exchange_failed: R.keyRejected, not_in_space: R.notMember, admin_approval_pending: R.approvalPending },
|
|
378
391
|
// 403 は顧客の Workspace 管理者の承認待ち(#521)・404 は Cortex のアプリがそのスペースに入っていない
|
|
379
392
|
status: { 401: R.keyRejected, 403: R.approvalPending, 404: R.notMember, 429: R.busy, "5xx": R.busy, 0: R.busy }
|
|
380
393
|
}
|
|
@@ -928,7 +941,10 @@ var SOURCE_KINDS = ["slack", "google-chat", "github", "figma", "drive", "backlog
|
|
|
928
941
|
var INTENT_KINDS = [...SOURCE_KINDS, "notify", "memory"];
|
|
929
942
|
var PERSON_SUB_RE = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
930
943
|
var MEMORY_STATES = Object.freeze(["unstarted", "on", "paused"]);
|
|
931
|
-
var
|
|
944
|
+
var MEMORY_DAYS = Object.freeze({ min: 1, max: 730 });
|
|
945
|
+
var MEMORY_SCREEN_DAYS = Object.freeze([7, 30]);
|
|
946
|
+
var MEMORY_WRITERS = Object.freeze({ project: "screenChoices", operator: "min..max" });
|
|
947
|
+
var isMemoryDays = (d) => Number.isInteger(d) && d >= MEMORY_DAYS.min && d <= MEMORY_DAYS.max;
|
|
932
948
|
var MEMORY_PAUSED_BY = Object.freeze(["operator", "project"]);
|
|
933
949
|
var MEMORY_KEYS = Object.freeze(["state", "days", "startedAt", "legacy", "pausedAt", "pausedBy", "by"]);
|
|
934
950
|
var isZonedIso = (v) => typeof v === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/.test(v) && !Number.isNaN(Date.parse(v));
|
|
@@ -937,7 +953,7 @@ function validateOnboardingMemory(m, where = "onboarding.memory") {
|
|
|
937
953
|
const errs = Object.keys(m).filter((k) => !MEMORY_KEYS.includes(k)).map((k) => `${where} \u306B\u77E5\u3089\u306A\u3044\u6B04\u304C\u3042\u308A\u307E\u3059: ${k}`);
|
|
938
954
|
const has = (k) => Object.hasOwn(m, k);
|
|
939
955
|
if (!MEMORY_STATES.includes(m.state)) errs.push(`${where}.state \u306F ${MEMORY_STATES.join(" / ")} \u306E\u3069\u308C\u304B\u3067\u3059`);
|
|
940
|
-
if (has("days") && !
|
|
956
|
+
if (has("days") && !isMemoryDays(m.days)) errs.push(`${where}.days \u306F ${MEMORY_DAYS.min}\u301C${MEMORY_DAYS.max} \u306E\u6574\u6570\u3067\u3059`);
|
|
941
957
|
if (has("startedAt") && !isZonedIso(m.startedAt)) errs.push(`${where}.startedAt \u306F\u6642\u5DEE\u3064\u304D\u306E ISO \u306E\u65E5\u6642\u3067\u3059`);
|
|
942
958
|
if (has("legacy") && m.legacy !== true) errs.push(`${where}.legacy \u306F true \u3060\u3051\u3067\u3059`);
|
|
943
959
|
if (has("pausedAt") && !isZonedIso(m.pausedAt)) errs.push(`${where}.pausedAt \u306F\u6642\u5DEE\u3064\u304D\u306E ISO \u306E\u65E5\u6642\u3067\u3059`);
|
|
@@ -114,7 +114,10 @@ __export(source_state_view_exports, {
|
|
|
114
114
|
SOURCES_UNAVAILABLE_REASONS: () => SOURCES_UNAVAILABLE_REASONS,
|
|
115
115
|
SOURCES_VIEW_VERSION: () => SOURCES_VIEW_VERSION,
|
|
116
116
|
buildSourcesView: () => buildSourcesView,
|
|
117
|
+
fixerOf: () => fixerOf,
|
|
117
118
|
sourcesUnavailable: () => sourcesUnavailable,
|
|
119
|
+
toolOfRowKind: () => toolOfRowKind,
|
|
120
|
+
userKeyOf: () => userKeyOf,
|
|
118
121
|
validateSourcesView: () => validateSourcesView
|
|
119
122
|
});
|
|
120
123
|
module.exports = __toCommonJS(source_state_view_exports);
|
|
@@ -246,15 +249,27 @@ var R = Object.freeze({
|
|
|
246
249
|
wrongOwner: "wrong_owner",
|
|
247
250
|
ownerUnconfirmed: "owner_unconfirmed",
|
|
248
251
|
busy: "busy",
|
|
252
|
+
rateLocked: "rate_locked",
|
|
249
253
|
notesNotReceived: "notes_not_received",
|
|
250
254
|
unreadable: "unreadable"
|
|
251
255
|
});
|
|
252
256
|
var answers = (a) => Object.freeze({
|
|
253
257
|
broker: Object.freeze({ ...a.broker || {} }),
|
|
254
|
-
|
|
258
|
+
// 取り込みの理由の語のうち HTTP の状態を言い直した語(`ingest/plan.mjs`・台の便りの `reason`)は、その道具の状態の数の行と同じ符号に写す
|
|
259
|
+
// (R0 の回の終わりの振り分けも画面と同じ `judgeAnswer` 1 本を通す・#3018 設計レビュー 6947654750。道具ごとの違い〈Drive の 403=共有されていない〉は数の行が持つ)。
|
|
260
|
+
// 道具が自分の語で同じ綴りを持てば、そちらが勝つ。
|
|
261
|
+
// `rate_locked`(相手が言う戻る時刻が待ちの線より先の枠切れ・#3047)は、どの道具でも同じ綴りの符号 `rate_locked`(① 利用者が直す・専用の文。
|
|
262
|
+
// `permission_missing` の「権限が足りない」の文にしない=権限は足りている・#3052 リーダーの決め 6968542988 の 1。道具の名前で分けない)
|
|
263
|
+
error: Object.freeze({ ...ingestWordsOf(a.status || {}), rate_locked: R.rateLocked, ...a.error || {} }),
|
|
255
264
|
reason: Object.freeze({ ...a.reason || {} }),
|
|
256
265
|
status: Object.freeze({ ...a.status || {} })
|
|
257
266
|
});
|
|
267
|
+
var INGEST_STATUS_WORDS = Object.freeze({ unauthorized: "401", forbidden: "403", not_found: "404", rate_limited: "429" });
|
|
268
|
+
function ingestWordsOf(status) {
|
|
269
|
+
const out = {};
|
|
270
|
+
for (const [word, st] of Object.entries(INGEST_STATUS_WORDS)) if (Object.hasOwn(status, st)) out[word] = status[st];
|
|
271
|
+
return out;
|
|
272
|
+
}
|
|
258
273
|
var REASON_CODES = Object.freeze(Object.values(R));
|
|
259
274
|
var BROKER_DENIALS = Object.freeze({
|
|
260
275
|
repo_unknown: R.notAllowed,
|
|
@@ -363,7 +378,8 @@ var TOOL_CATALOG = Object.freeze({
|
|
|
363
378
|
placeName: "\u30B9\u30DA\u30FC\u30B9",
|
|
364
379
|
joinWord: "\u8FFD\u52A0",
|
|
365
380
|
answers: {
|
|
366
|
-
|
|
381
|
+
// `not_in_space`・`admin_approval_pending` は台の取り込みの理由の語(404・403 と同じ意味・#3018)
|
|
382
|
+
error: { other_customer: R.wrongOwner, unconfirmed: R.ownerUnconfirmed, token_exchange_failed: R.keyRejected, not_in_space: R.notMember, admin_approval_pending: R.approvalPending },
|
|
367
383
|
// 403 は顧客の Workspace 管理者の承認待ち(#521)・404 は Cortex のアプリがそのスペースに入っていない
|
|
368
384
|
status: { 401: R.keyRejected, 403: R.approvalPending, 404: R.notMember, 429: R.busy, "5xx": R.busy, 0: R.busy }
|
|
369
385
|
}
|
|
@@ -450,17 +466,27 @@ var LISTED_TOOL_STORE_KEYS = Object.freeze(Object.fromEntries(LISTED_TOOLS.map((
|
|
|
450
466
|
])));
|
|
451
467
|
var OBS_POLICY_BY_CAP = Object.freeze(Object.fromEntries(STATE_CAP_TABLE.map((r) => [r.cap, r.observe])));
|
|
452
468
|
var REGISTRY_BY_CAP = Object.freeze(Object.fromEntries(STATE_CAP_TABLE.filter((r) => r.registry).map((r) => [r.cap, r.registry])));
|
|
469
|
+
function toolOfStateCap(cap) {
|
|
470
|
+
const row = STATE_CAP_TABLE.find((r) => r.cap === cap);
|
|
471
|
+
return row ? row.tool : null;
|
|
472
|
+
}
|
|
453
473
|
var CHAT_SOURCE_CAP_OF = chatSourceCapOf(TOOL_CATALOG);
|
|
454
474
|
function chatSourceCapOf(catalog) {
|
|
455
475
|
return Object.freeze(Object.fromEntries(Object.keys(catalog).filter((t) => catalog[t].capabilities.includes("\u30C1\u30E3\u30C3\u30C8") && catalog[t].sourceType && catalog[t].sourceType.exact).map((t) => [catalog[t].sourceType.exact, catalog[t].stateCaps[0]])));
|
|
456
476
|
}
|
|
457
477
|
var CHAT_ROW_CAPS = Object.freeze(Object.values(CHAT_SOURCE_CAP_OF));
|
|
458
478
|
var CHAT_READERS = Object.freeze(["slack", "google-chat"]);
|
|
479
|
+
var isKnownTool = (tool) => Object.prototype.hasOwnProperty.call(TOOL_CATALOG, String(tool ?? ""));
|
|
480
|
+
function entryOf(tool) {
|
|
481
|
+
if (!isKnownTool(tool)) throw new Error(`tool-catalog: \u8868\u306B\u7121\u3044\u30C4\u30FC\u30EB\u3067\u3059: ${JSON.stringify(tool)}`);
|
|
482
|
+
return TOOL_CATALOG[tool];
|
|
483
|
+
}
|
|
459
484
|
function toolsForCapability(cap) {
|
|
460
485
|
if (!CAPABILITIES.includes(cap)) throw new Error(`tool-catalog: \u80FD\u529B\u306E\u8A9E\u5F59\u306B\u7121\u3044: ${JSON.stringify(cap)}`);
|
|
461
486
|
return TOOLS.filter((t) => TOOL_CATALOG[t].capabilities.includes(cap));
|
|
462
487
|
}
|
|
463
488
|
var CAPABILITY_ADAPTERS = Object.freeze(CAPABILITIES.map((cap) => Object.freeze({ cap, adapter: toolsForCapability(cap)[0] })));
|
|
489
|
+
var stateNounsOf = (tool) => entryOf(tool).state;
|
|
464
490
|
|
|
465
491
|
// ../infra/lambda/shared/config-shape.mjs
|
|
466
492
|
var MEETING_CALENDAR_FIELDS = Object.freeze(["calendarId", "calendarName"]);
|
|
@@ -776,7 +802,9 @@ function memoryPathIn(dir, ...parts) {
|
|
|
776
802
|
var SOURCE_KINDS = ["slack", "google-chat", "github", "figma", "drive", "backlog"];
|
|
777
803
|
var INTENT_KINDS = [...SOURCE_KINDS, "notify", "memory"];
|
|
778
804
|
var MEMORY_STATES = Object.freeze(["unstarted", "on", "paused"]);
|
|
779
|
-
var
|
|
805
|
+
var MEMORY_DAYS = Object.freeze({ min: 1, max: 730 });
|
|
806
|
+
var MEMORY_SCREEN_DAYS = Object.freeze([7, 30]);
|
|
807
|
+
var MEMORY_WRITERS = Object.freeze({ project: "screenChoices", operator: "min..max" });
|
|
780
808
|
var MEMORY_PAUSED_BY = Object.freeze(["operator", "project"]);
|
|
781
809
|
var MEMORY_KEYS = Object.freeze(["state", "days", "startedAt", "legacy", "pausedAt", "pausedBy", "by"]);
|
|
782
810
|
var REF = { req: ["ref"], opt: [] };
|
|
@@ -1674,6 +1702,26 @@ function sourceCheckOf(id, adapters = ADAPTERS) {
|
|
|
1674
1702
|
return a && isObj3(a.sourceCheck) ? a.sourceCheck : null;
|
|
1675
1703
|
}
|
|
1676
1704
|
|
|
1705
|
+
// ../infra/lambda/shared/source-state.mjs
|
|
1706
|
+
var source_state_exports = {};
|
|
1707
|
+
__export(source_state_exports, {
|
|
1708
|
+
SOURCE_FIXERS: () => SOURCE_FIXERS,
|
|
1709
|
+
SOURCE_REASONS: () => SOURCE_REASONS,
|
|
1710
|
+
SOURCE_REASONS_RETRY: () => SOURCE_REASONS_RETRY,
|
|
1711
|
+
SOURCE_REASON_FIXER: () => SOURCE_REASON_FIXER,
|
|
1712
|
+
SOURCE_STATE_PK_PREFIX: () => SOURCE_STATE_PK_PREFIX,
|
|
1713
|
+
SOURCE_STATE_SK_PREFIX: () => SOURCE_STATE_SK_PREFIX,
|
|
1714
|
+
SOURCE_STATE_WORKSPACE_CAPS: () => SOURCE_STATE_WORKSPACE_CAPS,
|
|
1715
|
+
SOURCE_STATUSES: () => SOURCE_STATUSES,
|
|
1716
|
+
SOURCE_WAIT_LINE_MS: () => SOURCE_WAIT_LINE_MS,
|
|
1717
|
+
sourceFixerOf: () => sourceFixerOf,
|
|
1718
|
+
sourceStateKey: () => sourceStateKey,
|
|
1719
|
+
sourceStatePk: () => sourceStatePk,
|
|
1720
|
+
sourceStateSk: () => sourceStateSk,
|
|
1721
|
+
sourceStateWrites: () => sourceStateWrites,
|
|
1722
|
+
validateSourceStateWrite: () => validateSourceStateWrite
|
|
1723
|
+
});
|
|
1724
|
+
|
|
1677
1725
|
// ../infra/lambda/shared/connection-state-keys.mjs
|
|
1678
1726
|
var STATE_CAPS = [
|
|
1679
1727
|
"chat",
|
|
@@ -1719,6 +1767,10 @@ function normalizeStateRef(cap, ref) {
|
|
|
1719
1767
|
}
|
|
1720
1768
|
return s;
|
|
1721
1769
|
}
|
|
1770
|
+
function normalizeAt(at) {
|
|
1771
|
+
const d = at === null || at === void 0 || at === "" ? /* @__PURE__ */ new Date() : new Date(at);
|
|
1772
|
+
return Number.isNaN(d.getTime()) ? null : d.toISOString();
|
|
1773
|
+
}
|
|
1722
1774
|
var DETAIL_MAX = 200;
|
|
1723
1775
|
function sanitizeDetail(s) {
|
|
1724
1776
|
if (s == null) return "";
|
|
@@ -1756,11 +1808,44 @@ var SOURCE_REASONS = Object.freeze([
|
|
|
1756
1808
|
// その場がこの組織の物かを、人がまだ確かめていない
|
|
1757
1809
|
"busy",
|
|
1758
1810
|
// 相手のツールの混雑・一時の障害
|
|
1811
|
+
// 相手のツールの利用枠を使い切っていて、相手が言う戻る時刻が待ちの線(`SOURCE_WAIT_LINE_MS`)より先(#3047・#3052 リーダーの決め 6968542988 の 1)。
|
|
1812
|
+
// `permission_missing` の文(権限が足りない)で出すと逆の直し方を案内する(権限は足りている)ので、専用の符号と文にする。戻る時刻は分かる時だけ `detail` の `until=`
|
|
1813
|
+
"rate_locked",
|
|
1759
1814
|
"notes_not_received",
|
|
1760
1815
|
// 会議: 終わった会議のメモが届いていない(`not_member` に寄せると次にすることを間違える)
|
|
1761
1816
|
"unreadable"
|
|
1762
1817
|
// 上のどれでもない答え
|
|
1763
1818
|
]);
|
|
1819
|
+
var SOURCE_REASON_FIXER = Object.freeze({
|
|
1820
|
+
key_missing: "user",
|
|
1821
|
+
key_rejected: "user",
|
|
1822
|
+
permission_missing: "user",
|
|
1823
|
+
not_member: "user",
|
|
1824
|
+
not_found: "user",
|
|
1825
|
+
approval_pending: "user",
|
|
1826
|
+
not_allowed: "cortex",
|
|
1827
|
+
wrong_owner: "user",
|
|
1828
|
+
owner_unconfirmed: "user",
|
|
1829
|
+
busy: "wait",
|
|
1830
|
+
rate_locked: "user",
|
|
1831
|
+
notes_not_received: "wait",
|
|
1832
|
+
unreadable: "cortex"
|
|
1833
|
+
});
|
|
1834
|
+
var SOURCE_FIXERS = Object.freeze(["user", "cortex", "wait"]);
|
|
1835
|
+
var SOURCE_REASONS_RETRY = Object.freeze(Object.keys(SOURCE_REASON_FIXER).filter((r) => SOURCE_REASON_FIXER[r] === "wait"));
|
|
1836
|
+
var SOURCE_WAIT_LINE_MS = 30 * 60 * 1e3;
|
|
1837
|
+
var NIGHT_MS = 24 * 3600 * 1e3;
|
|
1838
|
+
function sourceFixerOf(code, { userKey = true, stalled = false, checkedAt = null, ingestedAt = null } = {}) {
|
|
1839
|
+
const f = Object.hasOwn(SOURCE_REASON_FIXER, code) ? SOURCE_REASON_FIXER[code] : "cortex";
|
|
1840
|
+
if (code === "key_missing" && userKey === false) return "cortex";
|
|
1841
|
+
if (f !== "wait") return f;
|
|
1842
|
+
if (stalled) return "cortex";
|
|
1843
|
+
const chk = Date.parse(String(checkedAt ?? ""));
|
|
1844
|
+
if (!Number.isFinite(chk)) return "wait";
|
|
1845
|
+
const ing = Date.parse(String(ingestedAt ?? ""));
|
|
1846
|
+
if (!Number.isFinite(ing)) return "cortex";
|
|
1847
|
+
return chk - ing >= NIGHT_MS + SOURCE_WAIT_LINE_MS ? "cortex" : "wait";
|
|
1848
|
+
}
|
|
1764
1849
|
var SOURCE_STATUSES = Object.freeze(["ok", "failed"]);
|
|
1765
1850
|
function sourceStateSk(cap, workspace, ref) {
|
|
1766
1851
|
if (!STATE_CAPS.includes(cap)) throw keyError(`\u7A2E\u985E\u304C\u8A9E\u5F59\u306B\u3042\u308A\u307E\u305B\u3093: ${String(cap)}`);
|
|
@@ -1776,6 +1861,81 @@ function sourceStateSk(cap, workspace, ref) {
|
|
|
1776
1861
|
function sourceStateKey({ project, cap, workspace, ref } = {}) {
|
|
1777
1862
|
return { pk: sourceStatePk(project), sk: sourceStateSk(cap, workspace, ref) };
|
|
1778
1863
|
}
|
|
1864
|
+
var isTimeString = (s) => typeof s === "string" && s.trim() !== "" && normalizeAt(s) !== null;
|
|
1865
|
+
function validateSourceStateWrite(input) {
|
|
1866
|
+
const i = input && typeof input === "object" ? input : {};
|
|
1867
|
+
let key;
|
|
1868
|
+
try {
|
|
1869
|
+
key = sourceStateKey(i);
|
|
1870
|
+
} catch (e) {
|
|
1871
|
+
return { ok: false, problem: `${e.message}\uFF08\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30FB\u7A2E\u985E\u30FB\u3064\u306A\u304E\u5143\u30FB\u5834\u306E ID \u3092\u898B\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09` };
|
|
1872
|
+
}
|
|
1873
|
+
const { check, ingested } = i;
|
|
1874
|
+
if (check === void 0 && ingested === void 0) return { ok: false, problem: "check \u304B ingested \u306E\u3069\u3061\u3089\u304B\u304C\u8981\u308A\u307E\u3059" };
|
|
1875
|
+
const value = { key };
|
|
1876
|
+
if (check !== void 0) {
|
|
1877
|
+
if (!check || typeof check !== "object") return { ok: false, problem: "check \u306E\u5F62\u304C\u9055\u3044\u307E\u3059" };
|
|
1878
|
+
if (!isTimeString(check.at)) return { ok: false, problem: "check.at\uFF08\u547C\u3093\u3060\u6642\u523B\uFF09\u304C\u8AAD\u3081\u307E\u305B\u3093" };
|
|
1879
|
+
if (typeof check.ok !== "boolean") return { ok: false, problem: "check.ok \u306F true \u304B false \u3067\u3059" };
|
|
1880
|
+
if (check.ok && check.reason !== void 0 && check.reason !== null) return { ok: false, problem: "ok \u306E\u78BA\u304B\u3081\u306B\u7406\u7531\u306F\u4ED8\u3051\u307E\u305B\u3093" };
|
|
1881
|
+
if (!check.ok && !SOURCE_REASONS.includes(check.reason)) {
|
|
1882
|
+
return { ok: false, problem: `check.reason \u304C\u7406\u7531\u306E\u7B26\u53F7\u306B\u3042\u308A\u307E\u305B\u3093: ${JSON.stringify(check.reason ?? null)}` };
|
|
1883
|
+
}
|
|
1884
|
+
const name = check.name == null ? "" : sanitizeDetail(check.name).trim();
|
|
1885
|
+
const detail = check.ok ? "" : sanitizeDetail(check.detail);
|
|
1886
|
+
value.check = {
|
|
1887
|
+
at: normalizeAt(check.at),
|
|
1888
|
+
status: check.ok ? "ok" : "failed",
|
|
1889
|
+
...check.ok ? {} : { reason: check.reason, ...detail ? { detail } : {} },
|
|
1890
|
+
...name ? { name } : {}
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
if (ingested !== void 0) {
|
|
1894
|
+
if (!ingested || typeof ingested !== "object" || !isTimeString(ingested.at)) return { ok: false, problem: "ingested.at\uFF08\u53D6\u308A\u8FBC\u3081\u305F\u6642\u523B\uFF09\u304C\u8AAD\u3081\u307E\u305B\u3093" };
|
|
1895
|
+
value.ingested = { at: normalizeAt(ingested.at) };
|
|
1896
|
+
}
|
|
1897
|
+
return { ok: true, value };
|
|
1898
|
+
}
|
|
1899
|
+
function sourceStateWrites(value) {
|
|
1900
|
+
const out = [];
|
|
1901
|
+
const exists = "attribute_exists(pk)";
|
|
1902
|
+
if (value.check) {
|
|
1903
|
+
const c = value.check;
|
|
1904
|
+
const set = ["#status = :status", "#statusAt = :at"];
|
|
1905
|
+
const remove = [];
|
|
1906
|
+
const names = { "#status": "status", "#statusAt": "statusAt" };
|
|
1907
|
+
const values = { ":status": c.status, ":at": c.at };
|
|
1908
|
+
for (const f of ["reason", "detail", "name"]) {
|
|
1909
|
+
if (c[f] !== void 0) {
|
|
1910
|
+
set.push(`#${f} = :${f}`);
|
|
1911
|
+
names[`#${f}`] = f;
|
|
1912
|
+
values[`:${f}`] = c[f];
|
|
1913
|
+
} else if (f !== "name") {
|
|
1914
|
+
remove.push(`#${f}`);
|
|
1915
|
+
names[`#${f}`] = f;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
out.push({
|
|
1919
|
+
kind: "check",
|
|
1920
|
+
key: value.key,
|
|
1921
|
+
update: `SET ${set.join(", ")}${remove.length ? ` REMOVE ${remove.join(", ")}` : ""}`,
|
|
1922
|
+
condition: `${exists} AND (attribute_not_exists(#statusAt) OR #statusAt < :at)`,
|
|
1923
|
+
names,
|
|
1924
|
+
values
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
if (value.ingested) {
|
|
1928
|
+
out.push({
|
|
1929
|
+
kind: "ingested",
|
|
1930
|
+
key: value.key,
|
|
1931
|
+
update: "SET #ingestedAt = :at",
|
|
1932
|
+
condition: `${exists} AND (attribute_not_exists(#ingestedAt) OR #ingestedAt < :at)`,
|
|
1933
|
+
names: { "#ingestedAt": "ingestedAt" },
|
|
1934
|
+
values: { ":at": value.ingested.at }
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
return out;
|
|
1938
|
+
}
|
|
1779
1939
|
|
|
1780
1940
|
// ../infra/lambda/shared/source-state-caps.mjs
|
|
1781
1941
|
function capOfTool(tool) {
|
|
@@ -1802,7 +1962,31 @@ var atOf = (v) => typeof v === "string" && v && !Number.isNaN(timeOf(v)) ? v : v
|
|
|
1802
1962
|
function sourcesUnavailable(reason) {
|
|
1803
1963
|
return { version: SOURCES_VIEW_VERSION, available: false, reason };
|
|
1804
1964
|
}
|
|
1805
|
-
function
|
|
1965
|
+
function userKeyOf(tool) {
|
|
1966
|
+
try {
|
|
1967
|
+
const s = stateNounsOf(tool);
|
|
1968
|
+
return !!s && typeof s.keyName === "string";
|
|
1969
|
+
} catch {
|
|
1970
|
+
return false;
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
function toolOfRowKind(kind) {
|
|
1974
|
+
if (isKnownTool(kind)) return kind;
|
|
1975
|
+
const a = ADAPTERS.find((x) => x.id === kind);
|
|
1976
|
+
return a && toolOfStateCap(a.cap) || null;
|
|
1977
|
+
}
|
|
1978
|
+
function fixerOf(reason, { tool, checkedAt, ingestedAt } = {}, table = source_state_exports) {
|
|
1979
|
+
const fn = table && table.sourceFixerOf;
|
|
1980
|
+
if (typeof fn !== "function") return void 0;
|
|
1981
|
+
return fn(reason, { userKey: userKeyOf(tool), checkedAt: checkedAt ?? null, ingestedAt: ingestedAt ?? null });
|
|
1982
|
+
}
|
|
1983
|
+
function stateOf2(item, tool = null) {
|
|
1984
|
+
const s = stateCoreOf(item);
|
|
1985
|
+
if (!tool || s.status !== "failed") return s;
|
|
1986
|
+
const f = fixerOf(s.reason, { tool, checkedAt: s.checkedAt, ingestedAt: s.ingestedAt });
|
|
1987
|
+
return f ? { ...s, fixer: f } : s;
|
|
1988
|
+
}
|
|
1989
|
+
function stateCoreOf(item) {
|
|
1806
1990
|
const out = {};
|
|
1807
1991
|
if (!item) return { status: "unchecked", ...out };
|
|
1808
1992
|
const ing = atOf(item.ingestedAt);
|
|
@@ -1869,7 +2053,7 @@ function buildSourcesView({ project, sources, calendar = null, items, notifyRows
|
|
|
1869
2053
|
name: it.name,
|
|
1870
2054
|
// 相手のツールが返した今の名前(状態の 1 件の `name`)。設定の名前(`name`)とは混ぜない
|
|
1871
2055
|
...cleanText(item && item.name, NAME_MAX) ? { currentName: cleanText(item.name, NAME_MAX) } : {},
|
|
1872
|
-
...stateOf2(item),
|
|
2056
|
+
...stateOf2(item, conn.tool),
|
|
1873
2057
|
paused: conn.paused === true || it.enabled === false,
|
|
1874
2058
|
notify: on.has(`${it.kind} ${it.workspace ?? ""} ${it.ref}`),
|
|
1875
2059
|
// 呼ぶ経路が「固定 IP の台に頼む」か=道具の表の値と、つなぎ先の設定の欄の値で決める(種類の名前で分けない)
|
|
@@ -1890,7 +2074,7 @@ function buildSourcesView({ project, sources, calendar = null, items, notifyRows
|
|
|
1890
2074
|
const g = groups.get(it.kind);
|
|
1891
2075
|
g.rows.push(row);
|
|
1892
2076
|
g.count++;
|
|
1893
|
-
if (row.status === "failed") g.problems++;
|
|
2077
|
+
if (row.status === "failed" && row.fixer !== "wait") g.problems++;
|
|
1894
2078
|
}
|
|
1895
2079
|
}
|
|
1896
2080
|
let meeting = null;
|
|
@@ -1906,7 +2090,7 @@ function buildSourcesView({ project, sources, calendar = null, items, notifyRows
|
|
|
1906
2090
|
const order = ADAPTERS.map((a) => a.id);
|
|
1907
2091
|
const list2 = [...groups.values()].sort((a, b) => order.indexOf(a.kind) - order.indexOf(b.kind));
|
|
1908
2092
|
const rows = list2.flatMap((g) => g.rows);
|
|
1909
|
-
const problems = rows.filter((r) => r.status === "failed").length + (meeting && meeting.status === "failed" ? 1 : 0);
|
|
2093
|
+
const problems = rows.filter((r) => r.status === "failed" && r.fixer !== "wait").length + (meeting && meeting.status === "failed" ? 1 : 0);
|
|
1910
2094
|
let last = null;
|
|
1911
2095
|
for (const t of [...rows.map((r) => r.ingestedAt), meeting && meeting.ingestedAt]) {
|
|
1912
2096
|
if (typeof t === "string" && !Number.isNaN(timeOf(t)) && (last === null || timeOf(t) > timeOf(last))) last = t;
|
|
@@ -1939,6 +2123,14 @@ function validateSourcesView(v) {
|
|
|
1939
2123
|
if ("ingestedAt" in r && !isAt(r.ingestedAt)) errs.push(`${where}.ingestedAt \u304C\u65E5\u6642\u3067\u306F\u3042\u308A\u307E\u305B\u3093`);
|
|
1940
2124
|
if ("detail" in r && !(typeof r.detail === "string" && r.detail.length <= DETAIL_MAX2)) errs.push(`${where}.detail \u306F ${DETAIL_MAX2} \u5B57\u307E\u3067\u306E\u6587\u5B57\u5217\u3067\u3059`);
|
|
1941
2125
|
};
|
|
2126
|
+
const checkFixer = (r, where) => {
|
|
2127
|
+
if (r.status !== "failed") {
|
|
2128
|
+
if ("fixer" in r) errs.push(`${where}.fixer \u306F\u554F\u984C\u3042\u308A\u306E\u884C\u306B\u3060\u3051\u4ED8\u304D\u307E\u3059`);
|
|
2129
|
+
return;
|
|
2130
|
+
}
|
|
2131
|
+
const want = fixerOf(r.reason, { tool: toolOfRowKind(r.kind), checkedAt: r.checkedAt, ingestedAt: r.ingestedAt });
|
|
2132
|
+
if (want === void 0 ? "fixer" in r : r.fixer !== want) errs.push(`${where}.fixer \u304C engine \u306E sourceFixerOf \u306E\u5024\uFF08${want ?? "\u6B04\u306A\u3057"}\uFF09\u3068\u9055\u3044\u307E\u3059`);
|
|
2133
|
+
};
|
|
1942
2134
|
if (!Number.isInteger(v.total) || !Number.isInteger(v.problems)) errs.push("sources.total\u30FBproblems \u306F\u6574\u6570\u3067\u3059");
|
|
1943
2135
|
if (v.lastIngestedAt !== null && !isAt(v.lastIngestedAt)) errs.push("sources.lastIngestedAt \u306F\u65E5\u6642\u304B null \u3067\u3059");
|
|
1944
2136
|
if (!Array.isArray(v.groups)) {
|
|
@@ -1952,7 +2144,7 @@ function validateSourcesView(v) {
|
|
|
1952
2144
|
if (!isObj4(g)) return errs.push(`${gw} \u304C\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093`);
|
|
1953
2145
|
only(g, ["kind", "label", "count", "problems", "rows"], gw);
|
|
1954
2146
|
if (!Array.isArray(g.rows)) return errs.push(`${gw}.rows \u306F\u914D\u5217\u3067\u3059`);
|
|
1955
|
-
const gp = g.rows.filter((r) => isObj4(r) && r.status === "failed").length;
|
|
2147
|
+
const gp = g.rows.filter((r) => isObj4(r) && r.status === "failed" && r.fixer !== "wait").length;
|
|
1956
2148
|
if (g.count !== g.rows.length) errs.push(`${gw}.count \u304C\u884C\u306E\u6570\u3068\u9055\u3044\u307E\u3059`);
|
|
1957
2149
|
if (g.problems !== gp) errs.push(`${gw}.problems \u304C\u300C\u554F\u984C\u3042\u308A\u300D\u306E\u6570\u3068\u9055\u3044\u307E\u3059`);
|
|
1958
2150
|
total += g.rows.length;
|
|
@@ -1960,12 +2152,13 @@ function validateSourcesView(v) {
|
|
|
1960
2152
|
g.rows.forEach((r, ri) => {
|
|
1961
2153
|
const rw = `${gw}.rows[${ri}]`;
|
|
1962
2154
|
if (!isObj4(r)) return errs.push(`${rw} \u304C\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093`);
|
|
1963
|
-
only(r, ["kind", "ref", "workspace", "name", "currentName", "status", "reason", "detail", "checkedAt", "ingestedAt", "paused", "notify", "fixedIp", "origin", "key", "canCheck", "canOwnerLogin", "removable"], rw);
|
|
2155
|
+
only(r, ["kind", "ref", "workspace", "name", "currentName", "status", "reason", "detail", "fixer", "checkedAt", "ingestedAt", "paused", "notify", "fixedIp", "origin", "key", "canCheck", "canOwnerLogin", "removable"], rw);
|
|
1964
2156
|
if (r.kind !== g.kind) errs.push(`${rw}.kind \u304C\u307E\u3068\u307E\u308A\u3068\u9055\u3044\u307E\u3059`);
|
|
1965
2157
|
for (const k of ["ref", "name"]) if (!(typeof r[k] === "string" && r[k])) errs.push(`${rw}.${k} \u306F\u7A7A\u3067\u306A\u3044\u6587\u5B57\u5217\u3067\u3059`);
|
|
1966
2158
|
if ("currentName" in r && !(typeof r.currentName === "string" && r.currentName && r.currentName.length <= NAME_MAX && !CONTROL_RE.test(r.currentName))) errs.push(`${rw}.currentName \u306F ${NAME_MAX} \u5B57\u307E\u3067\u306E\u5236\u5FA1\u6587\u5B57\u306E\u306A\u3044\u6587\u5B57\u5217\u3067\u3059`);
|
|
1967
2159
|
for (const k of ["paused", "notify", "fixedIp", "canCheck", "canOwnerLogin", "removable"]) if (typeof r[k] !== "boolean") errs.push(`${rw}.${k} \u306F\u771F\u507D\u5024\u3067\u3059`);
|
|
1968
2160
|
checkState(r, rw);
|
|
2161
|
+
checkFixer(r, rw);
|
|
1969
2162
|
});
|
|
1970
2163
|
});
|
|
1971
2164
|
if (v.total !== total) errs.push("sources.total \u304C\u884C\u306E\u6570\u306E\u5408\u8A08\u3068\u9055\u3044\u307E\u3059");
|
|
@@ -1985,6 +2178,9 @@ function validateSourcesView(v) {
|
|
|
1985
2178
|
SOURCES_UNAVAILABLE_REASONS,
|
|
1986
2179
|
SOURCES_VIEW_VERSION,
|
|
1987
2180
|
buildSourcesView,
|
|
2181
|
+
fixerOf,
|
|
1988
2182
|
sourcesUnavailable,
|
|
2183
|
+
toolOfRowKind,
|
|
2184
|
+
userKeyOf,
|
|
1989
2185
|
validateSourcesView
|
|
1990
2186
|
});
|
|
@@ -20,11 +20,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// ../infra/lambda/shared/source-state.mjs
|
|
21
21
|
var source_state_exports = {};
|
|
22
22
|
__export(source_state_exports, {
|
|
23
|
+
SOURCE_FIXERS: () => SOURCE_FIXERS,
|
|
23
24
|
SOURCE_REASONS: () => SOURCE_REASONS,
|
|
25
|
+
SOURCE_REASONS_RETRY: () => SOURCE_REASONS_RETRY,
|
|
26
|
+
SOURCE_REASON_FIXER: () => SOURCE_REASON_FIXER,
|
|
24
27
|
SOURCE_STATE_PK_PREFIX: () => SOURCE_STATE_PK_PREFIX,
|
|
25
28
|
SOURCE_STATE_SK_PREFIX: () => SOURCE_STATE_SK_PREFIX,
|
|
26
29
|
SOURCE_STATE_WORKSPACE_CAPS: () => SOURCE_STATE_WORKSPACE_CAPS,
|
|
27
30
|
SOURCE_STATUSES: () => SOURCE_STATUSES,
|
|
31
|
+
SOURCE_WAIT_LINE_MS: () => SOURCE_WAIT_LINE_MS,
|
|
32
|
+
sourceFixerOf: () => sourceFixerOf,
|
|
28
33
|
sourceStateKey: () => sourceStateKey,
|
|
29
34
|
sourceStatePk: () => sourceStatePk,
|
|
30
35
|
sourceStateSk: () => sourceStateSk,
|
|
@@ -119,11 +124,44 @@ var SOURCE_REASONS = Object.freeze([
|
|
|
119
124
|
// その場がこの組織の物かを、人がまだ確かめていない
|
|
120
125
|
"busy",
|
|
121
126
|
// 相手のツールの混雑・一時の障害
|
|
127
|
+
// 相手のツールの利用枠を使い切っていて、相手が言う戻る時刻が待ちの線(`SOURCE_WAIT_LINE_MS`)より先(#3047・#3052 リーダーの決め 6968542988 の 1)。
|
|
128
|
+
// `permission_missing` の文(権限が足りない)で出すと逆の直し方を案内する(権限は足りている)ので、専用の符号と文にする。戻る時刻は分かる時だけ `detail` の `until=`
|
|
129
|
+
"rate_locked",
|
|
122
130
|
"notes_not_received",
|
|
123
131
|
// 会議: 終わった会議のメモが届いていない(`not_member` に寄せると次にすることを間違える)
|
|
124
132
|
"unreadable"
|
|
125
133
|
// 上のどれでもない答え
|
|
126
134
|
]);
|
|
135
|
+
var SOURCE_REASON_FIXER = Object.freeze({
|
|
136
|
+
key_missing: "user",
|
|
137
|
+
key_rejected: "user",
|
|
138
|
+
permission_missing: "user",
|
|
139
|
+
not_member: "user",
|
|
140
|
+
not_found: "user",
|
|
141
|
+
approval_pending: "user",
|
|
142
|
+
not_allowed: "cortex",
|
|
143
|
+
wrong_owner: "user",
|
|
144
|
+
owner_unconfirmed: "user",
|
|
145
|
+
busy: "wait",
|
|
146
|
+
rate_locked: "user",
|
|
147
|
+
notes_not_received: "wait",
|
|
148
|
+
unreadable: "cortex"
|
|
149
|
+
});
|
|
150
|
+
var SOURCE_FIXERS = Object.freeze(["user", "cortex", "wait"]);
|
|
151
|
+
var SOURCE_REASONS_RETRY = Object.freeze(Object.keys(SOURCE_REASON_FIXER).filter((r) => SOURCE_REASON_FIXER[r] === "wait"));
|
|
152
|
+
var SOURCE_WAIT_LINE_MS = 30 * 60 * 1e3;
|
|
153
|
+
var NIGHT_MS = 24 * 3600 * 1e3;
|
|
154
|
+
function sourceFixerOf(code, { userKey = true, stalled = false, checkedAt = null, ingestedAt = null } = {}) {
|
|
155
|
+
const f = Object.hasOwn(SOURCE_REASON_FIXER, code) ? SOURCE_REASON_FIXER[code] : "cortex";
|
|
156
|
+
if (code === "key_missing" && userKey === false) return "cortex";
|
|
157
|
+
if (f !== "wait") return f;
|
|
158
|
+
if (stalled) return "cortex";
|
|
159
|
+
const chk = Date.parse(String(checkedAt ?? ""));
|
|
160
|
+
if (!Number.isFinite(chk)) return "wait";
|
|
161
|
+
const ing = Date.parse(String(ingestedAt ?? ""));
|
|
162
|
+
if (!Number.isFinite(ing)) return "cortex";
|
|
163
|
+
return chk - ing >= NIGHT_MS + SOURCE_WAIT_LINE_MS ? "cortex" : "wait";
|
|
164
|
+
}
|
|
127
165
|
var SOURCE_STATUSES = Object.freeze(["ok", "failed"]);
|
|
128
166
|
function sourceStateSk(cap, workspace, ref) {
|
|
129
167
|
if (!STATE_CAPS.includes(cap)) throw keyError(`\u7A2E\u985E\u304C\u8A9E\u5F59\u306B\u3042\u308A\u307E\u305B\u3093: ${String(cap)}`);
|
|
@@ -216,11 +254,16 @@ function sourceStateWrites(value) {
|
|
|
216
254
|
}
|
|
217
255
|
// Annotate the CommonJS export names for ESM import in node:
|
|
218
256
|
0 && (module.exports = {
|
|
257
|
+
SOURCE_FIXERS,
|
|
219
258
|
SOURCE_REASONS,
|
|
259
|
+
SOURCE_REASONS_RETRY,
|
|
260
|
+
SOURCE_REASON_FIXER,
|
|
220
261
|
SOURCE_STATE_PK_PREFIX,
|
|
221
262
|
SOURCE_STATE_SK_PREFIX,
|
|
222
263
|
SOURCE_STATE_WORKSPACE_CAPS,
|
|
223
264
|
SOURCE_STATUSES,
|
|
265
|
+
SOURCE_WAIT_LINE_MS,
|
|
266
|
+
sourceFixerOf,
|
|
224
267
|
sourceStateKey,
|
|
225
268
|
sourceStatePk,
|
|
226
269
|
sourceStateSk,
|
package/dist/forward-reads.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RUN_HISTORY_STATUS_LINES = exports.RUN_KIND_WORDS = exports.RUN_CAUSE_WORDS = exports.RUN_LIST_CODE_LINES = exports.MEMORY_RUNS_CODE_ACTIONS = exports.MEMORY_REFRESH_CODE_LINES = exports.IDENTITY_ASK_ROLE_LINES = exports.IDENTITY_ASK_TOOL_LINES = exports.IDENTITY_DECIDE_DENIED_LINES = exports.MEMORY_REFRESH_RESULT_LINES = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* ビューアが intake の転送の口(`PORTAL_FORWARD_OPS` の
|
|
5
|
+
* ビューアが intake の転送の口(`PORTAL_FORWARD_OPS` の 14 口)のうち、メンバーとプロジェクトの情報の 8 口〈アイコンの 2 口を含む〉の**ほか**の 6 口
|
|
6
6
|
* (名寄せの問い・名寄せの決め・関係者のアイコン・時計の今すぐ更新・時計の要約・更新の記録)で、ポータルの答えから読む欄と、
|
|
7
7
|
* 固有の 1 行を持つ語(cortex-engine #2896 便 MEMBER-ONE-TRUTH 3 版・設計 §3-6・リーダーの決め 1)。
|
|
8
8
|
*
|
package/dist/intake-scope.js
CHANGED
|
@@ -19,7 +19,8 @@ exports.TENANT_INTAKE_TABLES = {
|
|
|
19
19
|
// `memory-refresh`・`memory-runs` は時計の今すぐ更新と要約(cortex-engine #2357 便 MT-VCLOCK-2・受け口の表と同じ)
|
|
20
20
|
// `memory-history`・`memory-report` は更新の記録の一覧と 1 回の報告(cortex-engine #2893 便 RAIL-T2a・受け口の表と同じ)
|
|
21
21
|
// `member-*`・`project-info*` はメンバーとプロジェクトの情報(cortex-engine #2896 便 RAIL-T2b・受け口の表と同じ)
|
|
22
|
-
|
|
22
|
+
// `project-icon-*` はプロジェクトのアイコンを置く・外す(cortex-engine #2503 便 ICON-VIEWER・受け口の表と同じ)
|
|
23
|
+
ops: ["state", "config", "probe", "secret", "slack-oauth-start", "google-confirm-info", "memory-refresh", "memory-runs", "memory-history", "memory-report", "member-list", "member-preview", "member-invite", "member-remove", "project-info", "project-info-update", "project-icon-set", "project-icon-remove"],
|
|
23
24
|
// Google の確認の 3 つ(便 RS-T85f 続き)と Drive の入口②の許可(便 RS-T85g・受け口の `TENANT_INTAKE_GOOGLE_PAYLOAD_OPS`)。種別は op で決まるか、google-nonce は本文の kind
|
|
24
25
|
configPayloadOps: ["google-nonce", "confirm-drive-folder", "confirm-google-chat-space", "connect-drive-account"],
|
|
25
26
|
configKinds: ["github", "backlog", "slack", "drive", "google-chat", "memory"],
|
package/dist/member-page.js
CHANGED
|
@@ -25,7 +25,11 @@ exports.projectNameProblemOf = projectNameProblemOf;
|
|
|
25
25
|
* の `openapi` と `expects` と突き合わせる(ポータルの写しの番人も同じ `expects` を見る)。
|
|
26
26
|
*/
|
|
27
27
|
const intake_code_lines_1 = require("./intake-code-lines");
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* intake の口の名前(画面が呼ぶ 8 本・intake の転送の口 `PORTAL_FORWARD_OPS` の中)。
|
|
30
|
+
* プロジェクトのアイコンを変える・外す 2 本(`iconSet`・`iconRemove`)は cortex-engine #2503 便 ICON-VIEWER で足した
|
|
31
|
+
* (ポータルの表へ運ぶ口。#1781 で外したリポへ書く口は戻さない)
|
|
32
|
+
*/
|
|
29
33
|
exports.MEMBER_PAGE_OPS = {
|
|
30
34
|
list: "member-list",
|
|
31
35
|
preview: "member-preview",
|
|
@@ -33,6 +37,8 @@ exports.MEMBER_PAGE_OPS = {
|
|
|
33
37
|
remove: "member-remove",
|
|
34
38
|
info: "project-info",
|
|
35
39
|
infoUpdate: "project-info-update",
|
|
40
|
+
iconSet: "project-icon-set",
|
|
41
|
+
iconRemove: "project-icon-remove",
|
|
36
42
|
};
|
|
37
43
|
/**
|
|
38
44
|
* つなぎ先を変える口(設計 §5 の `canEditSources` の対象)。`config` の `kind: "memory"`(右下の時計の開始・停止・再開)は
|
|
@@ -62,7 +68,7 @@ function abilitiesOf(ans) {
|
|
|
62
68
|
const a = ans && typeof ans === "object" ? ans : {};
|
|
63
69
|
const o = a.abilities && typeof a.abilities === "object" ? a.abilities : {};
|
|
64
70
|
const b = (v) => (typeof v === "boolean" ? v : null);
|
|
65
|
-
return { manageMembers: b(o.canManageMembers), requestInvite: b(o.canRequestInvite), classify: b(o.canClassify) };
|
|
71
|
+
return { manageMembers: b(o.canManageMembers), requestInvite: b(o.canRequestInvite), classify: b(o.canClassify), setIcon: b(o.canSetIcon) };
|
|
66
72
|
}
|
|
67
73
|
/** この呼び出しを つなぎ先の旗で止めるか(旗が false のときだけ・時計の config は止めない)。ops は SOURCE_EDIT_OPS(引数で受ける・純関数に保つ) */
|
|
68
74
|
function sourceEditBlocked(op, body, rights, ops) {
|
|
@@ -136,6 +142,9 @@ exports.MEMBER_CODE_LINES = {
|
|
|
136
142
|
"ORGANIZATION_UNDECIDED": "このプロジェクトは組織が決まっていないため、情報を直せません。先に組織を決めてください",
|
|
137
143
|
"EXPORT_UNAVAILABLE": "この組織のプロジェクトは、まだ情報を保存できません。運営の窓口に連絡してください",
|
|
138
144
|
"HOME_UNAVAILABLE": "このプロジェクトの Home.md が無いか読めないため、保存できません。基盤の管理者に伝えてください",
|
|
145
|
+
// プロジェクトのアイコンを変える(project-icon-set)の断り(cortex-engine #2503 便 ICON-VIEWER)。ビューアが送る前に断るときも同じ文
|
|
146
|
+
"ICON_TYPE": "PNG・JPEG・WebP の画像を選んでください",
|
|
147
|
+
"ICON_TOO_LARGE": "画像が大きすぎます。もっと小さい画像を選んでください",
|
|
139
148
|
// 入口の門の 4 語・`NOT_FOUND`・`UNAVAILABLE` は共通の表の文(画面ごとに別の文を持たない)
|
|
140
149
|
...Object.fromEntries(Object.entries(intake_code_lines_1.INTAKE_CODE_LINES).map(([code, line]) => [code, line.text])),
|
|
141
150
|
};
|