@paneui/cli 0.0.6 → 0.0.8
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 +9 -9
- package/dist/commands/agent.js +17 -4
- package/dist/commands/attachment-delete.js +37 -0
- package/dist/commands/{blob-download.js → attachment-download.js} +15 -11
- package/dist/commands/{blob-list.js → attachment-list.js} +9 -9
- package/dist/commands/{blob-show.js → attachment-show.js} +11 -11
- package/dist/commands/{blob-token.js → attachment-token.js} +31 -31
- package/dist/commands/{blob-upload.js → attachment-upload.js} +20 -20
- package/dist/commands/{blob.js → attachment.js} +40 -40
- package/dist/commands/claim.js +68 -0
- package/dist/commands/create.js +71 -71
- package/dist/commands/delete.js +12 -12
- package/dist/commands/feedback.js +5 -5
- package/dist/commands/list.js +23 -23
- package/dist/commands/participant.js +38 -38
- package/dist/commands/send.js +33 -27
- package/dist/commands/state.js +12 -12
- package/dist/commands/{session.js → surface.js} +24 -24
- package/dist/commands/taste.js +14 -14
- package/dist/commands/{artifact.js → template.js} +76 -76
- package/dist/commands/watch.js +22 -22
- package/dist/index.js +17 -17
- package/dist/input.js +2 -2
- package/dist/output.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/commands/blob-delete.js +0 -37
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// `pane agent claim <code>` — bind this agent to a human via a one-shot
|
|
2
|
+
// claim code the human generated in their settings UI.
|
|
3
|
+
//
|
|
4
|
+
// Flow (§6.1):
|
|
5
|
+
// 1. Alice opens Settings → "Claim an agent" → relay mints a one-shot code,
|
|
6
|
+
// shows it to her once, 15-min TTL.
|
|
7
|
+
// 2. Alice hands the code to the agent out-of-band (this CLI invocation
|
|
8
|
+
// is exactly that handoff).
|
|
9
|
+
// 3. CLI calls POST /v1/agents/claim with the calling agent's API key.
|
|
10
|
+
// 4. Relay binds Agent.ownerHumanId = alice.id, migrates surface ownership.
|
|
11
|
+
//
|
|
12
|
+
// The CLI does NOT print the human's email or id — only the relay's response,
|
|
13
|
+
// which is { ok, owner_human_id, claimed_at }. The agent's existing API key
|
|
14
|
+
// keeps working.
|
|
15
|
+
import { PaneClient, PaneApiError } from "@paneui/core";
|
|
16
|
+
import { assertKnownFlags } from "../argv.js";
|
|
17
|
+
import { resolveConfig } from "../config.js";
|
|
18
|
+
import { printJson, fail } from "../output.js";
|
|
19
|
+
const KNOWN_FLAGS = ["url", "api-key"];
|
|
20
|
+
const KNOWN_BOOLS = [];
|
|
21
|
+
export const claimHelp = `pane agent claim — claim this agent for a human
|
|
22
|
+
|
|
23
|
+
Usage:
|
|
24
|
+
pane agent claim <code>
|
|
25
|
+
|
|
26
|
+
Binds the calling agent to the human whose one-shot claim code is provided.
|
|
27
|
+
The human generates the code in their settings UI (or via the relay's
|
|
28
|
+
POST /v1/self/claim-codes endpoint) and hands it to the agent out-of-band.
|
|
29
|
+
|
|
30
|
+
Arguments:
|
|
31
|
+
<code> The one-shot claim code (begins with cc_). Required.
|
|
32
|
+
|
|
33
|
+
Options:
|
|
34
|
+
--url <url> Relay base URL. Falls back to PANE_URL / config file.
|
|
35
|
+
--api-key <key> Agent API key. Falls back to PANE_API_KEY / config file.
|
|
36
|
+
-h, --help Show this help.
|
|
37
|
+
|
|
38
|
+
Output (stdout, JSON):
|
|
39
|
+
{ ok: true, owner_human_id, claimed_at }
|
|
40
|
+
|
|
41
|
+
Errors:
|
|
42
|
+
invalid_code code is unknown, expired, or already consumed
|
|
43
|
+
agent_already_claimed this agent already has an owning human
|
|
44
|
+
|
|
45
|
+
Notes:
|
|
46
|
+
This is a one-way operation. To rotate the owner, revoke this agent
|
|
47
|
+
(\`pane key revoke\`) and register a new one.`;
|
|
48
|
+
export async function runClaim(args) {
|
|
49
|
+
assertKnownFlags(args, KNOWN_FLAGS, KNOWN_BOOLS, "pane agent claim");
|
|
50
|
+
const code = args.positionals[0];
|
|
51
|
+
if (!code) {
|
|
52
|
+
fail("missing required argument: <code> — run 'pane agent claim --help'", "invalid_args");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const creds = resolveConfig(args);
|
|
56
|
+
const client = new PaneClient({ url: creds.url, apiKey: creds.apiKey });
|
|
57
|
+
try {
|
|
58
|
+
const result = await client.claimAgent(code);
|
|
59
|
+
printJson(result);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
if (err instanceof PaneApiError) {
|
|
63
|
+
fail(err.message, err.code);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
}
|
package/dist/commands/create.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
// `pane
|
|
1
|
+
// `pane surface create` — create a surface via POST /v1/surfaces.
|
|
2
2
|
import { createSessionSchema } from "@paneui/core";
|
|
3
3
|
import { assertKnownFlags } from "../argv.js";
|
|
4
4
|
import { makeClient } from "../config.js";
|
|
5
5
|
import { resolveJson, resolveText } from "../input.js";
|
|
6
6
|
import { printJson, fail, failFromError } from "../output.js";
|
|
7
7
|
const KNOWN_FLAGS = [
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
8
|
+
"template",
|
|
9
|
+
"template-id",
|
|
10
|
+
"template-type",
|
|
11
11
|
"version",
|
|
12
12
|
"event-schema",
|
|
13
13
|
"input-schema",
|
|
@@ -26,9 +26,9 @@ const KNOWN_BOOLS = [];
|
|
|
26
26
|
//
|
|
27
27
|
// Match strategy: longest prefix wins. Schema paths whose top segment isn't
|
|
28
28
|
// in the table fall back to dotted notation so we degrade gracefully on
|
|
29
|
-
// fields that don't have a single corresponding flag (e.g. `
|
|
30
|
-
// — there's no single --
|
|
31
|
-
// --
|
|
29
|
+
// fields that don't have a single corresponding flag (e.g. `template.source`
|
|
30
|
+
// — there's no single --template-source flag for the inline form, just
|
|
31
|
+
// --template pointing at the whole attachment).
|
|
32
32
|
const SCHEMA_PATH_TO_FLAG = {
|
|
33
33
|
participants: "--participants",
|
|
34
34
|
"participants.humans": "--participants",
|
|
@@ -37,12 +37,12 @@ const SCHEMA_PATH_TO_FLAG = {
|
|
|
37
37
|
callback: "--callback",
|
|
38
38
|
input_data: "--input-data",
|
|
39
39
|
title: "--title",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
40
|
+
"template.id": "--template-id",
|
|
41
|
+
"template.version": "--version",
|
|
42
|
+
"template.type": "--template-type",
|
|
43
|
+
"template.source": "--template",
|
|
44
|
+
"template.event_schema": "--event-schema",
|
|
45
|
+
"template.input_schema": "--input-schema",
|
|
46
46
|
};
|
|
47
47
|
function schemaPathToFlag(path) {
|
|
48
48
|
const dotted = path.map(String).join(".");
|
|
@@ -57,32 +57,32 @@ function schemaPathToFlag(path) {
|
|
|
57
57
|
}
|
|
58
58
|
return dotted;
|
|
59
59
|
}
|
|
60
|
-
export const createHelp = `pane
|
|
60
|
+
export const createHelp = `pane surface create — create a Pane surface
|
|
61
61
|
|
|
62
|
-
A
|
|
62
|
+
A surface is one use of an template. Supply the template in ONE of two ways:
|
|
63
63
|
|
|
64
|
-
Reference form — instance an existing reusable
|
|
64
|
+
Reference form — instance an existing reusable template (the cheap path,
|
|
65
65
|
no HTML re-sent):
|
|
66
|
-
pane
|
|
66
|
+
pane surface create --template-id <id|slug> [--version <n>] [--input-data <v>]
|
|
67
67
|
|
|
68
|
-
Inline form — a one-off
|
|
69
|
-
pane
|
|
68
|
+
Inline form — a one-off template, defined on this call:
|
|
69
|
+
pane surface create --template <path|inline> [--event-schema <path|json>] [options]
|
|
70
70
|
|
|
71
|
-
Exactly one of --
|
|
71
|
+
Exactly one of --template-id / --template must be given.
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
--
|
|
75
|
-
Tip: run 'pane
|
|
76
|
-
suitable
|
|
73
|
+
Template (choose one):
|
|
74
|
+
--template-id <v> Reference an existing named template by id or slug.
|
|
75
|
+
Tip: run 'pane template search <keywords>' first — a
|
|
76
|
+
suitable template may already exist; reuse it instead of
|
|
77
77
|
regenerating HTML.
|
|
78
|
-
--version <n> With --
|
|
79
|
-
the
|
|
80
|
-
--
|
|
81
|
-
HTML. Combine with --
|
|
78
|
+
--version <n> With --template-id: pin a specific version. Defaults to
|
|
79
|
+
the template's latest version.
|
|
80
|
+
--template <v> Inline HTML template. Either a file path / URL, or inline
|
|
81
|
+
HTML. Combine with --template-type to control reading.
|
|
82
82
|
--event-schema <v> Inline-form event schema. A .json file, or inline JSON.
|
|
83
|
-
Optional with --
|
|
83
|
+
Optional with --template. Omit for a view-only template
|
|
84
84
|
(a report/dashboard the human only views — no page/agent
|
|
85
|
-
events). Ignored with --
|
|
85
|
+
events). Ignored with --template-id.
|
|
86
86
|
|
|
87
87
|
Shape — an object with an "events" map, keyed by event
|
|
88
88
|
type. Each entry declares who may emit it and the JSON
|
|
@@ -103,30 +103,30 @@ Artifact (choose one):
|
|
|
103
103
|
payload is a JSON Schema; the relay validates every
|
|
104
104
|
emit against it. See docs/SPEC.md for the full grammar.
|
|
105
105
|
--input-schema <v> Inline-form input schema. A .json file, or inline JSON.
|
|
106
|
-
Optional with --
|
|
107
|
-
(the schema comes from the pinned
|
|
108
|
-
there). When present, the
|
|
109
|
-
validated against it AND any
|
|
110
|
-
"format": "pane-
|
|
111
|
-
page via window.pane.downloadBlob. Without it,
|
|
106
|
+
Optional with --template, rejected with --template-id
|
|
107
|
+
(the schema comes from the pinned template version
|
|
108
|
+
there). When present, the surface's --input-data is
|
|
109
|
+
validated against it AND any attachment ids declared at a
|
|
110
|
+
"format": "pane-attachment-id" site become reachable from the
|
|
111
|
+
page via window.pane.downloadBlob. Without it, attachment
|
|
112
112
|
refs in --input-data are silently unreachable. See
|
|
113
113
|
docs/SPEC.md and #208.
|
|
114
114
|
|
|
115
115
|
Options:
|
|
116
116
|
--title <text> Tab title shown to the human (max 80 chars, single
|
|
117
117
|
line). Required, with one ergonomic exception: when
|
|
118
|
-
--
|
|
119
|
-
falls back to
|
|
118
|
+
--template-id references a named template, the relay
|
|
119
|
+
falls back to Template.name. Inline (--template …) form
|
|
120
120
|
always needs --title.
|
|
121
121
|
--input-data <v> This instance's seed data — a JSON object (file path or
|
|
122
|
-
inline JSON), validated by the relay against the
|
|
122
|
+
inline JSON), validated by the relay against the template
|
|
123
123
|
version's input_schema. The page reads it as
|
|
124
124
|
window.pane.inputData.
|
|
125
|
-
--
|
|
126
|
-
the --
|
|
127
|
-
does not serve "html-ref"
|
|
128
|
-
will reject the
|
|
129
|
-
--ttl <seconds>
|
|
125
|
+
--template-type <t> "html-inline" (default) or "html-ref". With "html-ref"
|
|
126
|
+
the --template value is treated as a URL. Note: the relay
|
|
127
|
+
does not serve "html-ref" templates in this release and
|
|
128
|
+
will reject the surface — use "html-inline".
|
|
129
|
+
--ttl <seconds> Surface time-to-live in seconds. The relay clamps this
|
|
130
130
|
to its configured MAX_TTL_SECONDS (defaults: 1 h
|
|
131
131
|
requested, 24 h max for self-host; hosted may differ).
|
|
132
132
|
The returned \`expires_at\` is the authoritative value.
|
|
@@ -138,19 +138,19 @@ Options:
|
|
|
138
138
|
-h, --help Show this help.
|
|
139
139
|
|
|
140
140
|
Output (stdout, JSON):
|
|
141
|
-
{
|
|
141
|
+
{ surface_id, urls, tokens, expires_at }
|
|
142
142
|
|
|
143
143
|
Deliver urls.humans to the human(s); keep tokens.agent for the WS stream.`;
|
|
144
144
|
export async function runCreate(args) {
|
|
145
|
-
assertKnownFlags(args, KNOWN_FLAGS, KNOWN_BOOLS, "pane
|
|
146
|
-
const artifactIdVal = args.flags.get("
|
|
147
|
-
const artifactVal = args.flags.get("
|
|
148
|
-
// Exactly one of the two
|
|
145
|
+
assertKnownFlags(args, KNOWN_FLAGS, KNOWN_BOOLS, "pane surface create");
|
|
146
|
+
const artifactIdVal = args.flags.get("template-id");
|
|
147
|
+
const artifactVal = args.flags.get("template");
|
|
148
|
+
// Exactly one of the two template forms must be present.
|
|
149
149
|
if (artifactIdVal !== undefined && artifactVal !== undefined) {
|
|
150
|
-
fail("pass only one of --
|
|
150
|
+
fail("pass only one of --template-id (reference an existing template) or --template (inline a one-off)", "invalid_args");
|
|
151
151
|
}
|
|
152
152
|
if (artifactIdVal === undefined && artifactVal === undefined) {
|
|
153
|
-
fail("missing
|
|
153
|
+
fail("missing template — pass --template-id <id|slug> to reference an existing template, or --template <path|inline> to inline one", "invalid_args");
|
|
154
154
|
}
|
|
155
155
|
// Assemble a candidate request object, then validate the whole thing with
|
|
156
156
|
// the shared Zod schema (single source of truth, matches what the relay
|
|
@@ -158,11 +158,11 @@ export async function runCreate(args) {
|
|
|
158
158
|
// flag-specific message; the schema then enforces shape and bounds.
|
|
159
159
|
const candidate = {};
|
|
160
160
|
if (artifactIdVal !== undefined) {
|
|
161
|
-
// Reference form — instance an existing named
|
|
162
|
-
// --event-schema / --input-schema are not used here: the
|
|
161
|
+
// Reference form — instance an existing named template. --template /
|
|
162
|
+
// --event-schema / --input-schema are not used here: the template's
|
|
163
163
|
// pinned version carries them already.
|
|
164
164
|
if (args.flags.get("input-schema") !== undefined) {
|
|
165
|
-
fail("--input-schema is incompatible with --
|
|
165
|
+
fail("--input-schema is incompatible with --template-id — the input schema comes from the pinned template version. Author the schema on the template (`pane template create --input-schema …`) instead.", "invalid_args");
|
|
166
166
|
}
|
|
167
167
|
const ref = { id: artifactIdVal };
|
|
168
168
|
const versionRaw = args.flags.get("version");
|
|
@@ -173,40 +173,40 @@ export async function runCreate(args) {
|
|
|
173
173
|
}
|
|
174
174
|
ref["version"] = version;
|
|
175
175
|
}
|
|
176
|
-
candidate["
|
|
176
|
+
candidate["template"] = ref;
|
|
177
177
|
}
|
|
178
178
|
else {
|
|
179
|
-
// Inline form — the event + input schemas ride inside the `
|
|
180
|
-
// object; the relay transparently creates an anonymous
|
|
179
|
+
// Inline form — the event + input schemas ride inside the `template`
|
|
180
|
+
// object; the relay transparently creates an anonymous template behind
|
|
181
181
|
// it. Both schemas are optional:
|
|
182
182
|
// - --event-schema absent → view-only one-off (no page/agent emits)
|
|
183
183
|
// - --input-schema absent → no input contract; --input-data passes
|
|
184
|
-
// through unvalidated AND any
|
|
185
|
-
// the page (the participant
|
|
186
|
-
// against the
|
|
187
|
-
// when --input-data carries
|
|
184
|
+
// through unvalidated AND any attachment ids in it are unreachable from
|
|
185
|
+
// the page (the participant attachment-download bridge walks input_data
|
|
186
|
+
// against the template version's inputSchema). Pass --input-schema
|
|
187
|
+
// when --input-data carries attachment refs the page needs to render.
|
|
188
188
|
// See #208.
|
|
189
189
|
const schemaVal = args.flags.get("event-schema");
|
|
190
190
|
const inputSchemaVal = args.flags.get("input-schema");
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
fail("--
|
|
191
|
+
const templateType = (args.flags.get("template-type") ?? "html-inline");
|
|
192
|
+
if (templateType !== "html-inline" && templateType !== "html-ref") {
|
|
193
|
+
fail("--template-type must be 'html-inline' or 'html-ref'", "invalid_args");
|
|
194
194
|
}
|
|
195
195
|
// html-ref: the value is a URL, used verbatim. html-inline: file or literal.
|
|
196
196
|
let source;
|
|
197
197
|
try {
|
|
198
198
|
source =
|
|
199
|
-
|
|
199
|
+
templateType === "html-ref" ? artifactVal : resolveText(artifactVal);
|
|
200
200
|
}
|
|
201
201
|
catch (e) {
|
|
202
202
|
fail(e instanceof Error ? e.message : String(e), "invalid_args");
|
|
203
203
|
}
|
|
204
|
-
// Build the inline
|
|
204
|
+
// Build the inline template object. event_schema / input_schema are
|
|
205
205
|
// OMITTED entirely (not set to undefined) when their flags are absent —
|
|
206
|
-
// omission is meaningful at the relay (view-only
|
|
206
|
+
// omission is meaningful at the relay (view-only template / no input
|
|
207
207
|
// contract).
|
|
208
208
|
const inlineArtifact = {
|
|
209
|
-
type:
|
|
209
|
+
type: templateType,
|
|
210
210
|
source,
|
|
211
211
|
};
|
|
212
212
|
if (schemaVal !== undefined) {
|
|
@@ -229,11 +229,11 @@ export async function runCreate(args) {
|
|
|
229
229
|
fail(e instanceof Error ? e.message : String(e), "invalid_args");
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
candidate["
|
|
232
|
+
candidate["template"] = inlineArtifact;
|
|
233
233
|
}
|
|
234
234
|
// --title — passthrough, no client-side requiredness. The relay is the
|
|
235
|
-
// single source of truth: it enforces "required, with --
|
|
236
|
-
//
|
|
235
|
+
// single source of truth: it enforces "required, with --template-id +
|
|
236
|
+
// Template.name as the only fallback" and the shape rules (length, control
|
|
237
237
|
// chars). Keeping all that server-side avoids drift between the CLI's
|
|
238
238
|
// pre-checks and the relay's actual rules.
|
|
239
239
|
const titleRaw = args.flags.get("title");
|
package/dist/commands/delete.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
// `pane
|
|
1
|
+
// `pane surface delete <id>` — close/delete a surface.
|
|
2
2
|
import { assertKnownFlags } from "../argv.js";
|
|
3
3
|
import { makeClient } from "../config.js";
|
|
4
4
|
import { printJson, fail, failFromError } from "../output.js";
|
|
5
5
|
const KNOWN_FLAGS = [];
|
|
6
6
|
const KNOWN_BOOLS = [];
|
|
7
|
-
export const deleteHelp = `pane
|
|
7
|
+
export const deleteHelp = `pane surface delete — close/delete a surface
|
|
8
8
|
|
|
9
9
|
Usage:
|
|
10
|
-
pane
|
|
10
|
+
pane surface delete <surface-id> [options]
|
|
11
11
|
|
|
12
|
-
Closes and deletes the
|
|
13
|
-
relay side — deleting an already-closed
|
|
12
|
+
Closes and deletes the surface (DELETE /v1/surfaces/:id). Idempotent on the
|
|
13
|
+
relay side — deleting an already-closed surface still succeeds.
|
|
14
14
|
|
|
15
15
|
Options:
|
|
16
16
|
--url <url> Relay base URL (overrides PANE_URL).
|
|
@@ -18,16 +18,16 @@ Options:
|
|
|
18
18
|
-h, --help Show this help.
|
|
19
19
|
|
|
20
20
|
Output (stdout, JSON):
|
|
21
|
-
{
|
|
21
|
+
{ surface_id, deleted: true }`;
|
|
22
22
|
export async function runDelete(args) {
|
|
23
|
-
assertKnownFlags(args, KNOWN_FLAGS, KNOWN_BOOLS, "pane
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
fail("missing <
|
|
23
|
+
assertKnownFlags(args, KNOWN_FLAGS, KNOWN_BOOLS, "pane surface delete");
|
|
24
|
+
const surfaceId = args.positionals[0];
|
|
25
|
+
if (!surfaceId)
|
|
26
|
+
fail("missing <surface-id>", "invalid_args");
|
|
27
27
|
const client = makeClient(args);
|
|
28
28
|
try {
|
|
29
|
-
await client.deleteSession(
|
|
30
|
-
printJson({
|
|
29
|
+
await client.deleteSession(surfaceId);
|
|
30
|
+
printJson({ surface_id: surfaceId, deleted: true });
|
|
31
31
|
}
|
|
32
32
|
catch (e) {
|
|
33
33
|
failFromError(e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { assertKnownFlags } from "../argv.js";
|
|
2
2
|
import { makeClient } from "../config.js";
|
|
3
3
|
import { printJson, fail, failFromError } from "../output.js";
|
|
4
|
-
const CREATE_FLAGS = ["type", "message", "
|
|
4
|
+
const CREATE_FLAGS = ["type", "message", "surface-id"];
|
|
5
5
|
const LIST_FLAGS = ["limit", "before"];
|
|
6
6
|
const NO_BOOLS = [];
|
|
7
7
|
export const feedbackHelp = `pane feedback — submit / list feedback to the relay operator
|
|
@@ -25,7 +25,7 @@ Options for 'create':
|
|
|
25
25
|
--type <bug|feature|note> Feedback category. Required.
|
|
26
26
|
--message <text|-> Message body. Pass '-' to read from stdin.
|
|
27
27
|
1..4000 chars after trim.
|
|
28
|
-
--
|
|
28
|
+
--surface-id <id> Optional surface this feedback relates to;
|
|
29
29
|
must belong to YOUR agent.
|
|
30
30
|
|
|
31
31
|
Options for 'list':
|
|
@@ -38,7 +38,7 @@ Global:
|
|
|
38
38
|
-h, --help Show this help.
|
|
39
39
|
|
|
40
40
|
Examples:
|
|
41
|
-
pane feedback create --type bug --message "watch hangs on empty
|
|
41
|
+
pane feedback create --type bug --message "watch hangs on empty surface"
|
|
42
42
|
echo "long-form note..." | pane feedback create --type note --message -
|
|
43
43
|
pane feedback list --limit 20
|
|
44
44
|
|
|
@@ -55,7 +55,7 @@ async function runFeedbackCreate(args) {
|
|
|
55
55
|
assertKnownFlags(args, CREATE_FLAGS, NO_BOOLS, "pane feedback create");
|
|
56
56
|
const type = args.flags.get("type");
|
|
57
57
|
const rawMessage = args.flags.get("message");
|
|
58
|
-
const
|
|
58
|
+
const surfaceId = args.flags.get("surface-id");
|
|
59
59
|
if (type === undefined) {
|
|
60
60
|
fail("'pane feedback create' requires --type <bug|feature|note>", "invalid_args");
|
|
61
61
|
}
|
|
@@ -83,7 +83,7 @@ async function runFeedbackCreate(args) {
|
|
|
83
83
|
const res = await client.submitFeedback({
|
|
84
84
|
type: type,
|
|
85
85
|
message,
|
|
86
|
-
...(
|
|
86
|
+
...(surfaceId !== undefined ? { surfaceId } : {}),
|
|
87
87
|
});
|
|
88
88
|
printJson(res);
|
|
89
89
|
}
|
package/dist/commands/list.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
// `pane
|
|
1
|
+
// `pane surface list` — enumerate YOUR agent's surfaces.
|
|
2
2
|
//
|
|
3
3
|
// The recovery primitive when the create-response was dropped: the URL itself
|
|
4
4
|
// is unrecoverable (the relay stores only the token hash), but every other
|
|
5
|
-
// field of the
|
|
6
|
-
// `pane
|
|
5
|
+
// field of the surface is intact and listable here. Pair with
|
|
6
|
+
// `pane surface participant new` to mint a fresh URL on a surface whose
|
|
7
7
|
// original was lost.
|
|
8
8
|
import { assertKnownFlags } from "../argv.js";
|
|
9
9
|
import { makeClient } from "../config.js";
|
|
10
10
|
import { printJson, fail, failFromError } from "../output.js";
|
|
11
|
-
const KNOWN_FLAGS = ["status", "limit", "cursor", "
|
|
11
|
+
const KNOWN_FLAGS = ["status", "limit", "cursor", "template-id"];
|
|
12
12
|
const KNOWN_BOOLS = [];
|
|
13
|
-
export const listHelp = `pane
|
|
13
|
+
export const listHelp = `pane surface list — list YOUR agent's surfaces
|
|
14
14
|
|
|
15
|
-
Prints
|
|
16
|
-
tokens are stored hashed and CANNOT be recovered — if you lost a
|
|
17
|
-
mint a fresh one with 'pane
|
|
15
|
+
Prints surfaces (newest first) with no secrets in the response. Participant
|
|
16
|
+
tokens are stored hashed and CANNOT be recovered — if you lost a surface URL,
|
|
17
|
+
mint a fresh one with 'pane surface participant new <surface-id>'.
|
|
18
18
|
|
|
19
19
|
Usage:
|
|
20
|
-
pane
|
|
20
|
+
pane surface list [options]
|
|
21
21
|
|
|
22
22
|
Options:
|
|
23
23
|
--status <s> open | closed | all. Default: open. The status reported
|
|
@@ -25,29 +25,29 @@ Options:
|
|
|
25
25
|
is reported as 'closed' even if not yet swept.
|
|
26
26
|
--limit <N> Page size (default 50, max 200).
|
|
27
27
|
--cursor <c> Opaque cursor from a previous page's next_cursor.
|
|
28
|
-
--
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
--template-id <i> Filter to surfaces instantiated from a specific named
|
|
29
|
+
template (head id; not version id). Inline (anonymous)
|
|
30
|
+
templates cannot be filtered this way — they have no
|
|
31
31
|
stable handle.
|
|
32
32
|
--url <url> Relay base URL (overrides PANE_URL).
|
|
33
33
|
--api-key <key> Agent API key (overrides PANE_API_KEY).
|
|
34
34
|
-h, --help Show this help.
|
|
35
35
|
|
|
36
|
-
Recovery recipe (lost the URL but the
|
|
37
|
-
pane
|
|
38
|
-
#
|
|
36
|
+
Recovery recipe (lost the URL but the surface is still alive):
|
|
37
|
+
pane surface list # find the
|
|
38
|
+
# surface_id +
|
|
39
39
|
# participant_id
|
|
40
40
|
# you lost
|
|
41
|
-
pane
|
|
42
|
-
pane
|
|
41
|
+
pane surface participant new <surface-id> # mint a fresh URL
|
|
42
|
+
pane surface participant revoke <surface-id> <p-id> # invalidate the
|
|
43
43
|
# old URL
|
|
44
44
|
|
|
45
45
|
Output (stdout, JSON):
|
|
46
46
|
{
|
|
47
47
|
items: [
|
|
48
48
|
{
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
surface_id, title, status, template_id, template_version_id,
|
|
50
|
+
template_version, participants: [...], created_at, expires_at,
|
|
51
51
|
has_callback
|
|
52
52
|
},
|
|
53
53
|
...
|
|
@@ -56,7 +56,7 @@ Output (stdout, JSON):
|
|
|
56
56
|
}`;
|
|
57
57
|
const STATUSES = ["open", "closed", "all"];
|
|
58
58
|
export async function runList(args) {
|
|
59
|
-
assertKnownFlags(args, KNOWN_FLAGS, KNOWN_BOOLS, "pane
|
|
59
|
+
assertKnownFlags(args, KNOWN_FLAGS, KNOWN_BOOLS, "pane surface list");
|
|
60
60
|
const opts = {};
|
|
61
61
|
const status = args.flags.get("status");
|
|
62
62
|
if (status !== undefined) {
|
|
@@ -76,9 +76,9 @@ export async function runList(args) {
|
|
|
76
76
|
const cursor = args.flags.get("cursor");
|
|
77
77
|
if (cursor !== undefined && cursor !== "")
|
|
78
78
|
opts.cursor = cursor;
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
opts.
|
|
79
|
+
const templateId = args.flags.get("template-id");
|
|
80
|
+
if (templateId !== undefined && templateId !== "") {
|
|
81
|
+
opts.template_id = templateId;
|
|
82
82
|
}
|
|
83
83
|
const client = makeClient(args);
|
|
84
84
|
try {
|