@yuchaocheng/yusijia 0.1.0-beta.1 → 0.1.0-beta.2

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 CHANGED
@@ -2,8 +2,11 @@
2
2
 
3
3
  Standalone compiled ESM CLI and bundled `family-content` Skill for macOS arm64/x64,
4
4
  Node >=20.20.2. Uses Node built-ins, public `exifr` and `zod`. No database or website
5
- source dependency. Photo scans use bounded macOS `sips` width/height probes in
6
- addition to byte-format validation. Directory and explicit-file scans do not require `unzip`; zip
5
+ source dependency. Photo scans use lightweight image signatures and bounded macOS
6
+ `sips` width/height probes, not a strict hand-written format validator. Original
7
+ bytes, including auxiliary data after JPEG image endings, remain unchanged;
8
+ signatures/dimensions do not constitute a full malware scan or exhaustive decode.
9
+ Directory and explicit-file scans do not require `unzip`; zip
7
10
  scans require `/usr/bin/unzip` and fail clearly when unavailable.
8
11
 
9
12
  ## Installation
@@ -19,16 +22,24 @@ yusijia --help
19
22
  yusijia skills install
20
23
  ```
21
24
 
22
- Read the installed `family-content` Skill in your Agent. Beta versions of
25
+ The default installation is `~/.agents/skills/family-content`, for user-level host
26
+ discovery rather than a one-off task directory. Open a new Agent conversation and
27
+ check that `family-content` appears in its available Skills. Hosts that use another
28
+ directory need their supported path via `--dir`; explicitly reading SKILL.md can
29
+ bootstrap a session but does not prove automatic discovery. After discovery, normal
30
+ requests need only the family task and supplied material, not installation steps.
31
+ First setup can be delegated to an Agent: install this public package, run
32
+ `yusijia skills install`, and check host discovery. Beta versions of
23
33
  `yusijia update` stay on the `beta` tag; stable versions use `latest`. Updates never
24
- fall back between channels. No stable `latest` tag is published with this beta.
34
+ fall back between channels. No stable version has been published; unversioned
35
+ installs may also resolve to a beta, so acceptance installs must select `@beta`.
25
36
 
26
37
  Build and test a local tarball (not a release):
27
38
 
28
39
  ```sh
29
40
  pnpm -C family-cli build
30
41
  npm pack ./family-cli --pack-destination ./family-cli
31
- npm install --global /absolute/path/yuchaocheng-yusijia-0.1.0-beta.1.tgz
42
+ npm install --global /absolute/path/yuchaocheng-yusijia-0.1.0-beta.2.tgz
32
43
  yusijia --help
33
44
  yusijia skills install
34
45
  ```
@@ -71,6 +82,12 @@ errors and account/permission refusals leave the credential unchanged.
71
82
 
72
83
  ## Prepare And Confirm
73
84
 
85
+ Generic photo organization is photo-first: select originals and choose an existing
86
+ or new album. Growth timeline events require established milestone significance,
87
+ not ordinary travel scenes. Diaries are proposed only when requested. Inspect
88
+ images when the host supports it, distinguish metadata/documents from actual
89
+ experiences, and ask about important missing facts instead of inventing them.
90
+
74
91
  ```sh
75
92
  yusijia photos scan --input /absolute/photos --out ./scan.json
76
93
  yusijia photos scan --files /absolute/a.jpg --files /absolute/b.png --out ./scan.json
@@ -185,6 +202,16 @@ separate from mocked tests and isolated package installation.
185
202
 
186
203
  ## Development Checks
187
204
 
