@coda-console/protocol 6.27.0 → 6.29.0
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/CHANGELOG.md +15 -0
- package/README.md +11 -0
- package/accord.d.mts +50 -0
- package/accord.mjs +123 -0
- package/docs/agent-protocol.md +18 -0
- package/docs/protocol.md +32 -1
- package/package.json +9 -1
- package/schemas/plugin/agents.json +10 -3
- package/schemas/protocol/v1/agent.json +4 -2
- package/stable/manifest.json +10 -1
- package/validate.mjs +23 -1
- package/vectors/accord.json +548 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
版本规矩见 README 的[「版本」一节](README.md#版本)。协议自己的大版本写在协议名里(如 `coda/run@1`),与 npm 包版本、插件清单的 v2 独立;更早的版本见 git 历史。
|
|
4
4
|
|
|
5
|
+
## 6.29.0 — 2026-11-27
|
|
6
|
+
|
|
7
|
+
- 这是在 6.28.0 之上的次版本。依据 README「版本」一节:新增导出与测试向量升次版本;`stable/manifest.json`、`stable/view.json` 不动,清单 schema 没改,旧用法一律照旧。
|
|
8
|
+
- 新增 `@coda-console/protocol/accord`(`accord.mjs`,类型 `accord.d.mts`):Accord 公钥 `author` 怎样给人看的单一实现,供 Coda(Swift、后端、WebView 标准库)与各插件共用,不再各写一份。零依赖,只用标准 JS,不 import `node:*`、不用 `Buffer`,Node 与浏览器原生 ESM 都能直接加载。导出 `isAuthor`、`parseAuthor`、`shortAuthor`、`nicknameOf`、`tailOf`、`accordIdentity`、`identityTitle`、`disambiguateTails`、`identityTitles`、`identiconPattern`;算法与现行 Coda、`friends`、`friend-chat` 逐位一致:昵称按每 7 位一组至多读 36 组,尾号是公钥的 78 位十进制,同昵称撞号逐位向左加位消歧,头像是 5×5 水平轴对称的几何纹。
|
|
9
|
+
- 新增跨语言共用测试向量 `vectors/accord.json`,包内导出为 `@coda-console/protocol/vectors/accord.json`:昵称与尾号(含 `AccordChecks.swift` 的全部向量)、撞号消歧(含真实公钥构造的碰撞)、头像网格。契约见 `docs/protocol.md` 的「Accord 身份的显示」。
|
|
10
|
+
- `package.json` 的 `files` 与 `exports` 加入这三项;`test/accord.test.mjs` 守住全部导出、向量、边界入参,以及 `accord.mjs` 不含 `node:` 导入与 `Buffer`。
|
|
11
|
+
|
|
12
|
+
## 6.28.0 — 2026-11-27
|
|
13
|
+
|
|
14
|
+
- 这是在 6.27.0 之上的次版本。依据 README「版本」一节:Agent 清单的 `modes` 只加可选键并放宽 `auto`、`full`,升次版本;旧清单一律照旧合法(`test/fixtures/stable/` 的 Pi 样本与不写 `modes` 的清单都不变)。`stable/manifest.json` 的 revision 从 3 升到 6(每登记一条加一),新登记 `modes.manual`、`modes.safe[]`、`modes.default` 三条路径。
|
|
15
|
+
- `schemas/plugin/agents.json`:`contributes.agents[].modes` 新增 `manual`(人工审批档的 ACP 模式 ID)、`safe`(只读、规划等安全模式的 ID 数组,不重复,不写同空数组)、`default`(ACP 没报当前模式、`currentModeId` 为空串时,这个 Agent 默认相当于哪一档:`safe`、`manual`、`auto`、`full` 或 `null`);`auto`、`full` 放宽为模式 ID 或 `null`(新增 `$defs/modeIdOrNull`),`null` 表示没有这一档、不可选。
|
|
16
|
+
- `validate.mjs` 的 `contributionProblem` 校验 `agents` 时多查两条:一,同一个模式 ID 不能放进多个档位(`manual`、`auto`、`full` 与 `safe` 之间);二,`engines.coda` ≥ 21 的清单里每个 Agent 须写 `modes`,并显式写齐 `manual`、`auto`、`full`(值可为 `null`),没写 `engines.coda` 或小于 21 的清单不受此限。导出不变。同一模式 ID 不跨档的检查只对 `engines.coda` ≥ 21 或写了新键(`manual`、`safe`、`default`,或 `auto`、`full` 为 `null`)的清单生效;更早且没用新键的清单仍可让 `auto` 与 `full` 用同一个 ID。`contributionProblem` 只对内置的 `agents.json` 加这两条,传别的 schema 照旧只按它校验。
|
|
17
|
+
- `schemas/protocol/v1/agent.json`:`coda/agent@1` 的 `spawn` 输入新增可选 `parentApproval`(`safe`、`manual`、`auto`、`full`);`parentUnattended` 不再必填,改为与 `parentApproval` 至少写一个;两个都传以 `parentApproval` 为准,只传 `parentUnattended`(旧字段,已废弃)时 `true` 当作 `auto`、`false` 当作 `manual`。只传 `parentUnattended` 的旧调用方照旧合法。
|
|
18
|
+
- 文档:`docs/agent-protocol.md` 新增「权限档位」一节,写明四档偏序 `safe < manual < auto < full`、没登记的模式按 `auto` 算、`null` 与 API Level 21 的写齐要求、父会话的定级顺序(当前模式、`modes.default`、保守按 `manual`)和委派省略 `mode` 时的选档规则;`docs/protocol.md` 同步 `spawn` 的 `parentApproval`。
|
|
19
|
+
|
|
5
20
|
## 6.27.0 — 2026-11-24
|
|
6
21
|
|
|
7
22
|
- 这是在 6.26.0 之上的次版本。依据 README「版本」一节:新增可选的清单键升次版本;这两个键暂不进稳定面,`stable/` 不动,旧清单不受影响(没写这两个键的清单照旧合法)。
|
package/README.md
CHANGED
|
@@ -95,6 +95,17 @@ parseBlobPath('plugins/wechat/services/media/a.jpg'); // { kind: 'service', plug
|
|
|
95
95
|
parseBlobPath('content/' + 'f'.repeat(64)); // { kind: 'content', sha256: 'ffff…' },内容寻址:64 位小写十六进制 SHA-256
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
```js
|
|
99
|
+
import { identityTitles, nicknameOf, tailOf, accordIdentity, identiconPattern } from '@coda-console/protocol/accord';
|
|
100
|
+
|
|
101
|
+
// Accord 公钥(author,`ed25519:<64 位小写十六进制>`)怎样给人看:昵称、78 位十进制尾号、撞号消歧后的标题、5×5 头像网格。
|
|
102
|
+
// 零依赖,只用标准 JS(Uint8Array、BigInt),不 import 任何 node: 模块、不用 Buffer,Node 与浏览器原生 ESM 都能直接跑。
|
|
103
|
+
// 跨语言共用测试向量在 `@coda-console/protocol/vectors/accord.json`,Swift 与各插件拿它对齐。
|
|
104
|
+
accordIdentity(author); // { author, key, short, name, tail, tag },author 不合法给 null
|
|
105
|
+
identityTitles(authors); // Map<author, 'sakura #8283'>:同昵称撞了末 4 位就向左加位('xs #14084');解不出昵称的给 8 位十六进制
|
|
106
|
+
identiconPattern(author); // 5×5 水平轴对称的布尔网格,亮格 8 到 18 个;也收 32 字节公钥
|
|
107
|
+
```
|
|
108
|
+
|
|
98
109
|
```js
|
|
99
110
|
import { workflowProblem, readWorkflow, fieldProblem, fieldsProblem, optionsProblem, joinInputNames, CODA_FIELDS, CODA_OPTIONS } from '@coda-console/protocol/workflow';
|
|
100
111
|
|
package/accord.d.mts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Types of `@coda-console/protocol/accord`: the pure functions that read an Accord author as a person sees it.
|
|
2
|
+
declare const authorBrand: unique symbol;
|
|
3
|
+
/** `ed25519:` and 64 lowercase hex digits; only `isAuthor` (or a function returning one) makes it, so a string is not one until checked. */
|
|
4
|
+
export type Author = `ed25519:${string}` & { readonly [authorBrand]: true };
|
|
5
|
+
|
|
6
|
+
export interface AccordIdentity {
|
|
7
|
+
author: Author;
|
|
8
|
+
/** The 32 bytes of the public key. */
|
|
9
|
+
key: Uint8Array;
|
|
10
|
+
/** The first 8 hex digits of the key. */
|
|
11
|
+
short: string;
|
|
12
|
+
/** The nickname the key spells; '' when it spells none. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** The key as a decimal number, 78 digits wide. */
|
|
15
|
+
tail: string;
|
|
16
|
+
/** The last 4 digits of `tail`. */
|
|
17
|
+
tag: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface TailEntry {
|
|
21
|
+
/** What entries are told apart within: the nickname. Anything but a non-empty string means no one to be told apart from. */
|
|
22
|
+
stem?: unknown;
|
|
23
|
+
/** A non-empty string of ASCII digits; anything else gives '' and is no one's collision. */
|
|
24
|
+
tail?: unknown;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DisambiguateOptions {
|
|
28
|
+
/** How many digits at least, a positive integer (default 4). */
|
|
29
|
+
minDigits?: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isAuthor(value: unknown): value is Author;
|
|
33
|
+
/** The 32 bytes of a valid author, or null. */
|
|
34
|
+
export function parseAuthor(author: unknown): Uint8Array | null;
|
|
35
|
+
/** The first 8 hex digits of a valid author, or ''. */
|
|
36
|
+
export function shortAuthor(author: unknown): string;
|
|
37
|
+
/** The nickname a key spells: a 32-byte key or a valid author. '' for a non-author or a key that spells none; throws a `TypeError` for a `Uint8Array` of another length. */
|
|
38
|
+
export function nicknameOf(input: unknown): string;
|
|
39
|
+
/** The key as a 78-digit decimal number: a 32-byte `Uint8Array` or a valid author. '' for anything else; throws a `TypeError` for a `Uint8Array` of another length. */
|
|
40
|
+
export function tailOf(input: unknown): string;
|
|
41
|
+
/** null for what is not a valid author. */
|
|
42
|
+
export function accordIdentity(author: unknown): AccordIdentity | null;
|
|
43
|
+
/** `name #tag`, the short form when the key spells no nickname, `fallback` for a non-author. */
|
|
44
|
+
export function identityTitle(author: unknown, fallback?: string): string;
|
|
45
|
+
/** For each entry, the suffix of its decimal tail that tells it apart from the others of its stem; throws a `RangeError` for a `minDigits` that is not a positive integer. */
|
|
46
|
+
export function disambiguateTails(entries: Iterable<TailEntry>, options?: DisambiguateOptions): string[];
|
|
47
|
+
/** Each valid author of `authors` (once) and its title, with the tag lengthened where two of one nickname would collide. */
|
|
48
|
+
export function identityTitles(authors: Iterable<unknown>, options?: DisambiguateOptions): Map<Author, string>;
|
|
49
|
+
/** A 5×5 grid, mirrored left to right, 8 to 18 cells lit: from a `Uint8Array`'s bytes, a valid author's key, or else the code points of the text (`String(input ?? '')`). */
|
|
50
|
+
export function identiconPattern(input: unknown): boolean[][];
|
package/accord.mjs
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// What an Accord author (`ed25519:<64 lowercase hex>`) looks like to a person: its short form, the nickname its key spells, its
|
|
2
|
+
// 78-digit decimal tail, the tail's suffix that tells two of one nickname apart, and the 5×5 identicon. Pure: only standard
|
|
3
|
+
// JavaScript (Uint8Array, BigInt), so it runs in a page too. The vectors in vectors/accord.json are what Swift (AccordNickname.swift) and the plugins
|
|
4
|
+
// check themselves against; test/accord.test.mjs holds this file to them.
|
|
5
|
+
const AUTHOR = /^ed25519:([0-9a-f]{64})$/;
|
|
6
|
+
const DIGITS = /^[0-9]+$/;
|
|
7
|
+
const NICKNAME_GROUPS = 36;
|
|
8
|
+
const TAIL_LENGTH = 78;
|
|
9
|
+
|
|
10
|
+
export const isAuthor = value => typeof value === 'string' && AUTHOR.test(value);
|
|
11
|
+
|
|
12
|
+
// The 32 bytes of a valid author, or null.
|
|
13
|
+
export function parseAuthor(author) {
|
|
14
|
+
const hex = typeof author === 'string' ? AUTHOR.exec(author)?.[1] : undefined;
|
|
15
|
+
return hex === undefined ? null : Uint8Array.from({ length: 32 }, (_, i) => parseInt(hex.slice(i * 2, i * 2 + 2), 16));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// The first 8 hex digits of a valid author, or ''.
|
|
19
|
+
export const shortAuthor = author => isAuthor(author) ? author.slice(8, 16) : '';
|
|
20
|
+
|
|
21
|
+
// A 32-byte key as given, or as an author spells it; null for an author that is not one. A Uint8Array of another length throws.
|
|
22
|
+
function keyOf(input) {
|
|
23
|
+
if (input instanceof Uint8Array) {
|
|
24
|
+
if (input.length !== 32) throw new TypeError('a public key is 32 bytes');
|
|
25
|
+
return input;
|
|
26
|
+
}
|
|
27
|
+
return parseAuthor(input);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Reads the key 7 bits at a time, 36 groups at most (the last 4 bits are not read): 0-77 spell a letter (mod 26), 78-87 a digit,
|
|
31
|
+
// 88-127 end the name once it has 2 characters and are skipped before that. '' when fewer than 2 characters are spelled.
|
|
32
|
+
export function nicknameOf(input) {
|
|
33
|
+
const key = keyOf(input);
|
|
34
|
+
if (key === null) return '';
|
|
35
|
+
let name = '', bit = 0;
|
|
36
|
+
for (let group = 0; group < NICKNAME_GROUPS; group++) {
|
|
37
|
+
let v = 0;
|
|
38
|
+
for (let i = 0; i < 7; i++, bit++) v = (v << 1) | ((key[bit >> 3] >> (7 - (bit & 7))) & 1);
|
|
39
|
+
if (v < 78) name += String.fromCharCode(97 + (v % 26));
|
|
40
|
+
else if (v < 88) name += String(v - 78);
|
|
41
|
+
else if (name.length >= 2) return name;
|
|
42
|
+
}
|
|
43
|
+
return name.length >= 2 ? name : '';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// The key as a big-endian unsigned integer, in decimal, 78 digits wide; '' for an author that is not one.
|
|
47
|
+
export function tailOf(input) {
|
|
48
|
+
const key = keyOf(input);
|
|
49
|
+
return key === null ? '' : BigInt(`0x${Array.from(key, byte => byte.toString(16).padStart(2, '0')).join('')}`).toString().padStart(TAIL_LENGTH, '0');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function accordIdentity(author) {
|
|
53
|
+
const key = parseAuthor(author);
|
|
54
|
+
if (key === null) return null;
|
|
55
|
+
const tail = tailOf(key);
|
|
56
|
+
return { author, key, short: shortAuthor(author), name: nicknameOf(key), tail, tag: tail.slice(-4) };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// `name #tag` for an author whose key spells a nickname, its short form for one that spells none, `fallback` for a non-author.
|
|
60
|
+
export function identityTitle(author, fallback = '') {
|
|
61
|
+
const identity = accordIdentity(author);
|
|
62
|
+
if (identity === null) return fallback;
|
|
63
|
+
return identity.name === '' ? identity.short : `${identity.name} #${identity.tag}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// For each `{ stem, tail }`, the suffix of its decimal tail to show: `minDigits` at least, and as many more as it takes to differ
|
|
67
|
+
// from every other entry of the same non-empty stem. A suffix is one digit longer than the longest one it shares with another.
|
|
68
|
+
// Entries with the same whole tail are one person and never lengthen each other. '' for a tail that is not decimal digits.
|
|
69
|
+
export function disambiguateTails(entries, { minDigits = 4 } = {}) {
|
|
70
|
+
if (!Number.isInteger(minDigits) || minDigits < 1) throw new RangeError('minDigits is a positive integer');
|
|
71
|
+
const list = [...entries];
|
|
72
|
+
return list.map(({ stem, tail }) => {
|
|
73
|
+
if (typeof tail !== 'string' || !DIGITS.test(tail)) return '';
|
|
74
|
+
let digits = Math.min(minDigits, tail.length);
|
|
75
|
+
if (typeof stem === 'string' && stem !== '') {
|
|
76
|
+
for (const other of list) {
|
|
77
|
+
if (other.stem !== stem || typeof other.tail !== 'string' || !DIGITS.test(other.tail) || other.tail === tail) continue;
|
|
78
|
+
const limit = Math.min(tail.length, other.tail.length);
|
|
79
|
+
let same = 0;
|
|
80
|
+
while (same < limit && tail[tail.length - 1 - same] === other.tail[other.tail.length - 1 - same]) same++;
|
|
81
|
+
digits = Math.max(digits, Math.min(tail.length, same + 1));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return tail.slice(-digits);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Map of each valid author in `authors` (once) to its title: `name #suffix` with the suffix of disambiguateTails among those of
|
|
89
|
+
// the same nickname, or its short form when its key spells no nickname.
|
|
90
|
+
export function identityTitles(authors, { minDigits = 4 } = {}) {
|
|
91
|
+
const identities = [...new Set(authors)].map(accordIdentity).filter(identity => identity !== null);
|
|
92
|
+
const named = identities.filter(({ name }) => name !== '');
|
|
93
|
+
const suffixes = disambiguateTails(named.map(({ name, tail }) => ({ stem: name, tail })), { minDigits });
|
|
94
|
+
const titles = new Map(identities.filter(({ name }) => name === '').map(({ author, short }) => [author, short]));
|
|
95
|
+
named.forEach(({ author, name }, i) => titles.set(author, `${name} #${suffixes[i]}`));
|
|
96
|
+
return new Map(identities.map(({ author }) => [author, titles.get(author)]));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// A 5×5 grid, mirrored left to right (`grid[r][c] === grid[r][4 - c]`), 8 to 18 cells lit, the same for the same input always:
|
|
100
|
+
// from the bytes of a Uint8Array, of a valid author, or else the code points of its text. FNV-1a seeds, mulberry32 draws.
|
|
101
|
+
export function identiconPattern(input) {
|
|
102
|
+
let bytes;
|
|
103
|
+
if (input instanceof Uint8Array) bytes = input;
|
|
104
|
+
else {
|
|
105
|
+
const text = String(input ?? '');
|
|
106
|
+
bytes = parseAuthor(text) ?? [...text].map(ch => ch.codePointAt(0));
|
|
107
|
+
}
|
|
108
|
+
let seed = 0x811c9dc5;
|
|
109
|
+
for (const byte of bytes) seed = Math.imul(seed ^ byte, 0x01000193) >>> 0;
|
|
110
|
+
for (;;) {
|
|
111
|
+
seed = (seed + 0x6d2b79f5) >>> 0;
|
|
112
|
+
let t = seed;
|
|
113
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
114
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
115
|
+
const draw = (t ^ (t >>> 14)) >>> 0;
|
|
116
|
+
const grid = Array.from({ length: 5 }, (_, r) => {
|
|
117
|
+
const half = [0, 1, 2].map(c => ((draw >>> (r * 3 + c)) & 1) === 1);
|
|
118
|
+
return [half[0], half[1], half[2], half[1], half[0]];
|
|
119
|
+
});
|
|
120
|
+
const active = grid.flat().filter(Boolean).length;
|
|
121
|
+
if (active >= 8 && active <= 18) return grid;
|
|
122
|
+
}
|
|
123
|
+
}
|
package/docs/agent-protocol.md
CHANGED
|
@@ -106,6 +106,24 @@ ACP 只允许在一轮(`session/prompt`)进行时交互。Agent 在两轮之
|
|
|
106
106
|
Coda 记下每个 Agent 最近一次握手报的值,随后端遥测上报(Coda 遥测服务(Coda 的 docs/../telemetry/README.md「后端上报」)),用于复盘 Agent 版本带来的兼容问题;
|
|
107
107
|
只取版本号式的字符(字母、数字与 `.+()-_` 空格,至多 64 个),其他写法不记。不报不影响会话。
|
|
108
108
|
|
|
109
|
+
## 权限档位
|
|
110
|
+
|
|
111
|
+
Agent 的审批模式(ACP 的 mode)按权限高低归到四档,偏序是 `safe < manual < auto < full`。Agent 插件在清单 `contributes.agents[].modes`([agents.json](../schemas/plugin/agents.json))里登记:
|
|
112
|
+
|
|
113
|
+
| 键 | 含义 |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| `manual` | 人工审批档的 ACP 模式 ID |
|
|
116
|
+
| `auto` | 自动审批档的 ACP 模式 ID |
|
|
117
|
+
| `full` | 完全放行档的 ACP 模式 ID |
|
|
118
|
+
| `safe` | 只读、规划等安全模式的 ACP 模式 ID 列表(如 `plan`、`ask`、`dontAsk`),不写同空列表,不重复 |
|
|
119
|
+
| `default` | ACP 没报当前模式(`currentModeId` 为空串)时,这个 Agent 默认相当于哪一档:`safe`、`manual`、`auto`、`full` 或 `null` |
|
|
120
|
+
|
|
121
|
+
- `manual`、`auto`、`full` 都可以写 `null`(或不写),表示 Agent 没有这一档、不可选。API Level 21 起(`engines.coda` ≥ 21)Agent 插件须写 `modes` 并显式写齐这三个键,没有的一档写 `null`;更早的清单不受此限。
|
|
122
|
+
- 同一个模式 ID 只能属于一档:`manual`、`auto`、`full` 与 `safe` 里的 ID 两两不能相同。这条对 API Level ≥ 21 的清单,或写了新版档位特性(`manual`、`safe`、`default`,或 `auto`/`full` 为 `null`)的清单检查;只用旧版 `auto`/`full` 字符串的旧清单按稳定面保持兼容,不查。没登记在这四处的其余模式 ID 按 `auto` 算。
|
|
123
|
+
- **父会话的档位**:委派时先定父会话的档位。优先取运行中 ACP 实际报告的当前模式;它为空就读 `modes.default`;仍为空则保守按 `manual`。
|
|
124
|
+
- **委派选档**:委派(`spawn`、`new_session` 等)省略 `mode` 时,向下取不高于父会话档位的最高已登记档位:`full` 父依次试 `full`、`auto`、`manual`;`auto` 父试 `auto`、`manual`;`manual` 父只试 `manual`;`safe` 父取 `safe` 列表的第一个,不会自动落到 `safe`(从更高档往下止步于 `manual`)。没有可用档位时拒绝派出。
|
|
125
|
+
- 首轮 `session/prompt` 之前设档(`session/set_mode`)失败,拒绝启动这个会话,不带着未知档位开跑。
|
|
126
|
+
|
|
109
127
|
## 配置探测
|
|
110
128
|
|
|
111
129
|
Coda 读 Agent 的模型与模式目录时,不必建一个真实的原生会话:对声明了该能力的 Agent,改请它开一个只在当前连接里有效的虚拟会话。
|
package/docs/protocol.md
CHANGED
|
@@ -469,7 +469,7 @@ status:
|
|
|
469
469
|
|
|
470
470
|
`models[].efforts` 是 `[{ id, name?, shortName? }]`;`models[].options` 是 `{ id, name?, shortName?, type: "boolean"|"select", choices? }`,`select` 带 `choices`,`boolean` 不带。status 是空对象。
|
|
471
471
|
|
|
472
|
-
操作 `spawn`(`run: true`):在这台机器上用这个 Agent 开一个子会话,返回运行引用。输入是 `{ projectId, threadId, title, text, settings?, checkout?, parentTitle, parentUnattended }`:子会话所在的项目与工作树(`checkout`)、Agent 的设置(`settings`,如模型与推理强度)、标题与第一条任务(`text`);`threadId` 是调用方给的子会话 ID,重试找到的是同一个;`parentTitle` 是发起方在这里显示的名字,`parentUnattended`
|
|
472
|
+
操作 `spawn`(`run: true`):在这台机器上用这个 Agent 开一个子会话,返回运行引用。输入是 `{ projectId, threadId, title, text, settings?, checkout?, parentTitle, parentUnattended?, parentApproval? }`:子会话所在的项目与工作树(`checkout`)、Agent 的设置(`settings`,如模型与推理强度)、标题与第一条任务(`text`);`threadId` 是调用方给的子会话 ID,重试找到的是同一个;`parentTitle` 是发起方在这里显示的名字,`parentUnattended`(旧字段,已废弃)说发起方是否无人值守;`parentApproval`(`safe`、`manual`、`auto`、`full`)说发起方的权限档位,省略 `settings` 里的模式时,子会话据此选不高于它的最高档(规则见 [Agent 接入协议](agent-protocol.md#权限档位))。两个至少写一个。同时传 `parentApproval` 与 `parentUnattended` 时以 `parentApproval` 为准;只传 `parentUnattended` 时,`true` 当作 `auto`,`false` 当作 `manual`,旧调用方照旧可用。子会话为谁工作由调用信封的 `parent` 说,不写在输入里;`parent` 不是会话、是登记过的调用方记录时,开的是顶层会话,不是子会话。
|
|
473
473
|
|
|
474
474
|
```json
|
|
475
475
|
{
|
|
@@ -800,6 +800,37 @@ status:
|
|
|
800
800
|
}
|
|
801
801
|
```
|
|
802
802
|
|
|
803
|
+
## Accord 身份的显示
|
|
804
|
+
|
|
805
|
+
`@coda-console/protocol/accord`(`accord.mjs`,类型在 `accord.d.mts`)是 Accord 公钥 `author`(`ed25519:<64 位小写十六进制>`)怎样给人看的唯一实现:Coda 的 Swift 客户端与后端、各插件都与它逐位一致,不各写一份。纯函数,零依赖,只用标准 JS(`Uint8Array`、`BigInt`),不 import 任何 `node:*` 模块、不用 `Buffer`,Node 与浏览器(WKWebView)的原生 ESM 都能直接加载。`test/accord.test.mjs` 守着这一点。
|
|
806
|
+
|
|
807
|
+
| 函数 | 约定 |
|
|
808
|
+
| --- | --- |
|
|
809
|
+
| `isAuthor(value)` | 是不是合法的 `author` |
|
|
810
|
+
| `parseAuthor(author)` | 合法给 32 字节 `Uint8Array`,否则 `null` |
|
|
811
|
+
| `shortAuthor(author)` | 合法给 `ed25519:` 后的前 8 位十六进制,否则 `''` |
|
|
812
|
+
| `nicknameOf(input)` | 公钥拼出的昵称;`input` 是 32 字节 `Uint8Array` 或 `author`。非 32 字节的 `Uint8Array` 抛 `TypeError`;非合法 `author` 或别的值给 `''`;拼不出 2 个字符给 `''` |
|
|
813
|
+
| `tailOf(input)` | 公钥按大端无符号整数写成的十进制,左补 `0` 到 78 位;输入规则同 `nicknameOf` |
|
|
814
|
+
| `accordIdentity(author)` | `{ author, key, short, name, tail, tag }`,`tag` 是 `tail` 的末 4 位;非法给 `null` |
|
|
815
|
+
| `identityTitle(author, fallback = '')` | 有昵称给 `name #tag`,没有昵称给 `short`,非法给 `fallback` |
|
|
816
|
+
| `disambiguateTails(entries, { minDigits = 4 })` | `entries` 是 `{ stem, tail }` 的数组或可迭代对象,返回等长的尾号后缀数组;`minDigits` 不是正整数抛 `RangeError` |
|
|
817
|
+
| `identityTitles(authors, { minDigits = 4 })` | 一组 `author`(可迭代,去重,只收合法的)到标题的 `Map`;有昵称的按昵称为主干消歧,没有昵称的给 `short` |
|
|
818
|
+
| `identiconPattern(input)` | 5×5 水平轴对称的布尔网格(`grid[r][c] === grid[r][4 - c]`),亮格 8 到 18 个;`input` 是 `Uint8Array`(按字节)、合法 `author`(按公钥)或别的文字(按字符码,空值当空串) |
|
|
819
|
+
|
|
820
|
+
**昵称**:公钥从第 0 字节最高位起每 7 位一组,至多读 36 组(最后 4 比特不读)。组的值 `v` 小于 78 是字母 `a` 起的第 `v % 26` 个,小于 88 是数字 `v - 78`;88 到 127 在昵称已有 2 个以上字符时结束,否则跳过这一组。读完后不足 2 个字符就没有昵称。
|
|
821
|
+
|
|
822
|
+
**撞号消歧**(`disambiguateTails`):每项的后缀至少 `minDigits` 位;同一个非空 `stem` 下,与另一个**尾号不同**的项比较,两者从最右位向左的公共后缀有 `same` 位,这一项就至少取 `same + 1` 位(不超过它自己的位数);完整尾号相同的项是同一个人,不互相加位,不会死循环。`tail` 不是非空的纯数字、或 `stem` 为空时不参与比较;`tail` 不是纯数字的项给 `''`。
|
|
823
|
+
|
|
824
|
+
**头像网格**:种子取字节的 FNV-1a,再用 mulberry32 取数,每次取数按 `draw >>> (行 * 3 + 列)` 读左 3 列并镜像,亮格数不在 8 到 18 就接着取下一个数。
|
|
825
|
+
|
|
826
|
+
共用测试向量 `vectors/accord.json` 随包导出(`@coda-console/protocol/vectors/accord.json`),Swift 的 `AccordChecks.swift`、后端与插件的测试直接引用它对齐,键如下:
|
|
827
|
+
|
|
828
|
+
- `identities`:每项 `{ hex, author, short, name, tail, tag, title }`,含全 0、全 `ff`、拼不出昵称与昵称到 36 个字符等边界;
|
|
829
|
+
- `invalidAuthors`:都不是合法 `author` 的字符串;
|
|
830
|
+
- `disambiguate`:每项 `{ name, minDigits, entries, suffixes }`;
|
|
831
|
+
- `identityTitles`:每项 `{ name, minDigits, authors, titles }`,用真实的 32 字节公钥构造同昵称、末 4 位十进制相同的撞号;`titles` 的键按 `Map` 的顺序;
|
|
832
|
+
- `identicons`:每项 `{ kind, input, rows }`,`rows` 是 5 行 0/1 字符串(1 是亮格),`kind` 为 `author` 或 `text`(非公钥的回退输入)。
|
|
833
|
+
|
|
803
834
|
## 版本
|
|
804
835
|
|
|
805
836
|
- 协议名里的大版本是协议自己的版本,和 npm 包版本、插件清单的 v2 独立。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coda-console/protocol",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.29.0",
|
|
4
4
|
"description": "Coda 的协议:插件清单的类型(JSON Schema)、通用校验器、协议定义与调用信封、流程方言与 Agent 接入协议",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
"resource-protocol.mjs",
|
|
23
23
|
"frames.mjs",
|
|
24
24
|
"blob.mjs",
|
|
25
|
+
"accord.mjs",
|
|
26
|
+
"accord.d.mts",
|
|
27
|
+
"vectors",
|
|
25
28
|
"plugin.d.mts",
|
|
26
29
|
"CHANGELOG.md",
|
|
27
30
|
"stable"
|
|
@@ -37,6 +40,11 @@
|
|
|
37
40
|
"./protocol": "./protocol.mjs",
|
|
38
41
|
"./frames": "./frames.mjs",
|
|
39
42
|
"./blob": "./blob.mjs",
|
|
43
|
+
"./accord": {
|
|
44
|
+
"types": "./accord.d.mts",
|
|
45
|
+
"default": "./accord.mjs"
|
|
46
|
+
},
|
|
47
|
+
"./vectors/accord.json": "./vectors/accord.json",
|
|
40
48
|
"./types": "./plugin.d.mts",
|
|
41
49
|
"./stable/*": "./stable/*"
|
|
42
50
|
},
|
|
@@ -18,14 +18,17 @@
|
|
|
18
18
|
},
|
|
19
19
|
"command": {"$ref": "common.json#/$defs/command"},
|
|
20
20
|
"modes": {
|
|
21
|
-
"description": "审批档位的说法:title 不超过 10 字,unset 不超过 20 字,note 不超过 100
|
|
21
|
+
"description": "审批档位的说法:title 不超过 10 字,unset 不超过 20 字,note 不超过 100 字。manual、auto、full 各是该档对应的 ACP 模式 ID(不超过 200 字),写 null 表示 Agent 没有这一档、不可选;API Level 21 起(engines.coda ≥ 21)三个键须写齐,更早的清单可以不写。safe 是只读、规划等安全模式的 ACP 模式 ID 列表,不写同空列表。档位从低到高是 safe < manual < auto < full,同一个模式 ID 只能放在一档里(API Level ≥ 21,或写了 manual、safe、default、null 的 auto/full 等新版特性的清单才检查;只用旧版 auto、full 字符串的旧清单保持兼容);没登记在这四处的其余模式按 auto 算。default 是 ACP 没报当前模式(currentModeId 为空串)时这个 Agent 默认相当于哪一档,null 或不写表示不知道",
|
|
22
22
|
"type": "object",
|
|
23
23
|
"properties": {
|
|
24
24
|
"title": {"$ref": "common.json#/$defs/line10"},
|
|
25
25
|
"unset": {"$ref": "common.json#/$defs/line20"},
|
|
26
26
|
"note": {"$ref": "common.json#/$defs/line100"},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
27
|
+
"manual": {"$ref": "#/$defs/modeIdOrNull"},
|
|
28
|
+
"auto": {"$ref": "#/$defs/modeIdOrNull"},
|
|
29
|
+
"full": {"$ref": "#/$defs/modeIdOrNull"},
|
|
30
|
+
"safe": {"type": "array", "items": {"$ref": "common.json#/$defs/line200"}, "uniqueItems": true},
|
|
31
|
+
"default": {"enum": ["safe", "manual", "auto", "full", null]}
|
|
29
32
|
},
|
|
30
33
|
"additionalProperties": false
|
|
31
34
|
},
|
|
@@ -41,6 +44,10 @@
|
|
|
41
44
|
},
|
|
42
45
|
"x-unique-by": ["id"],
|
|
43
46
|
"$defs": {
|
|
47
|
+
"modeIdOrNull": {
|
|
48
|
+
"description": "一档对应的 ACP 模式 ID,null 表示没有这一档",
|
|
49
|
+
"anyOf": [{"$ref": "common.json#/$defs/line200"}, {"type": "null"}]
|
|
50
|
+
},
|
|
44
51
|
"icon": {
|
|
45
52
|
"description": "插件目录里的 PDF,不超过 32 KiB",
|
|
46
53
|
"allOf": [{"$ref": "common.json#/$defs/line1000"}],
|
|
@@ -81,9 +81,11 @@
|
|
|
81
81
|
"settings": {"type": "object", "additionalProperties": true},
|
|
82
82
|
"checkout": {"type": "object", "additionalProperties": true},
|
|
83
83
|
"parentTitle": {"type": "string"},
|
|
84
|
-
"parentUnattended": {"type": "boolean"}
|
|
84
|
+
"parentUnattended": {"type": "boolean"},
|
|
85
|
+
"parentApproval": {"enum": ["safe", "manual", "auto", "full"]}
|
|
85
86
|
},
|
|
86
|
-
"required": ["projectId", "threadId", "title", "text", "parentTitle"
|
|
87
|
+
"required": ["projectId", "threadId", "title", "text", "parentTitle"],
|
|
88
|
+
"anyOf": [{"required": ["parentUnattended"]}, {"required": ["parentApproval"]}],
|
|
87
89
|
"additionalProperties": false
|
|
88
90
|
}
|
|
89
91
|
}
|
package/stable/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"revision":
|
|
2
|
+
"revision": 6,
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
5
|
"path": "name"
|
|
@@ -70,6 +70,15 @@
|
|
|
70
70
|
{
|
|
71
71
|
"path": "contributes.agents[].modes.full"
|
|
72
72
|
},
|
|
73
|
+
{
|
|
74
|
+
"path": "contributes.agents[].modes.manual"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"path": "contributes.agents[].modes.safe[]"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"path": "contributes.agents[].modes.default"
|
|
81
|
+
},
|
|
73
82
|
{
|
|
74
83
|
"path": "contributes.agents[].icon.dark"
|
|
75
84
|
},
|
package/validate.mjs
CHANGED
|
@@ -349,7 +349,29 @@ export function pointProblem(schema, value, where, dir = null) {
|
|
|
349
349
|
export function contributionProblem(schema, manifest, key, dir = null) {
|
|
350
350
|
const point = declared(schema);
|
|
351
351
|
return point.validate.call({ dir }, manifest.contributes[key], { instancePath: `/contributes/${escape(key)}`, parentData: manifest.contributes,
|
|
352
|
-
parentDataProperty: key, rootData: manifest, dynamicAnchors: {} }) ? null : explain(point.validate.errors, '', [point.schema]);
|
|
352
|
+
parentDataProperty: key, rootData: manifest, dynamicAnchors: {} }) ? (key === 'agents' && (schema === SCHEMAS['agents.json'] || schema?.$id === SCHEMAS['agents.json'].$id) && Array.isArray(manifest.contributes?.agents) ? agentsProblem(manifest) : null) : explain(point.validate.errors, '', [point.schema]);
|
|
353
|
+
}
|
|
354
|
+
// What the agents schema cannot say of its values as they stand to each other, the shapes being right by now: from API Level 21
|
|
355
|
+
// (`engines.coda`) an agent writes `modes` with `manual`, `auto` and `full` all there, each an ID or null; and a mode ID sits in
|
|
356
|
+
// one tier only (`manual`, `auto`, `full`, or the list `safe`) — for a manifest of API Level 21 or one that writes a newer
|
|
357
|
+
// `modes` key (`manual`, `safe`, `default`, or a null `auto` or `full`); an older one may still give `auto` and `full` one ID.
|
|
358
|
+
function agentsProblem({ engines, contributes }) {
|
|
359
|
+
const strict = engines?.coda >= 21;
|
|
360
|
+
for (const [i, { modes }] of contributes.agents.entries()) {
|
|
361
|
+
const at = `contributes.agents[${i}]`;
|
|
362
|
+
if (modes === undefined) { if (strict) return `${at} 缺 modes:engines.coda 为 21 起,Agent 须写 modes,并写齐 manual、auto、full`; continue; }
|
|
363
|
+
const missing = ['manual', 'auto', 'full'].find(tier => !Object.hasOwn(modes, tier));
|
|
364
|
+
if (strict && missing) return `${at}.modes 缺 ${missing}:engines.coda 为 21 起须写齐 manual、auto、full,没有这一档就写 null`;
|
|
365
|
+
const newer = ['manual', 'safe', 'default'].some(key => Object.hasOwn(modes, key)) || modes.auto === null || modes.full === null;
|
|
366
|
+
if (!strict && !newer) continue;
|
|
367
|
+
const tiers = new Map();
|
|
368
|
+
for (const [tier, id] of [['manual', modes.manual], ['auto', modes.auto], ['full', modes.full], ...(modes.safe ?? []).map(id => ['safe', id])]) {
|
|
369
|
+
if (id === null || id === undefined) continue;
|
|
370
|
+
if (tiers.has(id)) return `${at}.modes:模式 ID「${id}」不能同时放在 ${tiers.get(id)} 和 ${tier},一个模式只属于一档`;
|
|
371
|
+
tiers.set(id, tier);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return null;
|
|
353
375
|
}
|
|
354
376
|
|
|
355
377
|
// The serialized size of a value in UTF-8 bytes, `{ ok: true, bytes }`, or why it has none, `{ ok: false, error }`: what
|
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
{
|
|
2
|
+
"identities": [
|
|
3
|
+
{
|
|
4
|
+
"hex": "24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab",
|
|
5
|
+
"author": "ed25519:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab",
|
|
6
|
+
"short": "24005142",
|
|
7
|
+
"name": "sakura",
|
|
8
|
+
"tail": "016283823373196459620642706821646928142256768952056557996360219804530892538283",
|
|
9
|
+
"tag": "8283",
|
|
10
|
+
"title": "sakura #8283"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"hex": "390819ab193264c993264c993264c993264c993264c993264c993264c993270f",
|
|
14
|
+
"author": "ed25519:390819ab193264c993264c993264c993264c993264c993264c993264c993270f",
|
|
15
|
+
"short": "390819ab",
|
|
16
|
+
"name": "coda",
|
|
17
|
+
"tail": "025796144302227499116560651570427453346426747217764480651352477067654213084943",
|
|
18
|
+
"tag": "4943",
|
|
19
|
+
"title": "coda #4943"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"hex": "0438180a1fed5ab56ad5ab56ad5ab56ad5ab56ad5ab56ad5ab56ad5ab56affff",
|
|
23
|
+
"author": "ed25519:0438180a1fed5ab56ad5ab56ad5ab56ad5ab56ad5ab56ad5ab56ad5ab56affff",
|
|
24
|
+
"short": "0438180a",
|
|
25
|
+
"name": "coda2",
|
|
26
|
+
"tail": "001908360744834767670932787230931174860391892938896223435717190565378994667519",
|
|
27
|
+
"tag": "7519",
|
|
28
|
+
"title": "coda2 #7519"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"hex": "b1ff20abe86c0000000000000000000000000000000000000000000000000000",
|
|
32
|
+
"author": "ed25519:b1ff20abe86c0000000000000000000000000000000000000000000000000000",
|
|
33
|
+
"short": "b1ff20ab",
|
|
34
|
+
"name": "kh",
|
|
35
|
+
"tail": "080510145691267496417075659893654907346422871117988330772834389711103878758400",
|
|
36
|
+
"tag": "8400",
|
|
37
|
+
"title": "kh #8400"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"hex": "9d56c050a142850a142850a142850a142850a142850a142850a142850a142710",
|
|
41
|
+
"author": "ed25519:9d56c050a142850a142850a142850a142850a142850a142850a142850a142710",
|
|
42
|
+
"short": "9d56c050",
|
|
43
|
+
"name": "07",
|
|
44
|
+
"tail": "071166393384220724757113098518208155870811606365958828344208064729141635983120",
|
|
45
|
+
"tag": "3120",
|
|
46
|
+
"title": "07 #3120"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"hex": "9b5c04eb10204081020408102040810204081020408102040810204081021234",
|
|
50
|
+
"author": "ed25519:9b5c04eb10204081020408102040810204081020408102040810204081021234",
|
|
51
|
+
"short": "9b5c04eb",
|
|
52
|
+
"name": "z9a0",
|
|
53
|
+
"tail": "070271075404637019855828276758999161743191196202072788924145437593309148222004",
|
|
54
|
+
"tag": "2004",
|
|
55
|
+
"title": "z9a0 #2004"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"hex": "3203ffffffffffffffffffffffffffffffffffffffffffffffffffffffff002a",
|
|
59
|
+
"author": "ed25519:3203ffffffffffffffffffffffffffffffffffffffffffffffffffffffff002a",
|
|
60
|
+
"short": "3203ffff",
|
|
61
|
+
"name": "za",
|
|
62
|
+
"tail": "022622709817422432955984541199512328676655103815595425139789045801350703546410",
|
|
63
|
+
"tag": "6410",
|
|
64
|
+
"title": "za #6410"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"hex": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
68
|
+
"author": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
|
|
69
|
+
"short": "00000000",
|
|
70
|
+
"name": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
71
|
+
"tail": "000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
72
|
+
"tag": "0000",
|
|
73
|
+
"title": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa #0000"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"hex": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
77
|
+
"author": "ed25519:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
78
|
+
"short": "ffffffff",
|
|
79
|
+
"name": "",
|
|
80
|
+
"tail": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
|
|
81
|
+
"tag": "9935",
|
|
82
|
+
"title": "ffffffff"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
|
|
86
|
+
"author": "ed25519:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
|
|
87
|
+
"short": "00010203",
|
|
88
|
+
"name": "aaggyqkgdobq2synhd",
|
|
89
|
+
"tail": "000001780731860627700044960722568376592200742329637303199754547598369979440671",
|
|
90
|
+
"tag": "0671",
|
|
91
|
+
"title": "aaggyqkgdobq2synhd #0671"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"hex": "66c8aec217cac5fa9829e4e314c2dfe6f3b3710cbf2c4b4df462c333565b4e27",
|
|
95
|
+
"author": "ed25519:66c8aec217cac5fa9829e4e314c2dfe6f3b3710cbf2c4b4df462c333565b4e27",
|
|
96
|
+
"short": "66c8aec2",
|
|
97
|
+
"name": "zyv",
|
|
98
|
+
"tail": "046490486105048442293641588531420323991210115029903945753585556465004131864103",
|
|
99
|
+
"tag": "4103",
|
|
100
|
+
"title": "zyv #4103"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"hex": "2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734",
|
|
104
|
+
"author": "ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734",
|
|
105
|
+
"short": "2e4b9cc2",
|
|
106
|
+
"name": "xs",
|
|
107
|
+
"tail": "020939986474356556387344986264546814587009115178813918053369159061515022604084",
|
|
108
|
+
"tag": "4084",
|
|
109
|
+
"title": "xs #4084"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"hex": "01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
113
|
+
"author": "ed25519:01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
114
|
+
"short": "01ffffff",
|
|
115
|
+
"name": "",
|
|
116
|
+
"tail": "000904625697166532776746648320380374280103671755200316906558262375061821325311",
|
|
117
|
+
"tag": "5311",
|
|
118
|
+
"title": "01ffffff"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"invalidAuthors": [
|
|
122
|
+
"",
|
|
123
|
+
"ed25519:",
|
|
124
|
+
"ed25519:abc",
|
|
125
|
+
"24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab",
|
|
126
|
+
"ed25519:24005142202C7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01AB",
|
|
127
|
+
" ed25519:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab",
|
|
128
|
+
"ed25519:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab0",
|
|
129
|
+
"ed25519:4005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab",
|
|
130
|
+
"ed25519:gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg",
|
|
131
|
+
"ed448:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab"
|
|
132
|
+
],
|
|
133
|
+
"disambiguate": [
|
|
134
|
+
{
|
|
135
|
+
"name": "four digits stay four when nothing collides",
|
|
136
|
+
"minDigits": 4,
|
|
137
|
+
"entries": [
|
|
138
|
+
{
|
|
139
|
+
"stem": "a",
|
|
140
|
+
"tail": "12345678"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"stem": "a",
|
|
144
|
+
"tail": "87654321"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"stem": "b",
|
|
148
|
+
"tail": "0000"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"suffixes": [
|
|
152
|
+
"5678",
|
|
153
|
+
"4321",
|
|
154
|
+
"0000"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "a shared last four goes to five",
|
|
159
|
+
"minDigits": 4,
|
|
160
|
+
"entries": [
|
|
161
|
+
{
|
|
162
|
+
"stem": "a",
|
|
163
|
+
"tail": "9904084"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"stem": "a",
|
|
167
|
+
"tail": "9914084"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"suffixes": [
|
|
171
|
+
"04084",
|
|
172
|
+
"14084"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "layers of sharing go to five, six and seven",
|
|
177
|
+
"minDigits": 4,
|
|
178
|
+
"entries": [
|
|
179
|
+
{
|
|
180
|
+
"stem": "a",
|
|
181
|
+
"tail": "5551234"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"stem": "a",
|
|
185
|
+
"tail": "5541234"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"stem": "a",
|
|
189
|
+
"tail": "5441234"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"stem": "a",
|
|
193
|
+
"tail": "4441234"
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
"suffixes": [
|
|
197
|
+
"51234",
|
|
198
|
+
"541234",
|
|
199
|
+
"5441234",
|
|
200
|
+
"4441234"
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "another stem does not lengthen it",
|
|
205
|
+
"minDigits": 4,
|
|
206
|
+
"entries": [
|
|
207
|
+
{
|
|
208
|
+
"stem": "a",
|
|
209
|
+
"tail": "9904084"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"stem": "b",
|
|
213
|
+
"tail": "9914084"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"stem": "",
|
|
217
|
+
"tail": "1114084"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"stem": "",
|
|
221
|
+
"tail": "2224084"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"suffixes": [
|
|
225
|
+
"4084",
|
|
226
|
+
"4084",
|
|
227
|
+
"4084",
|
|
228
|
+
"4084"
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"name": "the same whole tail never loops",
|
|
233
|
+
"minDigits": 4,
|
|
234
|
+
"entries": [
|
|
235
|
+
{
|
|
236
|
+
"stem": "a",
|
|
237
|
+
"tail": "1234567"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"stem": "a",
|
|
241
|
+
"tail": "1234567"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"stem": "a",
|
|
245
|
+
"tail": "7234567"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"suffixes": [
|
|
249
|
+
"1234567",
|
|
250
|
+
"1234567",
|
|
251
|
+
"7234567"
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "a smaller minimum",
|
|
256
|
+
"minDigits": 2,
|
|
257
|
+
"entries": [
|
|
258
|
+
{
|
|
259
|
+
"stem": "a",
|
|
260
|
+
"tail": "12345"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"stem": "a",
|
|
264
|
+
"tail": "67845"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"stem": "b",
|
|
268
|
+
"tail": "999"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"suffixes": [
|
|
272
|
+
"345",
|
|
273
|
+
"845",
|
|
274
|
+
"99"
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "a larger minimum",
|
|
279
|
+
"minDigits": 6,
|
|
280
|
+
"entries": [
|
|
281
|
+
{
|
|
282
|
+
"stem": "a",
|
|
283
|
+
"tail": "123456789"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"stem": "a",
|
|
287
|
+
"tail": "223456789"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"suffixes": [
|
|
291
|
+
"123456789",
|
|
292
|
+
"223456789"
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "a minimum of one",
|
|
297
|
+
"minDigits": 1,
|
|
298
|
+
"entries": [
|
|
299
|
+
{
|
|
300
|
+
"stem": "a",
|
|
301
|
+
"tail": "10"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"stem": "a",
|
|
305
|
+
"tail": "20"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"stem": "a",
|
|
309
|
+
"tail": "30"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"suffixes": [
|
|
313
|
+
"10",
|
|
314
|
+
"20",
|
|
315
|
+
"30"
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "a tail shorter than the minimum is whole",
|
|
320
|
+
"minDigits": 4,
|
|
321
|
+
"entries": [
|
|
322
|
+
{
|
|
323
|
+
"stem": "a",
|
|
324
|
+
"tail": "12"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"stem": "a",
|
|
328
|
+
"tail": "012"
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
"suffixes": [
|
|
332
|
+
"12",
|
|
333
|
+
"012"
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"name": "tails of different lengths",
|
|
338
|
+
"minDigits": 4,
|
|
339
|
+
"entries": [
|
|
340
|
+
{
|
|
341
|
+
"stem": "a",
|
|
342
|
+
"tail": "123"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"stem": "a",
|
|
346
|
+
"tail": "0123"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"stem": "a",
|
|
350
|
+
"tail": "00123"
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
"suffixes": [
|
|
354
|
+
"123",
|
|
355
|
+
"0123",
|
|
356
|
+
"00123"
|
|
357
|
+
]
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"name": "what is no decimal tail gives nothing",
|
|
361
|
+
"minDigits": 4,
|
|
362
|
+
"entries": [
|
|
363
|
+
{
|
|
364
|
+
"stem": "a",
|
|
365
|
+
"tail": ""
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"stem": "a",
|
|
369
|
+
"tail": "12a4"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"stem": "a",
|
|
373
|
+
"tail": "-123"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"stem": "a",
|
|
377
|
+
"tail": 5
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"stem": "a"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"stem": "a",
|
|
384
|
+
"tail": "1234"
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
"suffixes": [
|
|
388
|
+
"",
|
|
389
|
+
"",
|
|
390
|
+
"",
|
|
391
|
+
"",
|
|
392
|
+
"",
|
|
393
|
+
"1234"
|
|
394
|
+
]
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
"identityTitles": [
|
|
398
|
+
{
|
|
399
|
+
"name": "real keys of one nickname colliding on their last digits",
|
|
400
|
+
"minDigits": 4,
|
|
401
|
+
"authors": [
|
|
402
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734",
|
|
403
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89fbe44",
|
|
404
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e8a11dd4",
|
|
405
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e8aed974",
|
|
406
|
+
"ed25519:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab",
|
|
407
|
+
"ed25519:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
408
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734",
|
|
409
|
+
"ed25519:xyz",
|
|
410
|
+
"nope",
|
|
411
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734"
|
|
412
|
+
],
|
|
413
|
+
"titles": {
|
|
414
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734": "xs #2604084",
|
|
415
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89fbe44": "xs #14084",
|
|
416
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e8a11dd4": "xs #704084",
|
|
417
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e8aed974": "xs #3604084",
|
|
418
|
+
"ed25519:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab": "sakura #8283",
|
|
419
|
+
"ed25519:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff": "ffffffff"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "a smaller minimum",
|
|
424
|
+
"minDigits": 2,
|
|
425
|
+
"authors": [
|
|
426
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734",
|
|
427
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89fbe44",
|
|
428
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e8a11dd4",
|
|
429
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e8aed974",
|
|
430
|
+
"ed25519:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab",
|
|
431
|
+
"ed25519:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
432
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734",
|
|
433
|
+
"ed25519:xyz",
|
|
434
|
+
"nope",
|
|
435
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734"
|
|
436
|
+
],
|
|
437
|
+
"titles": {
|
|
438
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89f9734": "xs #2604084",
|
|
439
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e89fbe44": "xs #14084",
|
|
440
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e8a11dd4": "xs #704084",
|
|
441
|
+
"ed25519:2e4b9cc2428beb7bff6a56c14d7304e472a23e890e91ef0a6b0b0380e8aed974": "xs #3604084",
|
|
442
|
+
"ed25519:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab": "sakura #83",
|
|
443
|
+
"ed25519:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff": "ffffffff"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
"identicons": [
|
|
448
|
+
{
|
|
449
|
+
"kind": "author",
|
|
450
|
+
"input": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
|
|
451
|
+
"rows": [
|
|
452
|
+
"10001",
|
|
453
|
+
"10001",
|
|
454
|
+
"11111",
|
|
455
|
+
"01010",
|
|
456
|
+
"10101"
|
|
457
|
+
]
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"kind": "author",
|
|
461
|
+
"input": "ed25519:24005142202c7fffffffffffffffffffffffffffffffffffffffffffffff01ab",
|
|
462
|
+
"rows": [
|
|
463
|
+
"00000",
|
|
464
|
+
"00000",
|
|
465
|
+
"01010",
|
|
466
|
+
"11111",
|
|
467
|
+
"11011"
|
|
468
|
+
]
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"kind": "author",
|
|
472
|
+
"input": "ed25519:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
|
|
473
|
+
"rows": [
|
|
474
|
+
"10101",
|
|
475
|
+
"01010",
|
|
476
|
+
"00100",
|
|
477
|
+
"00000",
|
|
478
|
+
"10101"
|
|
479
|
+
]
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"kind": "author",
|
|
483
|
+
"input": "ed25519:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
484
|
+
"rows": [
|
|
485
|
+
"10001",
|
|
486
|
+
"00000",
|
|
487
|
+
"10101",
|
|
488
|
+
"01110",
|
|
489
|
+
"10101"
|
|
490
|
+
]
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"kind": "text",
|
|
494
|
+
"input": "coda",
|
|
495
|
+
"rows": [
|
|
496
|
+
"10001",
|
|
497
|
+
"00100",
|
|
498
|
+
"10101",
|
|
499
|
+
"11111",
|
|
500
|
+
"01010"
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"kind": "text",
|
|
505
|
+
"input": "",
|
|
506
|
+
"rows": [
|
|
507
|
+
"10101",
|
|
508
|
+
"00100",
|
|
509
|
+
"01110",
|
|
510
|
+
"10101",
|
|
511
|
+
"10001"
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"kind": "text",
|
|
516
|
+
"input": "ed25519:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
|
517
|
+
"rows": [
|
|
518
|
+
"10101",
|
|
519
|
+
"11011",
|
|
520
|
+
"11111",
|
|
521
|
+
"11011",
|
|
522
|
+
"10001"
|
|
523
|
+
]
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"kind": "text",
|
|
527
|
+
"input": "ed25519:abc",
|
|
528
|
+
"rows": [
|
|
529
|
+
"00000",
|
|
530
|
+
"10101",
|
|
531
|
+
"01110",
|
|
532
|
+
"00000",
|
|
533
|
+
"10001"
|
|
534
|
+
]
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"kind": "text",
|
|
538
|
+
"input": "好友 😀",
|
|
539
|
+
"rows": [
|
|
540
|
+
"10001",
|
|
541
|
+
"00100",
|
|
542
|
+
"10101",
|
|
543
|
+
"10101",
|
|
544
|
+
"11111"
|
|
545
|
+
]
|
|
546
|
+
}
|
|
547
|
+
]
|
|
548
|
+
}
|