@camstack/develop 0.1.53 → 0.1.54
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/CHANGELOG.md +7 -0
- package/dist/hub/hub-download.d.ts +14 -0
- package/dist/hub/hub-download.d.ts.map +1 -0
- package/dist/hub/hub-download.js +74 -0
- package/dist/hub/logs-export.d.ts +47 -0
- package/dist/hub/logs-export.d.ts.map +1 -0
- package/dist/hub/logs-export.js +121 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +1 -1
- package/skills/camstack-capability.md +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.54] - 2026-11-16
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Shared hub downloader and logs-export helpers for the MCP servers
|
|
15
|
+
- The capability skill asks you to audit the device card, the device row and the viewer accessory row a device capability change reaches, and records it in the done-gate
|
|
16
|
+
|
|
10
17
|
## [0.1.53] - 2026-11-12
|
|
11
18
|
|
|
12
19
|
### Changed
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type HubTlsConfig } from './hub-tls.js';
|
|
2
|
+
/** Streams one hub data-plane path to a local file. */
|
|
3
|
+
export type HubDownloader = (urlPath: string, destFile: string, maxBytes: number) => Promise<{
|
|
4
|
+
readonly bytes: number;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const DOWNLOAD_TIMEOUT_MS: number;
|
|
7
|
+
export interface DownloaderOptions {
|
|
8
|
+
readonly baseUrl: string;
|
|
9
|
+
readonly token: string;
|
|
10
|
+
readonly tls: HubTlsConfig;
|
|
11
|
+
readonly timeoutMs?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function createHubDownloader(options: DownloaderOptions): HubDownloader;
|
|
14
|
+
//# sourceMappingURL=hub-download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub-download.d.ts","sourceRoot":"","sources":["../../src/hub/hub-download.ts"],"names":[],"mappings":"AAYA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhE,uDAAuD;AACvD,MAAM,MAAM,aAAa,GAAG,CAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAExC,eAAO,MAAM,mBAAmB,EAAE,MAAoB,CAAA;AAEtD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa,CA2D7E"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Streams one hub data-plane path into a local file (the retrain export tar).
|
|
3
|
+
*
|
|
4
|
+
* GET only, bearer from the credential chain, TLS from the shared trust
|
|
5
|
+
* config. The bytes go to `<dest>.part` and are renamed on success, so a cut
|
|
6
|
+
* connection never leaves a plausible-looking truncated archive. A size cap
|
|
7
|
+
* and a timeout bound it; the export is generated on the fly, so there is no
|
|
8
|
+
* resume (the handler sends no `Accept-Ranges` on purpose).
|
|
9
|
+
*/
|
|
10
|
+
import * as fs from 'node:fs';
|
|
11
|
+
import * as http from 'node:http';
|
|
12
|
+
import * as https from 'node:https';
|
|
13
|
+
import { createHubAgent } from './hub-tls.js';
|
|
14
|
+
export const DOWNLOAD_TIMEOUT_MS = 30 * 60_000;
|
|
15
|
+
export function createHubDownloader(options) {
|
|
16
|
+
return (urlPath, destFile, maxBytes) => new Promise((resolve, reject) => {
|
|
17
|
+
const parsed = new URL(urlPath, options.baseUrl);
|
|
18
|
+
const isHttps = parsed.protocol === 'https:';
|
|
19
|
+
const part = `${destFile}.part`;
|
|
20
|
+
const out = fs.createWriteStream(part, { mode: 0o600 });
|
|
21
|
+
let bytes = 0;
|
|
22
|
+
const fail = (err) => {
|
|
23
|
+
out.destroy();
|
|
24
|
+
fs.rmSync(part, { force: true });
|
|
25
|
+
reject(err);
|
|
26
|
+
};
|
|
27
|
+
const requestOptions = {
|
|
28
|
+
protocol: parsed.protocol,
|
|
29
|
+
hostname: parsed.hostname,
|
|
30
|
+
port: parsed.port || (isHttps ? 443 : 80),
|
|
31
|
+
path: `${parsed.pathname}${parsed.search}`,
|
|
32
|
+
method: 'GET',
|
|
33
|
+
headers: { Authorization: `Bearer ${options.token}` },
|
|
34
|
+
timeout: options.timeoutMs ?? DOWNLOAD_TIMEOUT_MS,
|
|
35
|
+
...(isHttps ? { agent: createHubAgent(options.tls) } : {}),
|
|
36
|
+
};
|
|
37
|
+
const onResponse = (res) => {
|
|
38
|
+
if (res.statusCode !== 200) {
|
|
39
|
+
res.resume();
|
|
40
|
+
fail(new Error(`hub answered HTTP ${res.statusCode ?? 0} for the export download`));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
res.on('data', (chunk) => {
|
|
44
|
+
bytes += chunk.length;
|
|
45
|
+
if (bytes > maxBytes) {
|
|
46
|
+
res.destroy(new Error(`export larger than ${maxBytes} bytes — narrow the filter`));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (!out.write(chunk)) {
|
|
50
|
+
res.pause();
|
|
51
|
+
out.once('drain', () => res.resume());
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
res.on('error', fail);
|
|
55
|
+
res.on('end', () => {
|
|
56
|
+
out.end(() => {
|
|
57
|
+
try {
|
|
58
|
+
fs.renameSync(part, destFile);
|
|
59
|
+
resolve({ bytes });
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
fail(err instanceof Error ? err : new Error(String(err)));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const request = isHttps
|
|
68
|
+
? https.request(requestOptions, onResponse)
|
|
69
|
+
: http.request(requestOptions, onResponse);
|
|
70
|
+
request.on('error', fail);
|
|
71
|
+
request.on('timeout', () => request.destroy(new Error('export download timed out')));
|
|
72
|
+
request.end();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { HubDownloader } from './hub-download.js';
|
|
3
|
+
export declare const LOGS_EXPORT_URL_PATH = "/api/logs/export";
|
|
4
|
+
export declare const DEFAULT_LOGS_EXPORT_MAX_MB = 512;
|
|
5
|
+
export declare const HARD_LOGS_EXPORT_MAX_MB = 4096;
|
|
6
|
+
export declare const LogsExportArgsSchema: z.ZodObject<{
|
|
7
|
+
components: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
deviceIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
9
|
+
sinceMinutes: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
since: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
until: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
error: "error";
|
|
14
|
+
warn: "warn";
|
|
15
|
+
info: "info";
|
|
16
|
+
debug: "debug";
|
|
17
|
+
}>>;
|
|
18
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
19
|
+
name: z.ZodOptional<z.ZodString>;
|
|
20
|
+
maxMegabytes: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type LogsExportArgs = z.infer<typeof LogsExportArgsSchema>;
|
|
23
|
+
/** The query string the hub route reads (`core/logging/log-export.ts`). */
|
|
24
|
+
export declare function logsExportUrl(args: LogsExportArgs, now: number): string;
|
|
25
|
+
export interface LogsExportSummary {
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly bytes: number;
|
|
28
|
+
readonly lines: number;
|
|
29
|
+
readonly newest: string | null;
|
|
30
|
+
readonly oldest: string | null;
|
|
31
|
+
readonly levels: Record<string, number>;
|
|
32
|
+
/** The busiest devices, `deviceId → lines`, at most 20. */
|
|
33
|
+
readonly devices: Record<string, number>;
|
|
34
|
+
/** The busiest components, `addonId → lines`, at most 20. */
|
|
35
|
+
readonly components: Record<string, number>;
|
|
36
|
+
/** The hub stopped at its line cap; narrow the filter or the range. */
|
|
37
|
+
readonly truncated: boolean;
|
|
38
|
+
readonly next: string;
|
|
39
|
+
}
|
|
40
|
+
/** Read the downloaded NDJSON once, line by line, into a bounded summary. */
|
|
41
|
+
export declare function summarizeLogsExport(file: string): Promise<Omit<LogsExportSummary, 'path' | 'bytes' | 'next'>>;
|
|
42
|
+
export interface LogsExportDownload extends Omit<LogsExportSummary, 'path' | 'next'> {
|
|
43
|
+
readonly bytes: number;
|
|
44
|
+
}
|
|
45
|
+
/** Download the export to `dest` and summarise it. The caller picks the file and words `path`/`next`. */
|
|
46
|
+
export declare function downloadLogsExport(download: HubDownloader, dest: string, args: LogsExportArgs, at: Date): Promise<LogsExportDownload>;
|
|
47
|
+
//# sourceMappingURL=logs-export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs-export.d.ts","sourceRoot":"","sources":["../../src/hub/logs-export.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD,eAAO,MAAM,oBAAoB,qBAAqB,CAAA;AACtD,eAAO,MAAM,0BAA0B,MAAM,CAAA;AAC7C,eAAO,M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AQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,IAAI,GACP,OAAO,CAAC,kBAAkB,CAAC,CAI7B"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Logs page's export (#570): URL builder, args and the NDJSON summary, shared by
|
|
3
|
+
* the operator MCP (`hub_logs_export`) and the public `camstack mcp` (`ops_logs_export`).
|
|
4
|
+
*
|
|
5
|
+
* It downloads the hub's `GET /api/logs/export` — the same route, the same
|
|
6
|
+
* filters and the same default (everything over the last six hours, applied
|
|
7
|
+
* by the hub when no `since` is sent) — into a file, then answers with a
|
|
8
|
+
* bounded summary of the file: how many lines, the time span, the devices and
|
|
9
|
+
* components seen, and whether the hub capped it. Read-only on the cluster;
|
|
10
|
+
* admin credential required (the route is admin-only).
|
|
11
|
+
*/
|
|
12
|
+
import * as fs from 'node:fs';
|
|
13
|
+
import * as readline from 'node:readline';
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
export const LOGS_EXPORT_URL_PATH = '/api/logs/export';
|
|
16
|
+
export const DEFAULT_LOGS_EXPORT_MAX_MB = 512;
|
|
17
|
+
export const HARD_LOGS_EXPORT_MAX_MB = 4096;
|
|
18
|
+
/** How many distinct devices / components the summary names. */
|
|
19
|
+
const SUMMARY_TOP = 20;
|
|
20
|
+
export const LogsExportArgsSchema = z.object({
|
|
21
|
+
/** addonIds (OR). Omit for every component. */
|
|
22
|
+
components: z.array(z.string().min(1).max(200)).max(100).optional(),
|
|
23
|
+
/** Numeric device ids (OR). Omit for every device. */
|
|
24
|
+
deviceIds: z.array(z.number().int().nonnegative()).max(200).optional(),
|
|
25
|
+
/** Minutes back from `until` (or now). Omit for the hub's default: six hours. */
|
|
26
|
+
sinceMinutes: z.number().positive().max(43_200).optional(),
|
|
27
|
+
/** Epoch ms; overrides sinceMinutes. */
|
|
28
|
+
since: z.number().int().nonnegative().optional(),
|
|
29
|
+
/** Epoch ms; default now. */
|
|
30
|
+
until: z.number().int().nonnegative().optional(),
|
|
31
|
+
level: z.enum(['debug', 'info', 'warn', 'error']).optional(),
|
|
32
|
+
/** A read-capable log-destination addonId, or `ring`. Default the hub's files. */
|
|
33
|
+
provider: z.string().min(1).max(200).optional(),
|
|
34
|
+
/** File name stem under scratchpad/logs-export/; defaults to a timestamp. */
|
|
35
|
+
name: z
|
|
36
|
+
.string()
|
|
37
|
+
.regex(/^[A-Za-z0-9._-]{1,80}$/)
|
|
38
|
+
.optional(),
|
|
39
|
+
maxMegabytes: z.number().int().positive().max(HARD_LOGS_EXPORT_MAX_MB).optional(),
|
|
40
|
+
});
|
|
41
|
+
/** The query string the hub route reads (`core/logging/log-export.ts`). */
|
|
42
|
+
export function logsExportUrl(args, now) {
|
|
43
|
+
const params = new URLSearchParams();
|
|
44
|
+
if (args.components && args.components.length > 0)
|
|
45
|
+
params.set('components', args.components.join(','));
|
|
46
|
+
if (args.deviceIds && args.deviceIds.length > 0)
|
|
47
|
+
params.set('deviceIds', args.deviceIds.join(','));
|
|
48
|
+
const until = args.until;
|
|
49
|
+
const since = args.since ??
|
|
50
|
+
(args.sinceMinutes !== undefined ? (until ?? now) - args.sinceMinutes * 60_000 : undefined);
|
|
51
|
+
if (since !== undefined)
|
|
52
|
+
params.set('since', String(Math.floor(since)));
|
|
53
|
+
if (until !== undefined)
|
|
54
|
+
params.set('until', String(until));
|
|
55
|
+
if (args.level)
|
|
56
|
+
params.set('level', args.level);
|
|
57
|
+
if (args.provider)
|
|
58
|
+
params.set('source', args.provider);
|
|
59
|
+
const query = params.toString();
|
|
60
|
+
return query.length > 0 ? `${LOGS_EXPORT_URL_PATH}?${query}` : LOGS_EXPORT_URL_PATH;
|
|
61
|
+
}
|
|
62
|
+
const ExportedLineSchema = z.looseObject({
|
|
63
|
+
timestamp: z.string().optional(),
|
|
64
|
+
level: z.string().optional(),
|
|
65
|
+
tags: z.record(z.string(), z.string()).optional(),
|
|
66
|
+
truncated: z.boolean().optional(),
|
|
67
|
+
});
|
|
68
|
+
function top(counts) {
|
|
69
|
+
return Object.fromEntries([...counts.entries()].toSorted((a, b) => b[1] - a[1]).slice(0, SUMMARY_TOP));
|
|
70
|
+
}
|
|
71
|
+
function bump(counts, key) {
|
|
72
|
+
if (key === undefined)
|
|
73
|
+
return;
|
|
74
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
75
|
+
}
|
|
76
|
+
/** Read the downloaded NDJSON once, line by line, into a bounded summary. */
|
|
77
|
+
export async function summarizeLogsExport(file) {
|
|
78
|
+
const levels = new Map();
|
|
79
|
+
const devices = new Map();
|
|
80
|
+
const components = new Map();
|
|
81
|
+
let lines = 0;
|
|
82
|
+
let newest = null;
|
|
83
|
+
let oldest = null;
|
|
84
|
+
let truncated = false;
|
|
85
|
+
const reader = readline.createInterface({ input: fs.createReadStream(file), crlfDelay: Infinity });
|
|
86
|
+
for await (const text of reader) {
|
|
87
|
+
if (text.trim().length === 0)
|
|
88
|
+
continue;
|
|
89
|
+
const parsed = ExportedLineSchema.safeParse(JSON.parse(text));
|
|
90
|
+
if (!parsed.success)
|
|
91
|
+
continue;
|
|
92
|
+
if (parsed.data.truncated === true) {
|
|
93
|
+
truncated = true;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
lines += 1;
|
|
97
|
+
const ts = parsed.data.timestamp ?? null;
|
|
98
|
+
if (ts !== null) {
|
|
99
|
+
newest ??= ts;
|
|
100
|
+
oldest = ts;
|
|
101
|
+
}
|
|
102
|
+
bump(levels, parsed.data.level);
|
|
103
|
+
bump(devices, parsed.data.tags?.['deviceId']);
|
|
104
|
+
bump(components, parsed.data.tags?.['addonId']);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
lines,
|
|
108
|
+
newest,
|
|
109
|
+
oldest,
|
|
110
|
+
levels: Object.fromEntries(levels),
|
|
111
|
+
devices: top(devices),
|
|
112
|
+
components: top(components),
|
|
113
|
+
truncated,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/** Download the export to `dest` and summarise it. The caller picks the file and words `path`/`next`. */
|
|
117
|
+
export async function downloadLogsExport(download, dest, args, at) {
|
|
118
|
+
const maxBytes = (args.maxMegabytes ?? DEFAULT_LOGS_EXPORT_MAX_MB) * 1024 * 1024;
|
|
119
|
+
const { bytes } = await download(logsExportUrl(args, at.getTime()), dest, maxBytes);
|
|
120
|
+
return { bytes, ...(await summarizeLogsExport(dest)) };
|
|
121
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,4 +36,8 @@ export { gateQuery, isSecretBearing, type GateDecision, } from './mcp/query-gate
|
|
|
36
36
|
export { CONFIRM_TTL_MS, MAX_OUTSTANDING_TOKENS, MUTATIONS_DISABLED_REASON, MutationGate, canonicalJson, digestArgs, runGated, stderrAudit, type AuditPhase, type AuditRecord, type AuditSink, type ConfirmDecision, type DryRunOutcome, type GatedResult, type GatedToolSpec, type IssuedToken, type MutationGateOptions, } from './mcp/mutation-gate.js';
|
|
37
37
|
export * from './mcp/ops/wire.js';
|
|
38
38
|
export * from './mcp/ops/track-findings.js';
|
|
39
|
+
export { createHubDownloader, DOWNLOAD_TIMEOUT_MS } from './hub/hub-download.js';
|
|
40
|
+
export type { DownloaderOptions, HubDownloader } from './hub/hub-download.js';
|
|
41
|
+
export { DEFAULT_LOGS_EXPORT_MAX_MB, downloadLogsExport, HARD_LOGS_EXPORT_MAX_MB, LOGS_EXPORT_URL_PATH, LogsExportArgsSchema, logsExportUrl, summarizeLogsExport, } from './hub/logs-export.js';
|
|
42
|
+
export type { LogsExportArgs, LogsExportDownload, LogsExportSummary } from './hub/logs-export.js';
|
|
39
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,YAAY,EACV,kBAAkB,EAClB,kBAAkB,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e,CAAA;AAC/C,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,cAAc,GACf,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,UAAU,EACV,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,SAAS,EACT,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,WAAW,EACX,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAA;AAG/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,6BAA6B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;A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EACb,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,SAAS,EACT,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,WAAW,EACX,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAA;AAG/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChF,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,GACpB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -36,3 +36,5 @@ export { CONFIRM_TTL_MS, MAX_OUTSTANDING_TOKENS, MUTATIONS_DISABLED_REASON, Muta
|
|
|
36
36
|
// (ops toolset) and the private operator MCP.
|
|
37
37
|
export * from './mcp/ops/wire.js';
|
|
38
38
|
export * from './mcp/ops/track-findings.js';
|
|
39
|
+
export { createHubDownloader, DOWNLOAD_TIMEOUT_MS } from './hub/hub-download.js';
|
|
40
|
+
export { DEFAULT_LOGS_EXPORT_MAX_MB, downloadLogsExport, HARD_LOGS_EXPORT_MAX_MB, LOGS_EXPORT_URL_PATH, LogsExportArgsSchema, logsExportUrl, summarizeLogsExport, } from './hub/logs-export.js';
|
package/package.json
CHANGED
|
@@ -163,6 +163,25 @@ arrives `undefined` on the addon path. Prefer top-level defaults.
|
|
|
163
163
|
`deviceConfig` (generic cap) or `exposesDeviceSettings` with the three
|
|
164
164
|
injected methods (owned cap) — never a parallel tab system. Decision rule and
|
|
165
165
|
traps: the `camstack-addon` skill, "A UI surface on a DEVICE page".
|
|
166
|
+
- **A device cap changes what the device LOOKS like — audit every surface it
|
|
167
|
+
reaches, in the same piece of work.** A new or changed `deviceNative` /
|
|
168
|
+
device cap (a method, a state field, a new mode) is not done until each
|
|
169
|
+
surface that draws that device answers it or is consciously left as is:
|
|
170
|
+
- **device details** — the device card (`ui-library` `composites/device-card`:
|
|
171
|
+
`connected/cap-card-kinds.ts` maps a device type or role to a card kind,
|
|
172
|
+
`connected/Connected<Kind>Card.tsx` reads the slice, `scenes/<kind>/`
|
|
173
|
+
draws it; `device-controls/panel-controls.tsx` picks the panel) and the
|
|
174
|
+
device page's derived sections (`deviceConfig` / `exposesDeviceSettings`);
|
|
175
|
+
- **device rows** — the inline row in device lists (`device-controls`
|
|
176
|
+
`control-registry.tsx` / `*-inline.tsx`, `device-list/group.ts`) and the
|
|
177
|
+
viewer's accessory rows and panel controls (`camstack/src/accessories/`,
|
|
178
|
+
`camstack/src/components/camera/accessory-controls/`);
|
|
179
|
+
- shared cards render in the viewer too, so a card change is a viewer change.
|
|
180
|
+
List the surfaces in the plan with "changed" / "unchanged: why". A new state
|
|
181
|
+
field no surface reads (a countdown, a mode, `activeUntil`) is a feature the
|
|
182
|
+
operator cannot see; a field a card draws but the cap no longer sends is a
|
|
183
|
+
card that lies. Viewer layout is co-designed with the operator before it is
|
|
184
|
+
built (`camstack-ui-viewer`); the card/row are UI work (`camstack-ui`).
|
|
166
185
|
- **"Absent" only from an answered query** (D315): ask
|
|
167
186
|
`capabilities.getCapability` / `useCapabilityPresence`, never infer absence
|
|
168
187
|
from `(data ?? [])`, and never throw the literal "provider not available"
|
|
@@ -212,6 +231,7 @@ hand-edits: index.ts re-export + AnyCapability union — yes
|
|
|
212
231
|
codegen: npm run codegen — clean; method tiers / export coverage — <accepted diff | unchanged>
|
|
213
232
|
manifest: declared in <package>/package.json (+ agent main.ts array: <yes|n/a>)
|
|
214
233
|
spec: <spec file> — <result>
|
|
234
|
+
surfaces: device card <changed|unchanged: why>; device row <changed|unchanged: why>; viewer accessory row/panel <changed|unchanged: why>
|
|
215
235
|
shipped: <"not shipped" | published system+server X.Y.Z, applied on <nodes>, addon deployed>
|
|
216
236
|
verified: <the call and its answer, or "not deployed">
|
|
217
237
|
docs: camstack-docs gate — <files | none needed: reason>
|