205
+ For repository engineering checks, build the CLI and use `pnpm agent:dev <command>`
206
+ at the workspace root. This entry fixes `http://127.0.0.1:3600`, uses the isolated
207
+ HOME and working directory `.local/yusijia-dev`, and rejects remote site overrides.
208
+ Plans, progress and installed test Skills stay there; pass absolute material paths,
209
+ and relative plan/output paths are relative to this isolated directory. It never
210
+ falls back to production. This repository-only helper is not part of the public
211
+ package or a requirement for family use. A source-free beta acceptance conversation
212
+ instead uses the public installed CLI, its own separate HOME and an explicit local
213
+ site on every site command; this operational convention is not network isolation.
214
+
188
215
  ```sh
189
216
  pnpm -C family-cli test
190
217
  pnpm -C family-cli typecheck
package/dist/scan.js CHANGED
@@ -11,22 +11,12 @@ import { privateDirectory } from './storage.js';
11
11
  const run = promisify(execFile);
12
12
  const supported = { '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.png': 'image/png', '.webp': 'image/webp' };
13
13
  export function imageMime(b) {
14
- if (b.length >= 24 && b.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])) && b.subarray(-8, -4).toString() === 'IEND')
14
+ // Identify formats here; macOS probes dimensions during scan. Preserve auxiliary bytes.
15
+ if (b.length >= 24 && b.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])))
15
16
  return 'image/png';
16
- if (b.length >= 20 && b[0] === 0xff && b[1] === 0xd8 && b[b.length - 2] === 0xff && b[b.length - 1] === 0xd9) {
17
- let i = 2, hasFrame = false;
18
- while (i + 4 < b.length && b[i] === 0xff) {
19
- const marker = b[i + 1], length = b.readUInt16BE(i + 2);
20
- if (length < 2 || i + 2 + length > b.length)
21
- break;
22
- if ([0xc0, 0xc1, 0xc2].includes(marker) && length >= 8 && b.readUInt16BE(i + 5) && b.readUInt16BE(i + 7))
23
- hasFrame = true;
24
- if (marker === 0xda)
25
- return hasFrame ? 'image/jpeg' : undefined;
26
- i += length + 2;
27
- }
28
- }
29
- if (b.length >= 20 && b.subarray(0, 4).toString() === 'RIFF' && b.subarray(8, 12).toString() === 'WEBP' && b.readUInt32LE(4) + 8 === b.length && ['VP8 ', 'VP8L', 'VP8X'].includes(b.subarray(12, 16).toString()))
17
+ if (b.length >= 20 && b.subarray(0, 3).equals(Buffer.from([255, 216, 255])))
18
+ return 'image/jpeg';
19
+ if (b.length >= 20 && b.subarray(0, 4).toString() === 'RIFF' && b.subarray(8, 12).toString() === 'WEBP')
30
20
  return 'image/webp';
31
21
  }
32
22
  export async function readPhoto(file, expected, scope) {
package/dist/skills.d.ts CHANGED
@@ -4,6 +4,7 @@ export declare function installSkill(directory?: string, stateDir?: string): Pro
4
4
  directory: string;
5
5
  cliVersion: string;
6
6
  skillVersion: string;
7
+ nextStep: string;
7
8
  }>;
8
9
  export declare function updateSkills(stateDir?: string): Promise<{
9
10
  ok: boolean;
package/dist/skills.js CHANGED
@@ -53,7 +53,8 @@ export async function installSkill(directory = defaultSkillDirectory(), stateDir
53
53
  await writeSkillFile(join(target, 'SKILL.md'), skill);
54
54
  await writePrivateJson(join(target, '.yusijia-skill.json'), { version: VERSION, hash: sha256(skill) });
55
55
  await writePrivateJson(registry, [...new Set([...installed, target])]);
56
- return { directory: target, cliVersion: VERSION, skillVersion: VERSION };
56
+ return { directory: target, cliVersion: VERSION, skillVersion: VERSION,
57
+ nextStep: 'Open a new conversation and check that your Agent lists family-content. If it does not, use the host-supported skill directory; reading SKILL.md explicitly is not automatic discovery.' };
57
58
  }
58
59
  async function writeSkillFile(file, text) {
59
60
  const { writePrivateText } = await import('./storage.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuchaocheng/yusijia",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.2",
4
4
  "description": "Family content CLI and Agent Skill for photos, albums, timelines and diaries",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": { "access": "public", "tag": "beta", "registry": "https://registry.npmjs.org/" },
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: family-content
3
- description: Use yusijia to prepare explicitly supplied photos and query or propose confirmed family albums, growth timeline events and diary changes.
3
+ description: Organize and import supplied family or holiday photos into the family website, choose albums, and query or prepare growth milestones and diaries when requested. Use the yusijia CLI; preview content before user-confirmed writes.
4
4
  metadata:
5
5
  cli-version: '{{CLI_VERSION}}'
6
6
  ---
@@ -12,18 +12,58 @@ read credentials.json, request passwords/tokens, or copy browser cookies. This S
12
12
  contains instructions, not family data. Check `yusijia --version` and `yusijia --help`.
13
13
  The installed Skill and CLI should have the same version.
14
14
 
15
+ ## First Use
16
+
17
+ If `yusijia` is missing, install `@yuchaocheng/yusijia` globally from
18
+ `https://registry.npmjs.org/`, then run `yusijia skills install` without `--dir`.
19
+ Use `@beta` only when the user explicitly requests a beta trial; otherwise use
20
+ `@latest`. Never use sudo or a corporate registry. If installation cannot run,
21
+ report the actual blocker rather than cloning the website or guessing a binary.
22
+ Install into the default user-level directory for future host discovery, not just
23
+ a task-local directory. A new conversation may be needed to discover the Skill;
24
+ check the host's available Skills before claiming automatic activation. Once
25
+ installed and discovered, normal requests only need the user's intent and material.
26
+
15
27
  ## Identity
16
28
 
17
29
  `yusijia auth login --json` opens the site's authorization page. The user signs in
18
30
  and approves there. `auth status --json` shows the bound account and expiry. Default
