@justfortytwo/installer 1.0.11 → 1.1.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/README.md +36 -5
- package/assets/gate/capabilities.toml +9 -0
- package/dist/commands/doctor.d.ts +20 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +68 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +14 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +41 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/onboard.d.ts +45 -0
- package/dist/commands/onboard.d.ts.map +1 -0
- package/dist/commands/onboard.js +281 -0
- package/dist/commands/onboard.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +11 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/engine.d.ts +2 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +13 -0
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/onboard.d.ts +102 -0
- package/dist/onboard.d.ts.map +1 -0
- package/dist/onboard.js +354 -0
- package/dist/onboard.js.map +1 -0
- package/dist/oneiros.d.ts.map +1 -1
- package/dist/oneiros.js +2 -0
- package/dist/oneiros.js.map +1 -1
- package/dist/state.d.ts +16 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { Answers, ProfileProvenance } from './state.js';
|
|
2
|
+
import type { PersonaManifestField } from './render.js';
|
|
3
|
+
export declare const DRAFT_VERSION = 1;
|
|
4
|
+
/** Where the onboarding skill writes the draft, relative to the project root. */
|
|
5
|
+
export declare const DEFAULT_DRAFT_PATH = ".fortytwo/onboarding/draft.json";
|
|
6
|
+
/** Memory tag on every deep-profile fact; `fortytwo forget --tag owner-profile` removes them. */
|
|
7
|
+
export declare const PROFILE_TAG = "owner-profile";
|
|
8
|
+
export declare const CLAIM_SOURCES: readonly ["link", "upload", "test", "interview"];
|
|
9
|
+
export type ClaimSource = (typeof CLAIM_SOURCES)[number];
|
|
10
|
+
export declare const OBSERVATIONS: readonly ["observed", "inferred"];
|
|
11
|
+
export type Observation = (typeof OBSERVATIONS)[number];
|
|
12
|
+
export interface SummaryClaim extends ProfileProvenance {
|
|
13
|
+
/** A persona manifest field key (`owner_*`). */
|
|
14
|
+
key: string;
|
|
15
|
+
value: string | string[];
|
|
16
|
+
}
|
|
17
|
+
export interface FactClaim extends ProfileProvenance {
|
|
18
|
+
/** Stable id of the fact within the profile (e.g. `work.current-role`); a re-run with the same key updates it. */
|
|
19
|
+
key: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ProfileDraft {
|
|
23
|
+
draftVersion: number;
|
|
24
|
+
summary: SummaryClaim[];
|
|
25
|
+
facts: FactClaim[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Make text safe to print on the owner's terminal: every character in
|
|
29
|
+
* UNSAFE_CLASS becomes a visible \u{XXXX} escape. Newlines are kept. Use it on
|
|
30
|
+
* anything that came from a draft, a fetched page, an upload or memory.
|
|
31
|
+
*/
|
|
32
|
+
export declare function escapeForTerminal(s: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Validate a draft against the installed persona manifest. All-or-nothing: any
|
|
35
|
+
* error rejects the whole draft, so a half-valid draft never half-persists.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseDraft(raw: unknown, fields: PersonaManifestField[]): {
|
|
38
|
+
draft: ProfileDraft;
|
|
39
|
+
errors: [];
|
|
40
|
+
} | {
|
|
41
|
+
draft: null;
|
|
42
|
+
errors: string[];
|
|
43
|
+
};
|
|
44
|
+
/** A live deep-profile fact already in memory. */
|
|
45
|
+
export interface ExistingFact {
|
|
46
|
+
id: number;
|
|
47
|
+
key: string;
|
|
48
|
+
content: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The live `owner-profile` facts keyed by their profile key, from memory rows
|
|
52
|
+
* (newest first, as memory's `query` returns them: the first row per key wins).
|
|
53
|
+
* Rows without a profile key (written by something else) are ignored.
|
|
54
|
+
*/
|
|
55
|
+
export declare function existingFactsFromRows(rows: {
|
|
56
|
+
id: number;
|
|
57
|
+
content: string;
|
|
58
|
+
meta: string | null;
|
|
59
|
+
}[]): ExistingFact[];
|
|
60
|
+
export type ProfileChange = {
|
|
61
|
+
kind: 'summary';
|
|
62
|
+
status: 'added' | 'changed';
|
|
63
|
+
claim: SummaryClaim;
|
|
64
|
+
before?: string | string[];
|
|
65
|
+
} | {
|
|
66
|
+
kind: 'fact';
|
|
67
|
+
status: 'added' | 'changed';
|
|
68
|
+
claim: FactClaim;
|
|
69
|
+
before?: string;
|
|
70
|
+
supersedes?: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* What the draft would change. Additive: a key the draft leaves out is kept as
|
|
74
|
+
* it is (removal is `fortytwo forget` for memory, or a later draft value for the
|
|
75
|
+
* persona), and a claim equal to what is saved is not a change.
|
|
76
|
+
*/
|
|
77
|
+
export declare function diffProfile(draft: ProfileDraft, answers: Answers, existingFacts: ExistingFact[]): {
|
|
78
|
+
changes: ProfileChange[];
|
|
79
|
+
unchanged: number;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* The lines that show one change to the owner: what, where it goes, old → new,
|
|
83
|
+
* provenance. Every value is escaped, including `before`, which comes from
|
|
84
|
+
* memory and was never validated by parseDraft.
|
|
85
|
+
*/
|
|
86
|
+
export declare function formatChange(c: ProfileChange): string[];
|
|
87
|
+
/** Merge confirmed summary claims into the answers + provenance maps (new objects; inputs untouched). */
|
|
88
|
+
export declare function applySummary(answers: Answers, provenance: Record<string, ProfileProvenance> | undefined, claims: SummaryClaim[]): {
|
|
89
|
+
answers: Answers;
|
|
90
|
+
profileProvenance: Record<string, ProfileProvenance>;
|
|
91
|
+
};
|
|
92
|
+
/** The memory row for one confirmed fact (memory's MemoryInput shape). */
|
|
93
|
+
export declare function factToMemory(claim: FactClaim, supersedes?: number): {
|
|
94
|
+
content: string;
|
|
95
|
+
source: string;
|
|
96
|
+
observed: string;
|
|
97
|
+
date: string;
|
|
98
|
+
tags: string[];
|
|
99
|
+
meta: Record<string, unknown>;
|
|
100
|
+
supersedes: number | null;
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=onboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboard.d.ts","sourceRoot":"","sources":["../src/onboard.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,oCAAoC,CAAC;AACpE,iGAAiG;AACjG,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,aAAa,kDAAmD,CAAC;AAC9E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACzD,eAAO,MAAM,YAAY,mCAAoC,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAClD,kHAAkH;IAClH,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED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,EACnB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,YAAY,EAAE,GAC5B;IAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAmBjD;AAcD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,EAAE,CAMvD;AAED,yGAAyG;AACzG,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAAS,EACzD,MAAM,EAAE,YAAY,EAAE,GACrB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;CAAE,CAQ5E;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG;IACnE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAChF,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1D,CAUA"}
|
package/dist/onboard.js
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
// onboard.ts — the owner-profile draft: its format, validation and diff.
|
|
2
|
+
//
|
|
3
|
+
// The onboarding interview itself is conversational work, so it runs in the
|
|
4
|
+
// agent (persona's `onboarding` skill): it collects links, uploaded texts and
|
|
5
|
+
// optional personality-test results, reads them as DATA (never instructions),
|
|
6
|
+
// and writes a draft to `.fortytwo/onboarding/draft.json`. Nothing in the draft
|
|
7
|
+
// is the profile yet. `fortytwo onboard` (commands/onboard.ts) is the only
|
|
8
|
+
// writer: it validates the draft here, diffs it against what is already saved,
|
|
9
|
+
// and persists only what the owner confirms in a terminal.
|
|
10
|
+
//
|
|
11
|
+
// Two destinations, one per claim list:
|
|
12
|
+
// - `summary`: values for existing persona manifest fields (`owner_*`). They
|
|
13
|
+
// merge into `.fortytwo/identity.json` answers, which the persona renders
|
|
14
|
+
// from; their provenance goes to `identity.json` `profileProvenance`.
|
|
15
|
+
// - `facts`: the deep profile. Each becomes one memory row tagged
|
|
16
|
+
// `owner-profile` (retrievable, not always loaded), with its provenance in
|
|
17
|
+
// memory's source / observed / date / meta columns.
|
|
18
|
+
//
|
|
19
|
+
// Every claim carries provenance: source (link | upload | test | interview),
|
|
20
|
+
// an optional ref (the URL, file name or test name), the date and whether it
|
|
21
|
+
// was observed or inferred. A test result is self-report: it may become a fact,
|
|
22
|
+
// never a persona summary value (the always-loaded persona must not carry a
|
|
23
|
+
// personality label).
|
|
24
|
+
//
|
|
25
|
+
// Pure: no fs, no memory, no prompts. Everything here is unit-tested directly.
|
|
26
|
+
export const DRAFT_VERSION = 1;
|
|
27
|
+
/** Where the onboarding skill writes the draft, relative to the project root. */
|
|
28
|
+
export const DEFAULT_DRAFT_PATH = '.fortytwo/onboarding/draft.json';
|
|
29
|
+
/** Memory tag on every deep-profile fact; `fortytwo forget --tag owner-profile` removes them. */
|
|
30
|
+
export const PROFILE_TAG = 'owner-profile';
|
|
31
|
+
export const CLAIM_SOURCES = ['link', 'upload', 'test', 'interview'];
|
|
32
|
+
export const OBSERVATIONS = ['observed', 'inferred'];
|
|
33
|
+
// Caps keep a draft a profile, not a dump of fetched pages.
|
|
34
|
+
const MAX_LINE = 300;
|
|
35
|
+
const MAX_TEXT = 2000;
|
|
36
|
+
const MAX_FACT = 500;
|
|
37
|
+
const MAX_LIST_ITEMS = 20;
|
|
38
|
+
const MAX_FACTS = 200;
|
|
39
|
+
const FACT_KEY = /^[a-z0-9][a-z0-9._-]{0,63}$/;
|
|
40
|
+
// Characters that can hide, reorder or rewrite text on a terminal or in the
|
|
41
|
+
// rendered persona, or smuggle invisible instructions to a model. By Unicode
|
|
42
|
+
// category, so new code points are covered without a list to maintain:
|
|
43
|
+
// - Cc: control characters, U+0000-001F and U+007F-009F, except tab and newline
|
|
44
|
+
// - Cf: format characters (bidi marks/overrides/isolates, zero-width
|
|
45
|
+
// characters, BOM, the U+E0000 tag block, invisible operators)
|
|
46
|
+
// - Co, Cn: private-use and unassigned code points
|
|
47
|
+
// - Zl, Zp: line and paragraph separators
|
|
48
|
+
// plus invisible filler letters and the supplementary variation selectors
|
|
49
|
+
// (U+E0100-E01EF), which carry no visible glyph. The basic variation selectors
|
|
50
|
+
// (U+FE00-FE0F) stay allowed because emoji need them.
|
|
51
|
+
const UNSAFE_CLASS = '[\\u0000-\\u0008\\u000B-\\u001F\\u007F-\\u009F\\p{Cf}\\p{Co}\\p{Cn}\\p{Zl}\\p{Zp}\\u115F\\u1160\\u3164\\uFFA0\\u{E0100}-\\u{E01EF}]';
|
|
52
|
+
const CONTROL = new RegExp(UNSAFE_CLASS, 'u');
|
|
53
|
+
const UNSAFE_GLOBAL = new RegExp(UNSAFE_CLASS, 'gu');
|
|
54
|
+
// Lines that would open a new markdown block when a summary value is rendered
|
|
55
|
+
// into the persona: ATX headings, code fences, setext underlines and thematic
|
|
56
|
+
// breaks, raw HTML, and indented code (4+ spaces or a leading tab).
|
|
57
|
+
const MARKDOWN_STRUCTURE = /^(?: {0,3}(?:#{1,6}(?:[ \t]|$)|`{3,}|~{3,}|(?:[*_-][ \t]*){3,}$|=+[ \t]*$|-+[ \t]*$|<)| {4,}|\t)/m;
|
|
58
|
+
/**
|
|
59
|
+
* Make text safe to print on the owner's terminal: every character in
|
|
60
|
+
* UNSAFE_CLASS becomes a visible \u{XXXX} escape. Newlines are kept. Use it on
|
|
61
|
+
* anything that came from a draft, a fetched page, an upload or memory.
|
|
62
|
+
*/
|
|
63
|
+
export function escapeForTerminal(s) {
|
|
64
|
+
return s.replace(UNSAFE_GLOBAL, (ch) => `\\u{${ch.codePointAt(0).toString(16).toUpperCase().padStart(4, '0')}}`);
|
|
65
|
+
}
|
|
66
|
+
function isRecord(v) {
|
|
67
|
+
return !!v && typeof v === 'object' && !Array.isArray(v);
|
|
68
|
+
}
|
|
69
|
+
function isIsoDate(v) {
|
|
70
|
+
if (typeof v !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(v))
|
|
71
|
+
return false;
|
|
72
|
+
const d = new Date(`${v}T00:00:00Z`);
|
|
73
|
+
return !Number.isNaN(d.getTime()) && d.toISOString().slice(0, 10) === v;
|
|
74
|
+
}
|
|
75
|
+
function isHttpUrl(v) {
|
|
76
|
+
try {
|
|
77
|
+
const u = new URL(v);
|
|
78
|
+
return (u.protocol === 'http:' || u.protocol === 'https:') && u.hostname !== '';
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** A trimmed string within `max`, single-line unless `multiline`; else an error message. */
|
|
85
|
+
function cleanText(v, max, multiline) {
|
|
86
|
+
if (typeof v !== 'string')
|
|
87
|
+
return { error: 'must be a string' };
|
|
88
|
+
const s = v.trim();
|
|
89
|
+
if (!s)
|
|
90
|
+
return { error: 'is empty' };
|
|
91
|
+
if (CONTROL.test(s))
|
|
92
|
+
return { error: 'contains control characters' };
|
|
93
|
+
if (!multiline && /[\r\n]/.test(s))
|
|
94
|
+
return { error: 'must be a single line' };
|
|
95
|
+
if (s.length > max)
|
|
96
|
+
return { error: `is longer than ${max} characters` };
|
|
97
|
+
return s;
|
|
98
|
+
}
|
|
99
|
+
function parseProvenance(c, where, errors) {
|
|
100
|
+
const before = errors.length;
|
|
101
|
+
const source = c.source;
|
|
102
|
+
if (!CLAIM_SOURCES.includes(source)) {
|
|
103
|
+
errors.push(`${where}: source must be one of ${CLAIM_SOURCES.join(', ')}`);
|
|
104
|
+
}
|
|
105
|
+
if (!OBSERVATIONS.includes(c.observed)) {
|
|
106
|
+
errors.push(`${where}: observed must be one of ${OBSERVATIONS.join(', ')}`);
|
|
107
|
+
}
|
|
108
|
+
if (!isIsoDate(c.date))
|
|
109
|
+
errors.push(`${where}: date must be a YYYY-MM-DD date`);
|
|
110
|
+
let ref;
|
|
111
|
+
if (c.ref !== undefined) {
|
|
112
|
+
const r = cleanText(c.ref, MAX_LINE, false);
|
|
113
|
+
if (typeof r !== 'string')
|
|
114
|
+
errors.push(`${where}: ref ${r.error}`);
|
|
115
|
+
else
|
|
116
|
+
ref = r;
|
|
117
|
+
}
|
|
118
|
+
if (source === 'link' && (!ref || !isHttpUrl(ref)))
|
|
119
|
+
errors.push(`${where}: a link claim needs ref set to its http(s) URL`);
|
|
120
|
+
if (errors.length > before)
|
|
121
|
+
return null;
|
|
122
|
+
return {
|
|
123
|
+
source: source,
|
|
124
|
+
...(ref !== undefined ? { ref } : {}),
|
|
125
|
+
date: c.date,
|
|
126
|
+
observed: c.observed,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function parseSummaryValue(field, v, where, errors) {
|
|
130
|
+
if (field.type === 'list') {
|
|
131
|
+
if (!Array.isArray(v)) {
|
|
132
|
+
errors.push(`${where}: ${field.key} is a list field; value must be an array of strings`);
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
if (v.length > MAX_LIST_ITEMS) {
|
|
136
|
+
errors.push(`${where}: more than ${MAX_LIST_ITEMS} items`);
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
const items = [];
|
|
140
|
+
for (const [i, item] of v.entries()) {
|
|
141
|
+
const s = cleanText(item, MAX_LINE, false);
|
|
142
|
+
if (typeof s !== 'string') {
|
|
143
|
+
errors.push(`${where}: item ${i + 1} ${s.error}`);
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
if (MARKDOWN_STRUCTURE.test(s)) {
|
|
147
|
+
errors.push(`${where}: item ${i + 1} contains a markdown block (heading, fence, rule, HTML or indented code)`);
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
items.push(s);
|
|
151
|
+
}
|
|
152
|
+
if (items.length === 0) {
|
|
153
|
+
errors.push(`${where}: value is empty`);
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
return items;
|
|
157
|
+
}
|
|
158
|
+
const s = cleanText(v, field.type === 'text' ? MAX_TEXT : MAX_LINE, field.type === 'text');
|
|
159
|
+
if (typeof s !== 'string') {
|
|
160
|
+
errors.push(`${where}: value ${s.error}`);
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
if (MARKDOWN_STRUCTURE.test(s)) {
|
|
164
|
+
errors.push(`${where}: value contains a markdown block (heading, fence, rule, HTML or indented code)`);
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
return s;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Validate a draft against the installed persona manifest. All-or-nothing: any
|
|
171
|
+
* error rejects the whole draft, so a half-valid draft never half-persists.
|
|
172
|
+
*/
|
|
173
|
+
export function parseDraft(raw, fields) {
|
|
174
|
+
const errors = [];
|
|
175
|
+
if (!isRecord(raw))
|
|
176
|
+
return { draft: null, errors: ['the draft must be a JSON object'] };
|
|
177
|
+
if (raw.draftVersion !== DRAFT_VERSION) {
|
|
178
|
+
return { draft: null, errors: [`draftVersion must be ${DRAFT_VERSION} (got ${JSON.stringify(raw.draftVersion)})`] };
|
|
179
|
+
}
|
|
180
|
+
const summaryRaw = raw.summary ?? [];
|
|
181
|
+
const factsRaw = raw.facts ?? [];
|
|
182
|
+
if (!Array.isArray(summaryRaw))
|
|
183
|
+
errors.push('summary must be an array');
|
|
184
|
+
if (!Array.isArray(factsRaw))
|
|
185
|
+
errors.push('facts must be an array');
|
|
186
|
+
if (errors.length > 0)
|
|
187
|
+
return { draft: null, errors };
|
|
188
|
+
const byKey = new Map(fields.map((f) => [f.key, f]));
|
|
189
|
+
const summary = [];
|
|
190
|
+
const seenSummary = new Set();
|
|
191
|
+
for (const [i, c] of summaryRaw.entries()) {
|
|
192
|
+
const where = `summary[${i}]`;
|
|
193
|
+
if (!isRecord(c)) {
|
|
194
|
+
errors.push(`${where}: must be an object`);
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
const key = c.key;
|
|
198
|
+
const field = typeof key === 'string' ? byKey.get(key) : undefined;
|
|
199
|
+
if (typeof key !== 'string' || !key.startsWith('owner_') || !field) {
|
|
200
|
+
errors.push(`${where}: key ${JSON.stringify(key)} is not an owner_* field of the installed persona`);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (seenSummary.has(key)) {
|
|
204
|
+
errors.push(`${where}: duplicate key ${key}`);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
seenSummary.add(key);
|
|
208
|
+
const prov = parseProvenance(c, where, errors);
|
|
209
|
+
if (prov?.source === 'test') {
|
|
210
|
+
errors.push(`${where}: a personality-test result is self-report; put it in facts, not in the persona summary`);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const value = parseSummaryValue(field, c.value, where, errors);
|
|
214
|
+
if (prov && value !== null)
|
|
215
|
+
summary.push({ key, value, ...prov });
|
|
216
|
+
}
|
|
217
|
+
const facts = [];
|
|
218
|
+
const seenFacts = new Set();
|
|
219
|
+
if (factsRaw.length > MAX_FACTS)
|
|
220
|
+
errors.push(`facts: more than ${MAX_FACTS} facts`);
|
|
221
|
+
for (const [i, c] of factsRaw.entries()) {
|
|
222
|
+
const where = `facts[${i}]`;
|
|
223
|
+
if (!isRecord(c)) {
|
|
224
|
+
errors.push(`${where}: must be an object`);
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
const key = c.key;
|
|
228
|
+
if (typeof key !== 'string' || !FACT_KEY.test(key)) {
|
|
229
|
+
errors.push(`${where}: key must match ${FACT_KEY.source}`);
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
if (seenFacts.has(key)) {
|
|
233
|
+
errors.push(`${where}: duplicate key ${key}`);
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
seenFacts.add(key);
|
|
237
|
+
const prov = parseProvenance(c, where, errors);
|
|
238
|
+
const content = cleanText(c.content, MAX_FACT, false);
|
|
239
|
+
if (typeof content !== 'string') {
|
|
240
|
+
errors.push(`${where}: content ${content.error}`);
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (prov)
|
|
244
|
+
facts.push({ key, content, ...prov });
|
|
245
|
+
}
|
|
246
|
+
if (errors.length > 0)
|
|
247
|
+
return { draft: null, errors };
|
|
248
|
+
return { draft: { draftVersion: DRAFT_VERSION, summary, facts }, errors: [] };
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The live `owner-profile` facts keyed by their profile key, from memory rows
|
|
252
|
+
* (newest first, as memory's `query` returns them: the first row per key wins).
|
|
253
|
+
* Rows without a profile key (written by something else) are ignored.
|
|
254
|
+
*/
|
|
255
|
+
export function existingFactsFromRows(rows) {
|
|
256
|
+
const seen = new Map();
|
|
257
|
+
for (const r of rows) {
|
|
258
|
+
let key;
|
|
259
|
+
try {
|
|
260
|
+
key = JSON.parse(r.meta ?? '{}').profileKey;
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
key = undefined;
|
|
264
|
+
}
|
|
265
|
+
if (typeof key === 'string' && !seen.has(key))
|
|
266
|
+
seen.set(key, { id: r.id, key, content: r.content });
|
|
267
|
+
}
|
|
268
|
+
return [...seen.values()];
|
|
269
|
+
}
|
|
270
|
+
function sameValue(a, b) {
|
|
271
|
+
if (Array.isArray(b))
|
|
272
|
+
return Array.isArray(a) && a.length === b.length && a.every((x, i) => x.trim() === b[i]);
|
|
273
|
+
return typeof a === 'string' && a.trim() === b;
|
|
274
|
+
}
|
|
275
|
+
function isBlank(v) {
|
|
276
|
+
return v === undefined || (Array.isArray(v) ? v.length === 0 : v.trim() === '');
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* What the draft would change. Additive: a key the draft leaves out is kept as
|
|
280
|
+
* it is (removal is `fortytwo forget` for memory, or a later draft value for the
|
|
281
|
+
* persona), and a claim equal to what is saved is not a change.
|
|
282
|
+
*/
|
|
283
|
+
export function diffProfile(draft, answers, existingFacts) {
|
|
284
|
+
const changes = [];
|
|
285
|
+
let unchanged = 0;
|
|
286
|
+
for (const claim of draft.summary) {
|
|
287
|
+
const before = answers[claim.key];
|
|
288
|
+
if (sameValue(before, claim.value)) {
|
|
289
|
+
unchanged++;
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
changes.push(isBlank(before)
|
|
293
|
+
? { kind: 'summary', status: 'added', claim }
|
|
294
|
+
: { kind: 'summary', status: 'changed', claim, before });
|
|
295
|
+
}
|
|
296
|
+
const byKey = new Map(existingFacts.map((f) => [f.key, f]));
|
|
297
|
+
for (const claim of draft.facts) {
|
|
298
|
+
const prior = byKey.get(claim.key);
|
|
299
|
+
if (prior && prior.content.trim() === claim.content) {
|
|
300
|
+
unchanged++;
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
changes.push(prior
|
|
304
|
+
? { kind: 'fact', status: 'changed', claim, before: prior.content, supersedes: prior.id }
|
|
305
|
+
: { kind: 'fact', status: 'added', claim });
|
|
306
|
+
}
|
|
307
|
+
return { changes, unchanged };
|
|
308
|
+
}
|
|
309
|
+
function provenanceLabel(p) {
|
|
310
|
+
return escapeForTerminal(`${p.source}${p.ref ? ` ${p.ref}` : ''}, ${p.date}, ${p.observed}`);
|
|
311
|
+
}
|
|
312
|
+
const VALUE_INDENT = ' ';
|
|
313
|
+
/** A value as it will be saved: list items joined, multi-line text kept multi-line and indented. */
|
|
314
|
+
function show(v) {
|
|
315
|
+
if (Array.isArray(v))
|
|
316
|
+
return v.map(escapeForTerminal).join('; ');
|
|
317
|
+
return escapeForTerminal(v).split('\n').join(`\n${VALUE_INDENT}`);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* The lines that show one change to the owner: what, where it goes, old → new,
|
|
321
|
+
* provenance. Every value is escaped, including `before`, which comes from
|
|
322
|
+
* memory and was never validated by parseDraft.
|
|
323
|
+
*/
|
|
324
|
+
export function formatChange(c) {
|
|
325
|
+
const where = c.kind === 'summary' ? 'persona' : 'memory';
|
|
326
|
+
const lines = [`${c.status === 'added' ? '+' : '~'} [${where}] ${escapeForTerminal(c.claim.key)} (${provenanceLabel(c.claim)})`];
|
|
327
|
+
if (c.before !== undefined)
|
|
328
|
+
lines.push(` was: ${show(c.before)}`);
|
|
329
|
+
lines.push(` ${c.before !== undefined ? 'now' : 'new'}: ${show(c.kind === 'summary' ? c.claim.value : c.claim.content)}`);
|
|
330
|
+
return lines;
|
|
331
|
+
}
|
|
332
|
+
/** Merge confirmed summary claims into the answers + provenance maps (new objects; inputs untouched). */
|
|
333
|
+
export function applySummary(answers, provenance, claims) {
|
|
334
|
+
const nextAnswers = { ...answers };
|
|
335
|
+
const nextProv = { ...(provenance ?? {}) };
|
|
336
|
+
for (const { key, value, source, ref, date, observed } of claims) {
|
|
337
|
+
nextAnswers[key] = value;
|
|
338
|
+
nextProv[key] = { source, ...(ref !== undefined ? { ref } : {}), date, observed };
|
|
339
|
+
}
|
|
340
|
+
return { answers: nextAnswers, profileProvenance: nextProv };
|
|
341
|
+
}
|
|
342
|
+
/** The memory row for one confirmed fact (memory's MemoryInput shape). */
|
|
343
|
+
export function factToMemory(claim, supersedes) {
|
|
344
|
+
return {
|
|
345
|
+
content: claim.content,
|
|
346
|
+
source: `onboarding:${claim.source}`,
|
|
347
|
+
observed: claim.observed,
|
|
348
|
+
date: claim.date,
|
|
349
|
+
tags: [PROFILE_TAG],
|
|
350
|
+
meta: { profileKey: claim.key, ...(claim.ref !== undefined ? { ref: claim.ref } : {}) },
|
|
351
|
+
supersedes: supersedes ?? null,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
//# sourceMappingURL=onboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboard.js","sourceRoot":"","sources":["../src/onboard.ts"],"names":[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AAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;QACvF,UAAU,EAAE,UAAU,IAAI,IAAI;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/oneiros.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oneiros.d.ts","sourceRoot":"","sources":["../src/oneiros.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oneiros.d.ts","sourceRoot":"","sources":["../src/oneiros.ts"],"names":[],"mappings":"AAkBA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBlF"}
|
package/dist/oneiros.js
CHANGED
|
@@ -17,6 +17,8 @@ export async function reconcileOneiros(root, dbPath) {
|
|
|
17
17
|
const h = memory.openDb(path);
|
|
18
18
|
try {
|
|
19
19
|
await memory.runMigrations(h.k);
|
|
20
|
+
// seedOneiros writes to the jobs table, so create it before seeding.
|
|
21
|
+
await scheduler.runSchedulerMigrations?.(h.k);
|
|
20
22
|
persona.initialize(root, memory.memoryHead(h));
|
|
21
23
|
scheduler.seedOneiros(h, new Date().toISOString(), scheduler.recurrenceNext);
|
|
22
24
|
}
|
package/dist/oneiros.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oneiros.js","sourceRoot":"","sources":["../src/oneiros.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"oneiros.js","sourceRoot":"","sources":["../src/oneiros.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;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AAC,UAAU,CAAC,IAAI,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9C,SAAS,CAAC,WAAW,CAAC,CAAC,EAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC7E,CAAC;YAAS,CAAC;QAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;AACnD,CAAC"}
|
package/dist/state.d.ts
CHANGED
|
@@ -8,6 +8,17 @@ export declare const STATE_FILE = "state.json";
|
|
|
8
8
|
* substitutes against; there is no separate owner sub-object.
|
|
9
9
|
*/
|
|
10
10
|
export type Answers = Record<string, string | string[]>;
|
|
11
|
+
/** Provenance of one owner-profile claim confirmed through `fortytwo onboard`. */
|
|
12
|
+
export interface ProfileProvenance {
|
|
13
|
+
/** How it was learned. A `test` result is self-report, never a label. */
|
|
14
|
+
source: 'link' | 'upload' | 'test' | 'interview';
|
|
15
|
+
/** The URL, file name or test name, when there is one. */
|
|
16
|
+
ref?: string;
|
|
17
|
+
/** ISO date (YYYY-MM-DD) the claim was made or observed. */
|
|
18
|
+
date: string;
|
|
19
|
+
/** Stated or seen in the source, versus inferred from it. */
|
|
20
|
+
observed: 'observed' | 'inferred';
|
|
21
|
+
}
|
|
11
22
|
/** Channel binding captured at init/pair (e.g. the Telegram chat allowlist). */
|
|
12
23
|
export interface ChannelBinding {
|
|
13
24
|
channel: 'telegram' | string;
|
|
@@ -27,6 +38,11 @@ export interface Identity {
|
|
|
27
38
|
* `owner_name`, `owner_values`). `enrich` adds/updates keys here over time.
|
|
28
39
|
*/
|
|
29
40
|
answers: Answers;
|
|
41
|
+
/**
|
|
42
|
+
* Where each answer set by `fortytwo onboard` came from, keyed like `answers`.
|
|
43
|
+
* Metadata only: the persona renderer never reads it.
|
|
44
|
+
*/
|
|
45
|
+
profileProvenance?: Record<string, ProfileProvenance>;
|
|
30
46
|
channels?: ChannelBinding[];
|
|
31
47
|
createdAt: string;
|
|
32
48
|
updatedAt: string;
|
package/dist/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAExD,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAG7B,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,kFAAkF;IAClF,eAAe,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,gDAAgD;AAChD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;CACvB;AAyBD,wBAAgB,YAAY,CAAC,IAAI,SAAgB,GAAG,QAAQ,GAAG,IAAI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AAQ;QACR,aAAa,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACxC,CAAC;IACF,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACxB,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justfortytwo/installer",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "All-in-one installer and lifecycle CLI for fortytwo — scaffolds the persona surface and provisions the npm engine (memory MCP, safety gate, channel adapters, embedder).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"fortytwo": {
|
|
48
48
|
"comment": "Compatibility contract this CLI version was authored against — the SINGLE source of truth for engine sibling versions (deliberately not peerDependencies: npm would hard-fail installer upgrades with ERESOLVE whenever an installed sibling sits outside the new range). init installs these ranges, doctor cross-checks the *installed* siblings against them, update resolves latest-in-range and records the set into .fortytwo/state.json for rollback.",
|
|
49
49
|
"compat": {
|
|
50
|
-
"@justfortytwo/memory": "
|
|
50
|
+
"@justfortytwo/memory": "2.0.0",
|
|
51
51
|
"@justfortytwo/gate": "^1.0.0",
|
|
52
|
-
"@justfortytwo/persona": "1.0
|
|
53
|
-
"@justfortytwo/telegram": "1.0
|
|
54
|
-
"@justfortytwo/scheduler": "
|
|
55
|
-
"@justfortytwo/transcript": "^1.0.
|
|
52
|
+
"@justfortytwo/persona": "1.1.0",
|
|
53
|
+
"@justfortytwo/telegram": "1.1.0",
|
|
54
|
+
"@justfortytwo/scheduler": "2.0.0",
|
|
55
|
+
"@justfortytwo/transcript": "^1.0.1"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|