amorphous-cli 0.3.10 → 0.3.12
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/lib/agent-contract.test.mjs +2 -0
- package/lib/commands.mjs +1 -1
- package/lib/help.mjs +3 -2
- package/lib/help.test.mjs +15 -0
- package/lib/list-command.test.mjs +83 -0
- package/package.json +1 -1
- package/skill/amorphous/SKILL.md +2 -2
|
@@ -54,6 +54,8 @@ test('setup copies the skill, and an edited contract is left alone', () => {
|
|
|
54
54
|
assert.match(skill, /View members can open the live abstract and load its guides/)
|
|
55
55
|
assert.match(skill, /Use members can use the live abstract and submit source recommendations/)
|
|
56
56
|
assert.match(skill, /Only owners and editors can pull and edit source/)
|
|
57
|
+
assert.match(skill, /Only push, preview, publish, invite, or notify when the person asks for that action/i)
|
|
58
|
+
assert.match(skill, /Use `publish --live` only when they explicitly ask to make the version live/i)
|
|
57
59
|
assert.match(skill, /visibility anyone/i)
|
|
58
60
|
assert.match(skill, /anyone can add shared records/i)
|
|
59
61
|
assert.match(skill, /Do not run context again during this task/)
|
package/lib/commands.mjs
CHANGED
|
@@ -395,7 +395,7 @@ function listRow(row) {
|
|
|
395
395
|
row.archived ? 'archived' : null,
|
|
396
396
|
row.collection_path ? `in ${row.collection_path}` : null,
|
|
397
397
|
tags ? `#${tags.replace(/,\s*/g, ' #')}` : null,
|
|
398
|
-
row.live_open ? '
|
|
398
|
+
row.live_open ? 'Anyone with the link' : 'Members only',
|
|
399
399
|
]
|
|
400
400
|
.filter(Boolean)
|
|
401
401
|
.join(' · ')
|
package/lib/help.mjs
CHANGED
|
@@ -51,10 +51,11 @@ Open the browser and finish sign-in there.
|
|
|
51
51
|
|
|
52
52
|
Start the local MCP server on stdio.`,
|
|
53
53
|
|
|
54
|
-
list: `list [--view recents|all|starred|archive] [--folder <name>] [--tag <name>] [--search <q>] [--json]
|
|
54
|
+
list: `list [--view recents|all|starred|archive] [--folder <name>] [--tag <name>] [--search <q>] [--open|--closed] [--json]
|
|
55
55
|
|
|
56
56
|
List abstracts. Default view is all (All Abstracts).
|
|
57
|
-
--folder filters to a folder. --tag filters to a tag
|
|
57
|
+
--folder filters to a folder. --tag filters to a tag.
|
|
58
|
+
Human output ends with the live link audience: “Anyone with the link” or “Members only”. --open and --closed filter that audience; JSON reports it as open.`,
|
|
58
59
|
|
|
59
60
|
create: `create [--name <name>] [--folder <name>] [--template blank|list|board|landing] [--recipe-config <file>] [--json]
|
|
60
61
|
|
package/lib/help.test.mjs
CHANGED
|
@@ -54,3 +54,18 @@ test('visibility help explains public shared-record writes', () => {
|
|
|
54
54
|
test('root help does not hide the write effect of public visibility', () => {
|
|
55
55
|
assert.match(ROOT_HELP, /anyone can view; app may accept shared-record writes/i)
|
|
56
56
|
})
|
|
57
|
+
|
|
58
|
+
test('list help explains that open and closed describe the live link audience', () => {
|
|
59
|
+
let output = ''
|
|
60
|
+
const originalLog = console.log
|
|
61
|
+
console.log = (message) => { output = String(message) }
|
|
62
|
+
try {
|
|
63
|
+
printHelp('list')
|
|
64
|
+
} finally {
|
|
65
|
+
console.log = originalLog
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
assert.match(output, /anyone with the link/i)
|
|
69
|
+
assert.match(output, /members only/i)
|
|
70
|
+
assert.match(output, /--open.*--closed/i)
|
|
71
|
+
})
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import assert from 'node:assert/strict'
|
|
2
|
+
import { createServer } from 'node:http'
|
|
3
|
+
import { mkdtempSync, rmSync } from 'node:fs'
|
|
4
|
+
import { tmpdir } from 'node:os'
|
|
5
|
+
import { join } from 'node:path'
|
|
6
|
+
import test from 'node:test'
|
|
7
|
+
import { runCommand } from './commands.mjs'
|
|
8
|
+
import { saveSession } from './session.mjs'
|
|
9
|
+
|
|
10
|
+
const userId = '10000000-0000-4000-8000-000000000001'
|
|
11
|
+
const payload = (value) => Buffer.from(JSON.stringify(value)).toString('base64url')
|
|
12
|
+
const accessToken = `header.${payload({ sub: userId, exp: Math.floor(Date.now() / 1000) + 3600 })}.signature`
|
|
13
|
+
|
|
14
|
+
test('list says who can open a live abstract instead of calling it closed', async (t) => {
|
|
15
|
+
const root = mkdtempSync(join(tmpdir(), 'am-list-command-'))
|
|
16
|
+
const env = {
|
|
17
|
+
credentials: process.env.AMORPHOUS_CREDENTIALS,
|
|
18
|
+
appUrl: process.env.AMORPHOUS_CLI_APP_URL,
|
|
19
|
+
appOrigin: process.env.APP_ORIGIN,
|
|
20
|
+
}
|
|
21
|
+
process.env.AMORPHOUS_CREDENTIALS = join(root, 'credentials.json')
|
|
22
|
+
process.env.APP_ORIGIN = 'https://amorphous.test'
|
|
23
|
+
saveSession({
|
|
24
|
+
access_token: accessToken,
|
|
25
|
+
refresh_token: 'unused',
|
|
26
|
+
expires_at: Math.floor(Date.now() / 1000) + 3600,
|
|
27
|
+
})
|
|
28
|
+
const rows = [
|
|
29
|
+
{
|
|
30
|
+
id: '20000000-0000-4000-8000-000000000001',
|
|
31
|
+
name: 'Members-only app',
|
|
32
|
+
role: 'use',
|
|
33
|
+
starred: false,
|
|
34
|
+
archived: false,
|
|
35
|
+
tags: [],
|
|
36
|
+
collection_path: null,
|
|
37
|
+
live_open: false,
|
|
38
|
+
updated_at: '2026-10-22T00:00:00.000Z',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: '20000000-0000-4000-8000-000000000002',
|
|
42
|
+
name: 'Public app',
|
|
43
|
+
role: 'owner',
|
|
44
|
+
starred: false,
|
|
45
|
+
archived: false,
|
|
46
|
+
tags: [],
|
|
47
|
+
collection_path: null,
|
|
48
|
+
live_open: true,
|
|
49
|
+
updated_at: '2026-10-22T00:00:00.000Z',
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
const server = createServer((req, res) => {
|
|
53
|
+
res.writeHead(200, { 'content-type': 'application/json' })
|
|
54
|
+
res.end(JSON.stringify({ abstracts: rows }))
|
|
55
|
+
})
|
|
56
|
+
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve))
|
|
57
|
+
process.env.AMORPHOUS_CLI_APP_URL = `http://127.0.0.1:${server.address().port}`
|
|
58
|
+
t.after(async () => {
|
|
59
|
+
server.closeAllConnections?.()
|
|
60
|
+
await new Promise((resolve) => server.close(resolve))
|
|
61
|
+
rmSync(root, { recursive: true, force: true })
|
|
62
|
+
if (env.credentials === undefined) delete process.env.AMORPHOUS_CREDENTIALS
|
|
63
|
+
else process.env.AMORPHOUS_CREDENTIALS = env.credentials
|
|
64
|
+
if (env.appUrl === undefined) delete process.env.AMORPHOUS_CLI_APP_URL
|
|
65
|
+
else process.env.AMORPHOUS_CLI_APP_URL = env.appUrl
|
|
66
|
+
if (env.appOrigin === undefined) delete process.env.APP_ORIGIN
|
|
67
|
+
else process.env.APP_ORIGIN = env.appOrigin
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const output = []
|
|
71
|
+
const originalLog = console.log
|
|
72
|
+
console.log = (message) => output.push(String(message))
|
|
73
|
+
try {
|
|
74
|
+
await runCommand(['list', '--view', 'all'])
|
|
75
|
+
} finally {
|
|
76
|
+
console.log = originalLog
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
assert.deepEqual(output, [
|
|
80
|
+
'Members-only app · 20000000-0000-4000-8000-000000000001 · Can use · Members only',
|
|
81
|
+
'Public app · 20000000-0000-4000-8000-000000000002 · Owner · Anyone with the link',
|
|
82
|
+
])
|
|
83
|
+
})
|
package/package.json
CHANGED
package/skill/amorphous/SKILL.md
CHANGED
|
@@ -36,7 +36,7 @@ A private record belongs to the signed-in person who wrote it. The abstract does
|
|
|
36
36
|
|
|
37
37
|
After `setup`, invite them to describe what they want made. Build it for them.
|
|
38
38
|
Prefer `amorphous-cli serve` while you edit. Open the URL and leave it running. It reloads when the files change, and it is the easiest way for them to look at the work.
|
|
39
|
-
|
|
39
|
+
Only push, preview, publish, invite, or notify when the person asks for that action. Use `publish --live` only when they explicitly ask to make the version live.
|
|
40
40
|
|
|
41
41
|
## Start
|
|
42
42
|
|
|
@@ -61,7 +61,7 @@ When they ask:
|
|
|
61
61
|
- `amorphous-cli push` sends the source. `amorphous-cli push --data` also sends the records in this folder.
|
|
62
62
|
- `amorphous-cli guide save abstract` explicitly saves changes to the shared guide (owner/editor only). `amorphous-cli guide save private` explicitly saves this signed-in person's private guide. A stale revision is refused; reload context and resolve the conflict before saving. Ordinary `push`, `recommend`, and `publish` never save or include either guide.
|
|
63
63
|
- `amorphous-cli preview` and open that URL.
|
|
64
|
-
- `amorphous-cli publish
|
|
64
|
+
- `amorphous-cli publish` creates a version. Add `--live` only when they explicitly ask to make that version live.
|
|
65
65
|
- Collaborators who should propose source for the owner to review can use `amorphous-cli recommend --note "..."`. It does not change the live abstract; the owner reviews and chooses Publish live or Decline.
|
|
66
66
|
- `amorphous-cli invite <email> use` or `edit` or `view`. It emails them a link and prints that link. They open it and sign in with that email.
|
|
67
67
|
- `amorphous-cli notify` emails members that the published version changed. It does not publish. Do that only when they ask.
|