@takagaki/cortex-decisions-viewer 0.12.88 → 0.12.89
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/permissions-data.js +324 -0
- package/dist/render.js +206 -2
- package/package.json +1 -1
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PERMISSIONS_DATA = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* 🔴 生成物。手で編集しない(#841)。
|
|
6
|
+
* 正本は `infra/lambda/shared/permissions.mjs`。作り直しは `cd infra && node scripts/gen-permissions.mjs`。
|
|
7
|
+
* 操作タブの[権限]がこの値を CLIENT_JS に注入して読む(公開ページと同じ中身)。
|
|
8
|
+
*/
|
|
9
|
+
exports.PERMISSIONS_DATA = {
|
|
10
|
+
"revisedOn": "2026年9月25日",
|
|
11
|
+
"enactedOn": "2026年9月25日",
|
|
12
|
+
"tools": [
|
|
13
|
+
{
|
|
14
|
+
"id": "slack",
|
|
15
|
+
"tool": "Slack",
|
|
16
|
+
"how": "お客様の Slack ワークスペースに Cortex のアプリを追加し、ワークスペースの管理者が許可します(OAuth)。",
|
|
17
|
+
"reach": "Cortex のアプリを招待したチャンネルのうち、登録したチャンネルだけを読みます(公開・非公開とも、招待が要ります)。",
|
|
18
|
+
"tenancyText": "ワークスペースごとに接続します。",
|
|
19
|
+
"customer": {
|
|
20
|
+
"approverLabel": "許可する方",
|
|
21
|
+
"approverText": "ワークスペースの管理者",
|
|
22
|
+
"grants": [
|
|
23
|
+
{
|
|
24
|
+
"spell": "channels:read",
|
|
25
|
+
"access": "read",
|
|
26
|
+
"accessText": "読む",
|
|
27
|
+
"purpose": "チャンネルの名前と情報を確かめる"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"spell": "channels:history",
|
|
31
|
+
"access": "read",
|
|
32
|
+
"accessText": "読む",
|
|
33
|
+
"purpose": "登録した公開チャンネルの会話を読む"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"spell": "groups:history",
|
|
37
|
+
"access": "read",
|
|
38
|
+
"accessText": "読む",
|
|
39
|
+
"purpose": "登録した非公開チャンネルの会話を読む"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"spell": "users:read",
|
|
43
|
+
"access": "read",
|
|
44
|
+
"accessText": "読む",
|
|
45
|
+
"purpose": "発言した方の表示名を確かめる"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"spell": "users:read.email",
|
|
49
|
+
"access": "read",
|
|
50
|
+
"accessText": "読む",
|
|
51
|
+
"purpose": "発言した方のメールアドレスを確かめ、同じ方を見分ける"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"share": null,
|
|
55
|
+
"keyOnly": null,
|
|
56
|
+
"notRequested": [
|
|
57
|
+
{
|
|
58
|
+
"spell": "chat:write",
|
|
59
|
+
"label": "メッセージの投稿"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"cortexAccount": null,
|
|
64
|
+
"delegated": {
|
|
65
|
+
"text": "利用者ご本人が、AI の道具(Claude Code)から Slack の公式の接続口に、ご自身のアカウントでつなぎます。権限は Slack の同意画面で、ご本人が確かめて許可します。",
|
|
66
|
+
"grants": null
|
|
67
|
+
},
|
|
68
|
+
"note": null
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "github",
|
|
72
|
+
"tool": "GitHub",
|
|
73
|
+
"how": "お客様の GitHub の組織に Cortex の GitHub App をインストールし、読ませるリポジトリを選びます。",
|
|
74
|
+
"reach": "インストールで選んだリポジトリのうち、登録したリポジトリの Issue・プルリクエスト・Discussions・コミットの記録を読みます。",
|
|
75
|
+
"tenancyText": "組織ごとに接続します。",
|
|
76
|
+
"customer": {
|
|
77
|
+
"approverLabel": "許可する方",
|
|
78
|
+
"approverText": "組織のオーナー",
|
|
79
|
+
"grants": [
|
|
80
|
+
{
|
|
81
|
+
"spell": "contents",
|
|
82
|
+
"access": "read",
|
|
83
|
+
"accessText": "読む",
|
|
84
|
+
"purpose": "コミットの記録とリポジトリの中身を読む"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"spell": "issues",
|
|
88
|
+
"access": "read",
|
|
89
|
+
"accessText": "読む",
|
|
90
|
+
"purpose": "Issue とそのコメントを読む"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"spell": "pull_requests",
|
|
94
|
+
"access": "read",
|
|
95
|
+
"accessText": "読む",
|
|
96
|
+
"purpose": "プルリクエストとその会話を読む"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"spell": "discussions",
|
|
100
|
+
"access": "read",
|
|
101
|
+
"accessText": "読む",
|
|
102
|
+
"purpose": "Discussions を読む"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"spell": "metadata",
|
|
106
|
+
"access": "read",
|
|
107
|
+
"accessText": "読む",
|
|
108
|
+
"purpose": "リポジトリの基本情報を読む(GitHub が必ず付ける権限)"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"share": null,
|
|
112
|
+
"keyOnly": null,
|
|
113
|
+
"notRequested": []
|
|
114
|
+
},
|
|
115
|
+
"cortexAccount": null,
|
|
116
|
+
"delegated": null,
|
|
117
|
+
"note": null
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "figma",
|
|
121
|
+
"tool": "Figma",
|
|
122
|
+
"how": "利用者が Figma で個人アクセストークンを発行して Cortex の画面に貼り、読ませたいファイルに発行したアカウントを閲覧者として招待します。",
|
|
123
|
+
"reach": "登録したデザインファイルだけを読みます。",
|
|
124
|
+
"tenancyText": "プロジェクトごとに接続します。",
|
|
125
|
+
"customer": {
|
|
126
|
+
"approverLabel": "許可する方",
|
|
127
|
+
"approverText": "キーやトークンを発行する方ご本人",
|
|
128
|
+
"grants": [
|
|
129
|
+
{
|
|
130
|
+
"spell": "file_content:read",
|
|
131
|
+
"access": "read",
|
|
132
|
+
"accessText": "読む",
|
|
133
|
+
"purpose": "デザインファイルの画面の一覧と説明を読む"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"spell": "file_comments:read",
|
|
137
|
+
"access": "read",
|
|
138
|
+
"accessText": "読む",
|
|
139
|
+
"purpose": "デザインファイルのコメントを読む"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"share": null,
|
|
143
|
+
"keyOnly": null,
|
|
144
|
+
"notRequested": []
|
|
145
|
+
},
|
|
146
|
+
"cortexAccount": null,
|
|
147
|
+
"delegated": {
|
|
148
|
+
"text": "利用者ご本人が、AI の道具(Claude Code)から Figma の公式の接続口に、ご自身のアカウントでつなぎます。権限は Figma の同意画面で、ご本人が確かめて許可します。",
|
|
149
|
+
"grants": null
|
|
150
|
+
},
|
|
151
|
+
"note": null
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "drive",
|
|
155
|
+
"tool": "Google Drive",
|
|
156
|
+
"how": "読ませたいフォルダを、Cortex のサービス用アカウントに閲覧者として共有します。",
|
|
157
|
+
"reach": "共有されたフォルダのうち、登録したフォルダの資料だけを読みます。",
|
|
158
|
+
"tenancyText": "プロジェクトごとに接続します。",
|
|
159
|
+
"customer": {
|
|
160
|
+
"approverLabel": "お願いする方",
|
|
161
|
+
"approverText": "フォルダを共有する方",
|
|
162
|
+
"grants": [],
|
|
163
|
+
"share": "フォルダを閲覧者として共有する(編集の権限は要りません)",
|
|
164
|
+
"keyOnly": null,
|
|
165
|
+
"notRequested": []
|
|
166
|
+
},
|
|
167
|
+
"cortexAccount": {
|
|
168
|
+
"text": "Cortex のサービス用アカウントが、自分に共有された資料を読むために持つ権限です。",
|
|
169
|
+
"grants": [
|
|
170
|
+
{
|
|
171
|
+
"spell": "https://www.googleapis.com/auth/drive.readonly",
|
|
172
|
+
"access": "read",
|
|
173
|
+
"accessText": "読む",
|
|
174
|
+
"purpose": "共有されたフォルダの資料を読む"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"delegated": null,
|
|
179
|
+
"note": "このアカウントは Google Meet の議事録にも使います(その権限は Google Meet の節にあります)。"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "backlog",
|
|
183
|
+
"tool": "Backlog",
|
|
184
|
+
"how": "利用者が Backlog で API キーを発行し、Cortex の画面に貼ります。",
|
|
185
|
+
"reach": "登録したプロジェクトの課題・Wiki・ドキュメントを読みます。",
|
|
186
|
+
"tenancyText": "スペースごとに接続します。",
|
|
187
|
+
"customer": {
|
|
188
|
+
"approverLabel": "お願いする方",
|
|
189
|
+
"approverText": "キーやトークンを発行する方ご本人",
|
|
190
|
+
"grants": [],
|
|
191
|
+
"share": null,
|
|
192
|
+
"keyOnly": {
|
|
193
|
+
"access": "read",
|
|
194
|
+
"accessText": "読む",
|
|
195
|
+
"text": "Backlog の API キーには権限の範囲を絞る仕組みが無く、発行した方の権限で動きます。Cortex は読む操作だけを行います。閲覧だけができる方のキーをお勧めします。"
|
|
196
|
+
},
|
|
197
|
+
"notRequested": []
|
|
198
|
+
},
|
|
199
|
+
"cortexAccount": null,
|
|
200
|
+
"delegated": {
|
|
201
|
+
"text": "利用者ご本人が、AI の道具(Claude Code)から Cortex の Backlog の接続口に、ご自身の Backlog アカウントでつなぎます(OAuth)。ご本人の Backlog での権限の範囲で、次の操作ができます。",
|
|
202
|
+
"grants": [
|
|
203
|
+
{
|
|
204
|
+
"spell": "space",
|
|
205
|
+
"access": "read",
|
|
206
|
+
"accessText": "読む",
|
|
207
|
+
"purpose": "スペースと利用者の情報を読む"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"spell": "project",
|
|
211
|
+
"access": "write",
|
|
212
|
+
"accessText": "書く",
|
|
213
|
+
"purpose": "プロジェクトの情報を読み、追加・更新する"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"spell": "issue",
|
|
217
|
+
"access": "write",
|
|
218
|
+
"accessText": "書く",
|
|
219
|
+
"purpose": "課題とコメントを読み、追加・更新・削除する"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"spell": "wiki",
|
|
223
|
+
"access": "write",
|
|
224
|
+
"accessText": "書く",
|
|
225
|
+
"purpose": "Wiki を読み、追加・更新する"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"spell": "document",
|
|
229
|
+
"access": "write",
|
|
230
|
+
"accessText": "書く",
|
|
231
|
+
"purpose": "ドキュメントを読み、追加する"
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
"note": null
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"id": "google-chat",
|
|
239
|
+
"tool": "Google Chat",
|
|
240
|
+
"how": "お客様の Google Workspace の管理者が Google Chat アプリ「Cortex」を許可し、読ませたいスペースにアプリを追加します。",
|
|
241
|
+
"reach": "アプリを追加したスペースのうち、登録したスペースだけを読みます。",
|
|
242
|
+
"tenancyText": "ワークスペースごとに接続します。",
|
|
243
|
+
"customer": {
|
|
244
|
+
"approverLabel": "許可する方",
|
|
245
|
+
"approverText": "ワークスペースの管理者",
|
|
246
|
+
"grants": [
|
|
247
|
+
{
|
|
248
|
+
"spell": "https://www.googleapis.com/auth/chat.app.messages.readonly",
|
|
249
|
+
"access": "read",
|
|
250
|
+
"accessText": "読む",
|
|
251
|
+
"purpose": "アプリを追加したスペースの会話を読む"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"spell": "https://www.googleapis.com/auth/chat.bot",
|
|
255
|
+
"access": "write",
|
|
256
|
+
"accessText": "書く",
|
|
257
|
+
"purpose": "スペースの名前を確かめ、通知先に設定したスペースへ確認・通知を投稿する"
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"share": null,
|
|
261
|
+
"keyOnly": null,
|
|
262
|
+
"notRequested": []
|
|
263
|
+
},
|
|
264
|
+
"cortexAccount": null,
|
|
265
|
+
"delegated": {
|
|
266
|
+
"text": "利用者ご本人が、AI の道具(Claude Code)から Google Chat の公式の接続口に、ご自身のアカウントでつなぎます。権限は Google の同意画面で、ご本人が確かめて許可します。",
|
|
267
|
+
"grants": null
|
|
268
|
+
},
|
|
269
|
+
"note": null
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"id": "meet",
|
|
273
|
+
"tool": "Google Meet",
|
|
274
|
+
"how": "Cortex がプロジェクトごとに作るカレンダーに会議の予定を入れ、Gemini のメモを ON にします。",
|
|
275
|
+
"reach": "プロジェクトカレンダーの予定に添付されたメモと、会議名にプロジェクトの目印か登録した別名が入った会議のメモだけを開きます。それ以外は中身を開きません。",
|
|
276
|
+
"tenancyText": "プロジェクトごとに接続します。",
|
|
277
|
+
"customer": {
|
|
278
|
+
"approverLabel": "お願いする方",
|
|
279
|
+
"approverText": "会議の予定を作る方",
|
|
280
|
+
"grants": [],
|
|
281
|
+
"share": "会議の予定をプロジェクトのカレンダーに入れる",
|
|
282
|
+
"keyOnly": null,
|
|
283
|
+
"notRequested": []
|
|
284
|
+
},
|
|
285
|
+
"cortexAccount": {
|
|
286
|
+
"text": "Cortex のサービス用アカウント(Google Drive と同じアカウント)が、プロジェクトのカレンダーを用意し、会議のメモを読むために持つ権限です。",
|
|
287
|
+
"grants": [
|
|
288
|
+
{
|
|
289
|
+
"spell": "https://www.googleapis.com/auth/drive.readonly",
|
|
290
|
+
"access": "read",
|
|
291
|
+
"accessText": "読む",
|
|
292
|
+
"purpose": "会議のメモを探して読む"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"spell": "https://www.googleapis.com/auth/documents.readonly",
|
|
296
|
+
"access": "read",
|
|
297
|
+
"accessText": "読む",
|
|
298
|
+
"purpose": "現在は使っていません"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"spell": "https://www.googleapis.com/auth/calendar",
|
|
302
|
+
"access": "write",
|
|
303
|
+
"accessText": "書く",
|
|
304
|
+
"purpose": "プロジェクトのカレンダーを作って共有し、会議の予定に Cortex のアカウントを出席者として加える(通知は送りません)"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"spell": "https://www.googleapis.com/auth/script.external_request",
|
|
308
|
+
"access": "write",
|
|
309
|
+
"accessText": "書く",
|
|
310
|
+
"purpose": "読んだメモを Cortex の記録へ送る"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"spell": "https://www.googleapis.com/auth/script.scriptapp",
|
|
314
|
+
"access": "write",
|
|
315
|
+
"accessText": "書く",
|
|
316
|
+
"purpose": "定時の処理を設定する"
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
"delegated": null,
|
|
321
|
+
"note": null
|
|
322
|
+
}
|
|
323
|
+
]
|
|
324
|
+
};
|
package/dist/render.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STATE_CONFIRMING = exports.PROBE_WAIT_TIMEOUT_TEXT = exports.UNSETTLED_LIMITS = exports.INGEST_LIMITS = exports.ALREADY_REGISTERED = exports.LIVE_CONFIRM_LIMITS = exports.CLAUDE_CODE_LINK = void 0;
|
|
3
|
+
exports.STATE_CONFIRMING = exports.PROBE_WAIT_TIMEOUT_TEXT = exports.UNSETTLED_LIMITS = exports.INGEST_LIMITS = exports.ALREADY_REGISTERED = exports.LIVE_CONFIRM_LIMITS = exports.CLAUDE_CODE_LINK = exports.PERMISSION_WIRING = void 0;
|
|
4
4
|
exports.renderSite = renderSite;
|
|
5
5
|
exports.renderSiteWithAssets = renderSiteWithAssets;
|
|
6
6
|
exports.viewerAssetSources = viewerAssetSources;
|
|
7
7
|
exports.viewerAssetNames = viewerAssetNames;
|
|
8
|
+
exports.permissionToolId = permissionToolId;
|
|
8
9
|
exports.isRepositorySlug = isRepositorySlug;
|
|
9
10
|
exports.devRepositoryRefs = devRepositoryRefs;
|
|
10
11
|
exports.claudeCodeRepositories = claudeCodeRepositories;
|
|
@@ -84,6 +85,8 @@ const figma_guide_images_1 = require("./figma-guide-images");
|
|
|
84
85
|
// `<種類>:<値>` の形(#686 C4)。名寄せの提案を「同じ人ですか」の問いに変えてよいかの門は
|
|
85
86
|
// この形だけで見分ける。綴りを画面側に写さず、正本(external-id.ts)から流し込む
|
|
86
87
|
const external_id_1 = require("./external-id");
|
|
88
|
+
// 操作タブの[権限](#841)。生成物で、正本は infra/lambda/shared/permissions.mjs
|
|
89
|
+
const permissions_data_1 = require("./permissions-data");
|
|
87
90
|
// 操作タブの仮置き(#388)。判定の実体はあちら——ここは流し込みと配線だけ
|
|
88
91
|
const pending_ops_1 = require("./pending-ops");
|
|
89
92
|
/**
|
|
@@ -242,6 +245,26 @@ const ADAPTER_CATALOG = {
|
|
|
242
245
|
// 能力の並びを1箇所で決めるため
|
|
243
246
|
"ハーネス連携": [],
|
|
244
247
|
};
|
|
248
|
+
/**
|
|
249
|
+
* [権限](#841): viewer のアダプタ id → 権限の宣言(infra/lambda/shared/permissions.mjs)の id。
|
|
250
|
+
*
|
|
251
|
+
* 綴りが違うのは Google の 2 つだけで、**載っていない id は同じ綴り**。表は 1 枚だけ置く
|
|
252
|
+
* (クライアント側へは値を流し込み、引き方は下の permissionToolId を toString() で共有する)。
|
|
253
|
+
* ⚠ 定数そのものを export しない(CLAUDE_CODE_HOME の項と同じ理由。流し込んだ先で exports を踏む)
|
|
254
|
+
*/
|
|
255
|
+
const PERMISSION_TOOL_ID = {
|
|
256
|
+
"google-meet": "meet",
|
|
257
|
+
"google-drive": "drive",
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* アダプタ id → 宣言の id(#841)。**クロージャを持たない純関数に保つ**(CLIENT_JS へ
|
|
261
|
+
* toString() で流し込む。参照してよいのは同じ名前で流し込む PERMISSION_TOOL_ID だけ)
|
|
262
|
+
*/
|
|
263
|
+
function permissionToolId(adapter) {
|
|
264
|
+
return Object.prototype.hasOwnProperty.call(PERMISSION_TOOL_ID, adapter) ? PERMISSION_TOOL_ID[adapter] : adapter;
|
|
265
|
+
}
|
|
266
|
+
/** 能力→アダプタの表を**テストから読むための入れ物**(CLAUDE_CODE_LINK と同じ作法・#841) */
|
|
267
|
+
exports.PERMISSION_WIRING = { adapterCatalog: ADAPTER_CATALOG };
|
|
245
268
|
/**
|
|
246
269
|
* 導出された状態 → 画面に出す文言。**マップとタイルで同じ語を使う。**
|
|
247
270
|
*
|
|
@@ -5678,6 +5701,33 @@ button.ops-card-btn:disabled { opacity: .6; cursor: default; }
|
|
|
5678
5701
|
color: var(--muted); padding: 2px 6px; border-radius: 6px;
|
|
5679
5702
|
}
|
|
5680
5703
|
.modal-x:hover { background: var(--bg); color: var(--text); }
|
|
5704
|
+
/* [権限](#841)。見出し行は space-between なので、[権限]と ✕ を右側の箱にまとめる */
|
|
5705
|
+
.modal-head-side { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
|
|
5706
|
+
.modal-perm {
|
|
5707
|
+
border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
|
|
5708
|
+
font-size: 12px; font-weight: 600; line-height: 1.4; padding: 3px 10px; border-radius: 999px;
|
|
5709
|
+
}
|
|
5710
|
+
.modal-perm:hover { color: var(--text); border-color: var(--muted); }
|
|
5711
|
+
.modal-perm[aria-expanded="true"] { background: var(--accent-weak); color: var(--accent); border-color: var(--accent); }
|
|
5712
|
+
.perm-sec {
|
|
5713
|
+
border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
|
|
5714
|
+
padding: 12px 14px; display: flex; flex-direction: column; gap: 12px;
|
|
5715
|
+
}
|
|
5716
|
+
.perm-sec[hidden] { display: none; }
|
|
5717
|
+
.perm-tool { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
|
|
5718
|
+
.perm-tool + .perm-tool { border-top: 1px solid var(--border); padding-top: 12px; }
|
|
5719
|
+
.perm-h { font-size: 14px; font-weight: 700; margin: 0; color: var(--text); }
|
|
5720
|
+
.perm-h4 { font-size: 13px; font-weight: 700; margin: 6px 0 0; color: var(--text); }
|
|
5721
|
+
.perm-p { font-size: 13px; line-height: 1.7; margin: 0; color: var(--text); }
|
|
5722
|
+
.perm-p code, .perm-table code {
|
|
5723
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere;
|
|
5724
|
+
}
|
|
5725
|
+
.perm-table-wrap { overflow-x: auto; }
|
|
5726
|
+
.perm-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
|
|
5727
|
+
.perm-table caption { text-align: left; font-weight: 700; font-size: 12.5px; color: var(--muted); padding-bottom: 4px; }
|
|
5728
|
+
.perm-table th, .perm-table td { border-bottom: 1px solid var(--border); padding: 5px 6px; text-align: left; vertical-align: top; line-height: 1.6; }
|
|
5729
|
+
.perm-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
|
|
5730
|
+
.perm-access { white-space: nowrap; }
|
|
5681
5731
|
.modal-desc { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0; }
|
|
5682
5732
|
.modal-field { display: flex; flex-direction: column; gap: 4px; }
|
|
5683
5733
|
.modal-field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
|
|
@@ -5877,6 +5927,11 @@ const CLIENT_JS = `
|
|
|
5877
5927
|
// 直列化した先(ここ)で undefined を参照して壊れる。
|
|
5878
5928
|
var CAP_OTHER = ${JSON.stringify(CAP_OTHER)};
|
|
5879
5929
|
var ADAPTER_CATALOG = ${JSON.stringify(ADAPTER_CATALOG)};
|
|
5930
|
+
// [権限](#841)。中身は生成物 permissions-data.ts の値そのもの(公開ページと同じ写し)。
|
|
5931
|
+
// 小なり記号だけ逃がす(埋め込み形は script 要素の中なので、閉じタグの綴りを作らせない)
|
|
5932
|
+
var PERMISSION_TOOL_ID = ${JSON.stringify(PERMISSION_TOOL_ID)};
|
|
5933
|
+
${permissionToolId.toString()}
|
|
5934
|
+
var PERMISSIONS_DATA = ${JSON.stringify(permissions_data_1.PERMISSIONS_DATA).replace(/</g, "\\u003c")};
|
|
5880
5935
|
var CAP_STATE_TEXT = ${JSON.stringify(CAP_STATE_TEXT)};
|
|
5881
5936
|
var CAP_STATE_MARK = ${JSON.stringify(CAP_STATE_MARK)};
|
|
5882
5937
|
${externalCapability.toString()}
|
|
@@ -11636,6 +11691,151 @@ ${calendarAddUrl.toString()}
|
|
|
11636
11691
|
return (tool && CM_TOOL_LABEL_C[tool]) || cap;
|
|
11637
11692
|
}
|
|
11638
11693
|
|
|
11694
|
+
/**
|
|
11695
|
+
* [権限](#841): 開いたモーダルがどのツールの権限を説明するか。宣言の行の配列を返す。
|
|
11696
|
+
*
|
|
11697
|
+
* 開いたタイルのアダプタ → 宣言の id(permissionToolId)。**アダプタが分からない呼び出しは
|
|
11698
|
+
* 能力のカタログ全部**——チャット(Slack / Google Chat)の混載の1枚タイルでは両方を出す。
|
|
11699
|
+
* 空を返したらボタンを出さない: 能力ではない見出し(「文字起こしを手動で追加」など)・
|
|
11700
|
+
* カタログ外のアダプタ・写しに無いツール。名前の無い説明を出すより出さないほうがよい
|
|
11701
|
+
*/
|
|
11702
|
+
function permissionToolsFor(cap, adapter) {
|
|
11703
|
+
var list = ADAPTER_CATALOG[cap] || [];
|
|
11704
|
+
var ids = adapter ? (list.indexOf(adapter) >= 0 ? [adapter] : []) : list;
|
|
11705
|
+
var tools = (PERMISSIONS_DATA && PERMISSIONS_DATA.tools) || [];
|
|
11706
|
+
var out = [];
|
|
11707
|
+
ids.forEach(function (a) {
|
|
11708
|
+
var want = permissionToolId(a);
|
|
11709
|
+
for (var i = 0; i < tools.length; i++) {
|
|
11710
|
+
if (tools[i] && tools[i].id === want) { out.push(tools[i]); return; }
|
|
11711
|
+
}
|
|
11712
|
+
});
|
|
11713
|
+
return out;
|
|
11714
|
+
}
|
|
11715
|
+
|
|
11716
|
+
/**
|
|
11717
|
+
* ポータル配下(/p/<キー>/ の下)で開いているか(#379・#841)。
|
|
11718
|
+
* ヘッダーの「プロジェクト一覧へ」と[権限]の「すべてのツールの一覧」が同じ判定を引く
|
|
11719
|
+
* ——写しを 2 本にしない
|
|
11720
|
+
*/
|
|
11721
|
+
function underPortal() {
|
|
11722
|
+
return /^\\/p\\/[^/]+\\//.test(location.pathname);
|
|
11723
|
+
}
|
|
11724
|
+
|
|
11725
|
+
/** 権限の表(表記・読む/書く・何のために)。綴りは表記の列だけに閉じ込める */
|
|
11726
|
+
function permissionTable(caption, grants) {
|
|
11727
|
+
var rows = grants.map(function (g) {
|
|
11728
|
+
return el("tr", null, [
|
|
11729
|
+
el("td", null, [el("code", { text: g.spell })]),
|
|
11730
|
+
el("td", { class: "perm-access", text: g.accessText }),
|
|
11731
|
+
el("td", { text: g.purpose }),
|
|
11732
|
+
]);
|
|
11733
|
+
});
|
|
11734
|
+
return el("div", { class: "perm-table-wrap" }, [
|
|
11735
|
+
el("table", { class: "perm-table" }, [
|
|
11736
|
+
el("caption", { text: caption }),
|
|
11737
|
+
el("thead", null, [el("tr", null, [
|
|
11738
|
+
el("th", { scope: "col", text: "表記" }),
|
|
11739
|
+
el("th", { scope: "col", text: "読む/書く" }),
|
|
11740
|
+
el("th", { scope: "col", text: "何のために" }),
|
|
11741
|
+
])]),
|
|
11742
|
+
el("tbody", null, rows),
|
|
11743
|
+
]),
|
|
11744
|
+
]);
|
|
11745
|
+
}
|
|
11746
|
+
|
|
11747
|
+
/**
|
|
11748
|
+
* [権限]の節(#841)。**押したときに初めて組み立てる**——初めから DOM に置くと、
|
|
11749
|
+
* モーダルの中身を取り出して調べる既存の検査(expandAllCaps)の文字列に混ざる。
|
|
11750
|
+
*
|
|
11751
|
+
* 公開ページの冒頭の説明文は出さない(チャットのモーダルには開示文が既にある・繰り返さない)。
|
|
11752
|
+
* 「以前に接続した場合は…再承認…」の一文も公開ページ側だけ
|
|
11753
|
+
*/
|
|
11754
|
+
function buildPermissionSection(tools) {
|
|
11755
|
+
var sec = el("section", { class: "perm-sec" });
|
|
11756
|
+
tools.forEach(function (t) {
|
|
11757
|
+
var box = el("div", { class: "perm-tool", "data-perm-tool": t.id });
|
|
11758
|
+
box.appendChild(el("h3", { class: "perm-h", text: t.tool + " で Cortex が求める権限" }));
|
|
11759
|
+
[t.how, t.reach, t.tenancyText, t.note].forEach(function (line) {
|
|
11760
|
+
if (line) box.appendChild(el("p", { class: "perm-p", text: line }));
|
|
11761
|
+
});
|
|
11762
|
+
var cu = t.customer;
|
|
11763
|
+
if (cu) {
|
|
11764
|
+
if (cu.grants && cu.grants.length) {
|
|
11765
|
+
box.appendChild(permissionTable("お客様に許可していただく権限", cu.grants));
|
|
11766
|
+
}
|
|
11767
|
+
if (cu.approverText) box.appendChild(el("p", { class: "perm-p", text: cu.approverLabel + ": " + cu.approverText }));
|
|
11768
|
+
if (cu.share) box.appendChild(el("p", { class: "perm-p", text: "お願いすること: " + cu.share }));
|
|
11769
|
+
if (cu.keyOnly && cu.keyOnly.text) box.appendChild(el("p", { class: "perm-p", text: cu.keyOnly.text }));
|
|
11770
|
+
if (cu.notRequested && cu.notRequested.length) {
|
|
11771
|
+
var nr = el("p", { class: "perm-p" }, [document.createTextNode("次の権限は求めません: ")]);
|
|
11772
|
+
cu.notRequested.forEach(function (n, i) {
|
|
11773
|
+
if (i) nr.appendChild(document.createTextNode("、"));
|
|
11774
|
+
nr.appendChild(document.createTextNode(n.label + "("));
|
|
11775
|
+
nr.appendChild(el("code", { text: n.spell }));
|
|
11776
|
+
nr.appendChild(document.createTextNode(")"));
|
|
11777
|
+
});
|
|
11778
|
+
box.appendChild(nr);
|
|
11779
|
+
}
|
|
11780
|
+
}
|
|
11781
|
+
var ca = t.cortexAccount;
|
|
11782
|
+
if (ca) {
|
|
11783
|
+
box.appendChild(el("h4", { class: "perm-h4", text: "Cortex 側のアカウントが持つ権限" }));
|
|
11784
|
+
if (ca.text) box.appendChild(el("p", { class: "perm-p", text: ca.text }));
|
|
11785
|
+
if (ca.grants && ca.grants.length) box.appendChild(permissionTable("Cortex 側のアカウントが持つ権限", ca.grants));
|
|
11786
|
+
}
|
|
11787
|
+
var dg = t.delegated;
|
|
11788
|
+
if (dg) {
|
|
11789
|
+
box.appendChild(el("h4", { class: "perm-h4", text: "ご本人が AI の道具からつなぐとき" }));
|
|
11790
|
+
if (dg.text) box.appendChild(el("p", { class: "perm-p", text: dg.text }));
|
|
11791
|
+
if (dg.grants && dg.grants.length) box.appendChild(permissionTable("ご本人が AI の道具からつなぐとき", dg.grants));
|
|
11792
|
+
}
|
|
11793
|
+
sec.appendChild(box);
|
|
11794
|
+
});
|
|
11795
|
+
// 一覧(ポータルの公開ページ)はポータル配下でしか辿れない。Amplify や手元では出さない
|
|
11796
|
+
if (underPortal()) {
|
|
11797
|
+
sec.appendChild(el("p", { class: "perm-p perm-all" }, [
|
|
11798
|
+
el("a", { href: "/legal/security", target: "_blank", rel: "noopener", text: "すべてのツールの一覧 ↗" }),
|
|
11799
|
+
]));
|
|
11800
|
+
}
|
|
11801
|
+
return sec;
|
|
11802
|
+
}
|
|
11803
|
+
|
|
11804
|
+
/**
|
|
11805
|
+
* モーダルの見出し行に[権限]を差し込む(#841)。makeModal の引数は増やさない。
|
|
11806
|
+
* 見出し行は space-between なので、子を 3 つ並べると見出しが真ん中へ寄る——
|
|
11807
|
+
* [権限]と ✕ を右側の箱にまとめる。✕ へのフォーカス(showModal)はそのまま
|
|
11808
|
+
*/
|
|
11809
|
+
var permSeq = 0;
|
|
11810
|
+
function attachPermissionButton(m, tools) {
|
|
11811
|
+
var head = m.modal.querySelector(".modal-head");
|
|
11812
|
+
var x = head && head.querySelector(".modal-x");
|
|
11813
|
+
if (!head || !x) return;
|
|
11814
|
+
permSeq += 1;
|
|
11815
|
+
var secId = "perm-sec-" + permSeq;
|
|
11816
|
+
var btn = el("button", {
|
|
11817
|
+
class: "modal-perm", type: "button", "aria-expanded": "false", text: "権限",
|
|
11818
|
+
});
|
|
11819
|
+
var side = el("div", { class: "modal-head-side" });
|
|
11820
|
+
head.insertBefore(side, x);
|
|
11821
|
+
side.appendChild(btn);
|
|
11822
|
+
side.appendChild(x);
|
|
11823
|
+
var sec = null;
|
|
11824
|
+
btn.addEventListener("click", function () {
|
|
11825
|
+
var opening = btn.getAttribute("aria-expanded") !== "true";
|
|
11826
|
+
if (opening && !sec) {
|
|
11827
|
+
sec = buildPermissionSection(tools);
|
|
11828
|
+
sec.id = secId;
|
|
11829
|
+
// 指す先ができてから結ぶ(無い id を指させない)
|
|
11830
|
+
btn.setAttribute("aria-controls", secId);
|
|
11831
|
+
// 本文の先頭(見出し行の直後)
|
|
11832
|
+
m.modal.insertBefore(sec, head.nextSibling);
|
|
11833
|
+
}
|
|
11834
|
+
if (sec) sec.hidden = !opening;
|
|
11835
|
+
btn.setAttribute("aria-expanded", opening ? "true" : "false");
|
|
11836
|
+
});
|
|
11837
|
+
}
|
|
11838
|
+
|
|
11639
11839
|
/**
|
|
11640
11840
|
* @param noteIsUnset その説明が「未接続(unset)」由来か。
|
|
11641
11841
|
* 🔴 **反映待ちで抑制してよいのはこれだけ。** この経路は「未接続」「OFFに設定されて
|
|
@@ -11651,6 +11851,9 @@ ${calendarAddUrl.toString()}
|
|
|
11651
11851
|
noteOpenCap(cap);
|
|
11652
11852
|
// 見出しは押したタイルのツール名(Backlog・Google ドライブ…)。capToolLabel の説明を参照
|
|
11653
11853
|
var m = makeModal(capToolLabel(cap, adapter), true);
|
|
11854
|
+
// [権限](#841)。ツールが決まらない・写しに無いときは出さない(permissionToolsFor の項)
|
|
11855
|
+
var permTools = permissionToolsFor(cap, adapter);
|
|
11856
|
+
if (permTools.length) attachPermissionButton(m, permTools);
|
|
11654
11857
|
// **何が読み取られるのかを必ず書く。** 一覧に並ぶものと読み取られるものの関係は、
|
|
11655
11858
|
// 書いていないと分からない(チャットは「載っていれば全部」、開発はリポジトリ単位でOFFできる)
|
|
11656
11859
|
if (cap === "チャット") {
|
|
@@ -20263,7 +20466,8 @@ ${calendarAddUrl.toString()}
|
|
|
20263
20466
|
*/
|
|
20264
20467
|
(function linkTitleToPortal() {
|
|
20265
20468
|
var a = document.getElementById("home-link");
|
|
20266
|
-
|
|
20469
|
+
// 判定は underPortal([権限]の一覧リンクと同じ 1 本・#841)
|
|
20470
|
+
if (!a || !underPortal()) return;
|
|
20267
20471
|
a.setAttribute("href", "/");
|
|
20268
20472
|
a.setAttribute("title", "プロジェクト一覧へ");
|
|
20269
20473
|
a.classList.add("site-title-portal");
|
package/package.json
CHANGED