@0001-labs/idv1 0.3.4 → 0.3.5

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.
Files changed (3) hide show
  1. package/README.md +219 -2
  2. package/package.json +1 -1
  3. package/src/shapes.ts +0 -11
package/README.md CHANGED
@@ -59,7 +59,6 @@ A fixed character spends space. A list prefix leaves 26⁴ = 456,976 codes in ca
59
59
  | Connections | list | `04LLLL` | `04Gmai` |
60
60
  | Components | item | owner's `LL`, `1N`, `LL` | `Ds10Bu` |
61
61
  | Tool calls | product | `tc`, the HTTP verb (`G`, `P`, `U`, `D`), `LNN` | `tcGi02` |
62
- | Issue tags | event | `ixxxxx` | `iImpro` |
63
62
  | Engineers | account | `LLNNNN` | `Le0125` |
64
63
  | Agents | account | `aLNNNN` | `aG4008` |
65
64
  | Harnesses | product | `hLLLNN` | `hCla01` |
@@ -68,7 +67,7 @@ An app with many short-lived things should draw; one naming a small catalogue ca
68
67
 
69
68
  ### Junctions
70
69
 
71
- Codes joined by a hyphen name the place where things meet, and each part still says what it is: `1Ezoxx-tcGi02` is a tool of a project, `1Syste-Sy10Us-Sy10Fl` a path down a tree, `01Sysm-MJ99ST` an item in a list. `junction(...codes)` joins them and refuses anything that is not a code; `junctionParts(value)` reads one back with each part's kind.
70
+ Codes joined by a hyphen name the place where things meet, and each part still says what it is: `1Ezoxx-tcGi02` is a tool of a project, `1Systs-Sy10Us-Sy10Fl` a path down a tree, `01Sysm-MJ99ST` an item in a list. `junction(...codes)` joins them and refuses anything that is not a code; `junctionParts(value)` reads one back with each part's kind.
72
71
 
73
72
  ### Rules every template keeps
74
73
 
@@ -77,4 +76,222 @@ Codes joined by a hyphen name the place where things meet, and each part still s
77
76
  - **No blocked words or digits.** Check all of a code's letters together with `blockedCodeLetters`, and a product's last two digits against `BLOCKED_CODE_DIGITS`, before taking a candidate.
78
77
  - **Never two shapes for one code.** A template sits inside one shape, two templates in one app never make the same code, and a code names one thing: claim it with a unique constraint.
79
78
 