19
31
  site is https://yusijia.me; use explicit `--site` for a different HTTPS site or local
20
- development loopback. State the site/account before any content plan. `auth logout`
32
+ development loopback. Never infer a development site from cwd, browser tabs or a
33
+ beta version. For an explicitly requested development trial, keep a separate HOME
34
+ for CLI credentials/progress and private plans, pass the same explicit `--site` on
35
+ every site command, and keep a short task-local environment/progress note without
36
+ secrets. Do not use production credentials or fall back to production when local
37
+ requests fail. State the site/account before a CLI remote-write plan. Plain
38
+ conversational drafting or local analysis does not require login or a site query.
39
+ `auth logout`
21
40
  revokes then removes this site's credential. A failure is not successful revocation.
22
41
  The credential lasts 30 days and is plaintext in an owner-only file, not encrypted;
23
42
  same-user processes, root and copied files remain a risk.
24
43
 
25
44
  ## Read And Prepare
26
45
 
46
+ - Inspect the actual images using the host's local image tools, plus available EXIF
47
+ and auxiliary material. If visual tools are unavailable, disclose that limitation
48
+ and use metadata conservatively; do not describe rule grouping as seeing images.
49
+ - Separate visible observations, metadata/document facts and the user's account.
50
+ A ticket is not proof that every booked leg was traveled; its screenshot date is
51
+ not the trip date. Do not invent identities, relationships, feelings or stories.
52
+ - Photo-first: a general request to organize supplied material should propose
53
+ selected photos and an existing or new album, not a checklist of every feature.
54
+ Query relevant albums and ask only when a core choice cannot be safely made.
55
+ - Growth timeline entries are for meaningful milestones established by the user or
56
+ clarified with them, not routine itineraries or every scene. Do not infer a first
57
+ ride or developmental achievement from a photo. Omit events without such meaning.
58
+ A vague request to record material does not itself request a timeline event.
59
+ - Do not draft or save a diary unless the user expresses that intent. A family
60
+ photo request alone is not diary consent; diary capability remains available.
61
+ - Merge questions only about facts indispensable to the selected content, such as
62
+ its event date or milestone meaning. Missing people, feelings or itinerary details
63
+ are not a mandatory questionnaire. Polish expression, not facts. If sources
64
+ conflict, clarify the affected claim or omit it; continue unrelated photo/album
65
+ preparation. Omit uncertain optional content rather than blocking the workflow.
66
+
27
67
  - Query only relevant bounded pages: `photos|albums|timeline|diary list --limit 30
28
68
  --cursor <opaque-cursor> --json`; `get --id <id> --json` for detail.
29
69
  - Photo URLs are omitted by default. Only request `photos get --id <id>
@@ -35,6 +75,10 @@ same-user processes, root and copied files remain a risk.
35
75
  first. Do not imply rule-based grouping is visual inspection, or that old photos
36
76
  without hashes can all be deduplicated. Never scan the whole disk or call external
37
77
  vision services by default. Keep generated plans/scans private.
78
+ - Do not trim or re-encode a readable supported original just to bypass a CLI
79
+ rejection. Report the incompatibility and preserve the original; any necessary
80
+ conversion needs a disclosed separate copy and user approval, not silent loss
81
+ of original hashes or auxiliary information.
38
82
 
39
83
  ## Preview, Confirm, Execute
40
84
 
@@ -54,9 +98,10 @@ In a combined plan, `albums.photos` requires both `payload.add` and
54
98
  values or references to a prior album action). For a standalone association,
55
99
  prefer `albums add/remove --id ... --photo-id ... --out ...`.
56
100
 
57
- Before execution show the site, account, every target and expected version, selected
58
- photos including GPS/time and create/reuse expectations, album associations, event
59
- date/title/description/photos, and complete diary text plus DRAFT/PUBLISHED status.
101
+ Before execution show only the content actually proposed: site, account, every
102
+ target and expected version, selected photos including GPS/time and create/reuse
103
+ expectations and album associations; for requested events include date/title/
104
+ description/photos, and for requested diaries include complete text and status.
60
105
  Ask the user to confirm that exact plan. One explicit confirmation may cover the
61
106
  whole plan. A saved draft is also a remote write requiring confirmation.
62
107
 
@@ -91,4 +136,5 @@ already published photos remain. Do not delete formal content as compensation.
91
136
  `skills update` synchronizes registered installations without overwriting edits.
92
137
  `update` uses public npm for this global package, then the new CLI synchronizes
93
138
  Skills. Do not run sudo, read secret files, or claim success on a Skill conflict.
94
- The private placeholder package cannot update remotely until publication preflight.
139
+ The public package is `@yuchaocheng/yusijia`. Beta installations update from the
140
+ `beta` tag; stable installations use `latest`, with no fallback between channels.