79
+ ## Numeric references in a message
80
+
81
+ Two agents can describe a graph using one line per fact: subject, relation, object. In this proposed text format, all three positions use the same IDv1 dictionary. Each line has three tokens separated by single ASCII spaces. LF separates lines. A final LF is optional.
82
+
83
+ Read left to right from an empty dictionary. On first use, send the literal six-character ID and give it the next number, starting at 1. On every later use, send its number in decimal with no leading zero. A six-character token is always a literal, even if all its characters are digits. A reference has one to five digits and must already have an entry. Start a new message before introducing a 100,000th distinct ID. Each message can then be decoded independently. Agents agree on what each relation means before exchanging messages.
84
+
85
+ ### System architecture
86
+
87
+ System’s Tags and tools directory supplies the entity IDs. The project and its MCP app both carry the short code `SYSM`. Their IDv1s distinguish them: the project is `1Systs` and the MCP app is `1Syste`. The directory gives Review the junction `1Systs-Sy11Re-Sy12Re` (System → Reach → Review) and the tool tagged `get_inventory` the junction `1Syste-tcGi04`. The seven relation IDs below are vocabulary proposed for this example.
88
+
89
+ The first four facts show how a number can move from the object position to the subject position:
90
+
91
+ ```text
92
+ 1Systs rHasPt Sy11Re
93
+ 1 2 Sy10Pr
94
+ 3 2 Sy10Ad
95
+ 3 2 Sy12Re
96
+ ```
97
+
98
+ The first line assigns 1 to System, 2 to “has part” and 3 to Reach. The second adds Projects under System. The third and fourth use 3 as their subject: Reach contains Ads and Review.
99
+
100
+ The snapshot covers the System inventory’s ownership tree, relationships into or out of System, outgoing relationships of its catalogued parts, requirements marked inapplicable, and tools in its MCP catalogue. It describes architectural relationships at the time of capture. Runtime state, permissions and tool arguments belong to other messages.
101
+
102
+ | Example relation | Meaning |
103
+ | --- | --- |
104
+ | `rHasPt` | Contains the object as a direct part |
105
+ | `rNeeds` | Depends on the object |
106
+ | `rShare` | Uses a shared implementation |
107
+ | `rLocal` | Implements the object locally |
108
+ | `rOppor` | Records a potential integration |
109
+ | `rNoApp` | Marks a requirement as inapplicable |
110
+ | `rTools` | Exposes the object as an MCP tool |
111
+
112
+ <details>
113
+ <summary>Full System message — 177 facts, 2,109 ASCII bytes without a trailing LF</summary>
114
+
115
+ ```text
116
+ 1Systs rHasPt Sy11Re
117
+ 1 2 Sy10Pr
118
+ 3 2 Sy10Ad
119
+ 3 2 Sy12Re
120
+ 1 2 Sy10In
121
+ 1 2 Sy10Sy
122
+ Sy10Us 2 Sy10Fl
123
+ 1 2 Sy10Ma
124
+ 1 2 Sy11Ma
125
+ 1 2 Sy11Si
126
+ 4 2 Sy12Co
127
+ 1 2 Sy10Ci
128
+ 1 2 Sy10Is
129
+ Sy12Se 2 Sy10Ap
130
+ 17 2 Sy10Di
131
+ 17 2 Sy10Ya
132
+ 17 2 Sy11Co
133
+ 1 2 9
134
+ 17 2 Sy10Va
135
+ 1 2 17
136
+ 4 2 Sy11Au
137
+ 1 2 Sy10Te
138
+ 1 rNeeds 1Dragx
139
+ 1 25 1Aaxxx
140
+ 1 rShare Sy10De
141
+ 1 28 10
142
+ 1 rLocal 03Webx
143
+ 1 30 03Iosx
144
+ 1 25 Sy10Ne
145
+ 1 25 1DSone
146
+ 1 30 Sy10Au
147
+ 1 28 8
148
+ 1 28 Sy10Ta
149
+ 1 25 02Vite
150
+ 1 25 02Clou
151
+ 1 30 03Clix
152
+ 1 25 1Idvxx
153
+ 1 25 02Litx
154
+ 1 30 Sy10Se
155
+ 10 28 40
156
+ 1 30 03Mcpx
157
+ 1Consc rOppor 1
158
+ 1 30 03Apix
159
+ 1 30 11
160
+ 1 30 12
161
+ 1 30 13
162
+ 1 30 3
163
+ 1 30 14
164
+ 1 30 15
165
+ 1 30 16
166
+ 1 30 18
167
+ 1 30 19
168
+ 1 30 4
169
+ 1 30 20
170
+ 1 30 21
171
+ 1 30 9
172
+ 9 30 10
173
+ 1 30 22
174
+ 1 30 04Gmai
175
+ 1 30 Sy11Se
176
+ 1 30 Sy10Do
177
+ 1 25 7
178
+ 1 25 1Ezoxe
179
+ 1 28 1Linkl
180
+ 1 28 44
181
+ 1 28 Sy10Co
182
+ 7 28 10
183
+ 7 30 43
184
+ 1 30 5
185
+ 1 30 Sy10Ag
186
+ 1 30 23
187
+ 1 30 03Nati
188
+ 7 28 26
189
+ 1 30 24
190
+ 7 25 34
191
+ 1 30 Sy11Ca
192
+ 1 25 02Bomb
193
+ 7 25 44
194
+ 1 rNoApp Sy10Su
195
+ 1 57 Sy10Sh
196
+ 1 57 Sy10Af
197
+ 1 57 Sy10Re
198
+ 1 57 Sy10On
199
+ 1 57 Sy10As
200
+ 1 57 Sy11Su
201
+ 1 57 Sy10Ca
202
+ 1 57 1Priva
203
+ 1 57 Sy10Si
204
+ 1 57 Sy10If
205
+ 1 2 1Syste
206
+ 69 rTools tcUr01
207
+ 69 70 tcDr01
208
+ 69 70 tcUe02
209
+ 69 70 tcUl02
210
+ 69 70 tcUo01
211
+ 69 70 tcUp08
212
+ 69 70 tcUr02
213
+ 69 70 tcPi02
214
+ 69 70 tcPr03
215
+ 69 70 tcUr03
216
+ 69 70 tcDs04
217
+ 69 70 tcGa06
218
+ 69 70 tcGa07
219
+ 69 70 tcGa08
220
+ 69 70 tcGa09
221
+ 69 70 tcGa10
222
+ 69 70 tcGc07
223
+ 69 70 tcGc08
224
+ 69 70 tcGc09
225
+ 69 70 tcGc10
226
+ 69 70 tcGc11
227
+ 69 70 tcGc12
228
+ 69 70 tcGd01
229
+ 69 70 tcGg01
230
+ 69 70 tcGi04
231
+ 69 70 tcGi05
232
+ 69 70 tcGm03
233
+ 69 70 tcGp14
234
+ 69 70 tcGr01
235
+ 69 70 tcGr02
236
+ 69 70 tcGr03
237
+ 69 70 tcGr04
238
+ 69 70 tcGr05
239
+ 69 70 tcGr06
240
+ 69 70 tcGr07
241
+ 69 70 tcGr08
242
+ 69 70 tcGr09
243
+ 69 70 tcGr10
244
+ 69 70 tcGs10
245
+ 69 70 tcGs11
246
+ 69 70 tcGs12
247
+ 69 70 tcGt03
248
+ 69 70 tcGu01
249
+ 69 70 tcGu02
250
+ 69 70 tcGv01
251
+ 69 70 tcGa11
252
+ 69 70 tcGc13
253
+ 69 70 tcGc14
254
+ 69 70 tcGi06
255
+ 69 70 tcGp15
256
+ 69 70 tcGp16
257
+ 69 70 tcGr11
258
+ 69 70 tcGr12
259
+ 69 70 tcGr13
260
+ 69 70 tcGr14
261
+ 69 70 tcGs13
262
+ 69 70 tcGs14
263
+ 69 70 tcUr04
264
+ 69 70 tcUr05
265
+ 69 70 tcGr15
266
+ 69 70 tcPr04
267
+ 69 70 tcPc04
268
+ 69 70 tcPc05
269
+ 69 70 tcPc06
270
+ 69 70 tcPr05
271
+ 69 70 tcGp17
272
+ 69 70 tcGr16
273
+ 69 70 tcDr02
274
+ 69 70 tcPp05
275
+ 69 70 tcPa05
276
+ 69 70 tcPa06
277
+ 69 70 tcPr06
278
+ 69 70 tcPr07
279
+ 69 70 tcPr08
280
+ 69 70 tcPr09
281
+ 69 70 tcPr10
282
+ 69 70 tcPr11
283
+ 69 70 tcPr12
284
+ 69 70 tcPr13
285
+ 69 70 tcPr14
286
+ 69 70 tcPr15
287
+ 69 70 tcPr16
288
+ 69 70 tcGa12
289
+ 69 70 tcGp18
290
+ 69 70 tcGs15
291
+ 69 70 tcUr06
292
+ 69 70 tcUi03
293
+ ```
294
+
295
+ </details>
296
+
80
297
  [MIT license](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0001-labs/idv1",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "An ID system for short, memorable IDs that are easy to keep unique.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/shapes.ts CHANGED
@@ -61,13 +61,6 @@ export const RESERVED_ACCOUNT_CODES = { owner: 'Jo4712', studio: 'Jo0001', onboa
61
61
 
62
62
  export type ReservedRole = keyof typeof RESERVED_ACCOUNT_CODES
63
63
 
64
- export const RESERVED_ACCOUNT_EMAILS = {
65
- 'jaa90@icloud.com': 'owner',
66
- 'joachim@0001.dev': 'studio',
67
- 'joachim+onboarding@0001.dev': 'onboarding',
68
- 'joachim+test@0001.dev': 'test',
69
- } as const satisfies Record<string, ReservedRole>
70
-
71
64
  export const FORMER_RESERVED_ACCOUNT_CODES = ['On4713'] as const
72
65
 
73
66
  let reserved: Set<string> | undefined
@@ -75,10 +68,6 @@ let reserved: Set<string> | undefined
75
68
  export const isReservedAccountCode = (code: string): boolean =>
76
69
  (reserved ??= new Set([...Object.values(RESERVED_ACCOUNT_CODES), ...FORMER_RESERVED_ACCOUNT_CODES].map(kept => kept.toLowerCase()))).has(code.toLowerCase())
77
70
 
78
- export function reservedAccountCode(email: string | null | undefined): string | null {
79
- const key = email?.trim().toLowerCase() as keyof typeof RESERVED_ACCOUNT_EMAILS | undefined
80
- return key && key in RESERVED_ACCOUNT_EMAILS ? RESERVED_ACCOUNT_CODES[RESERVED_ACCOUNT_EMAILS[key]] : null
81
- }
82
71
 
83
72
  export function productCodeCandidate(random: Random = Math.random): string {
84
73
  for (let attempt = 0; attempt < 1000; attempt++) {