@trillioncore/cli 1.0.0-next.1 → 1.0.0-next.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 +18 -0
- package/dist/index.js +21 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,24 @@ CLI and MCP share four data-tool names: `index`, `search`, `get`, and `sql`. CLI
|
|
|
37
37
|
|
|
38
38
|
Use `tc <command> --help` for supported flags. PostgreSQL SQL is a focused v1 command, not general v0 compatibility. There is no v0 `agent start`, chat, or write-command compatibility layer. CLI credentials cannot be used as MCP credentials or browser administration sessions. Authorize Codex or Claude Code separately through hosted MCP.
|
|
39
39
|
|
|
40
|
+
## Resource discovery
|
|
41
|
+
|
|
42
|
+
Run `tc index` to obtain an authorized account path, then:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
tc index 'org/<organization-id>/account/<account-id>' --resources --json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For interactive inspection, omit `--json` to print schema columns, operation availability, warnings and the next-page cursor as text. Use `tc index --help` to discover resource and pagination options.
|
|
49
|
+
|
|
50
|
+
MCP uses the same `index` tool with that `path` and `resources: true`. Resource mode returns an additive `catalog`, empty `entries`, and the normal `nextCursor` pagination field. Repeat the same resource request with `--cursor` while a cursor is returned. Changed catalog metadata invalidates old resource cursors; restart discovery. Normal index responses and record refs are unchanged. Resource mode avoids enumerating every stored record.
|
|
51
|
+
|
|
52
|
+
The catalog describes stored content kinds or approved **active synchronized** PostgreSQL relations, supported operations, schema metadata and known sync timestamps. Resource keys identify catalog entries; they are **not** refs accepted by `get`. Obtain a record ref through normal index/search before reading. Search is lexical across authorized connections, not scoped to the resource just inspected; optional source-type filters do not identify a unique connection.
|
|
53
|
+
|
|
54
|
+
Respect `operations[].available` and `warnings`. Production synced SQL is currently not wired, so its schemas can be discovered but SQL is explicitly unavailable with `synced_sql_not_configured`. Live PostgreSQL resources are outside this catalog's coverage. No semantic search or actions are advertised. Native connectors retain search/get capabilities when empty; `recordKinds` lists only observed kinds (capped at 100 with an explicit warning). Synced manifests use existing limits of 25 tables/1,000 columns. A successful sync timestamp does not establish complete history or current provider state. Business definitions, currency and attribution are not inferred.
|
|
55
|
+
|
|
56
|
+
All discovery uses the same organization, live token scope, connection permission and enabled-state checks as existing agent reads. Multiple internal adapters may eventually fulfill a connection's capabilities; this catalog does not introduce a separate user-visible integration for each adapter.
|
|
57
|
+
|
|
40
58
|
## Sessions and troubleshooting
|
|
41
59
|
|
|
42
60
|
Sessions refresh automatically. File-based credentials live in `~/.trillioncore/cli-v1/session.json`, with private directory/file permissions (0700/0600 on POSIX), atomic replacement and cross-process refresh locking. Never share or print this file. Keep the OS account and its private home directory secure; Windows ACL behavior has not yet been independently validated.
|
package/dist/index.js
CHANGED
|
@@ -3757,6 +3757,7 @@ async function index(input) {
|
|
|
3757
3757
|
const limit = parsedPositiveInteger(input.limit, "--limit", 200);
|
|
3758
3758
|
const parameters = new URLSearchParams();
|
|
3759
3759
|
if (input.path) parameters.set("path", input.path);
|
|
3760
|
+
if (input.resources) parameters.set("resources", "true");
|
|
3760
3761
|
if (depth) parameters.set("depth", String(depth));
|
|
3761
3762
|
if (limit) parameters.set("limit", String(limit));
|
|
3762
3763
|
if (input.cursor) parameters.set("cursor", input.cursor);
|
|
@@ -3847,6 +3848,25 @@ function isAgentError(value) {
|
|
|
3847
3848
|
return "error" in value;
|
|
3848
3849
|
}
|
|
3849
3850
|
function renderIndex(result) {
|
|
3851
|
+
if (result.catalog) {
|
|
3852
|
+
const catalog = result.catalog;
|
|
3853
|
+
return [
|
|
3854
|
+
`Resources: ${catalog.connectionRef}`,
|
|
3855
|
+
`Last successful sync: ${catalog.freshness.lastSuccessfulSyncAt ?? "unknown"}; source completeness: ${catalog.freshness.sourceCompleteness}`,
|
|
3856
|
+
...catalog.resources.flatMap((resource) => [
|
|
3857
|
+
`${resource.name} (${resource.kind})`,
|
|
3858
|
+
...resource.recordKinds ? [` Observed record kinds: ${resource.recordKinds.join(", ") || "none"}`] : [],
|
|
3859
|
+
...resource.operations.map((operation) => ` ${operation.tool}${operation.target ? ` --target ${operation.target}` : ""}: ${operation.available ? "available" : `unavailable (${operation.reason})`}; scope: ${operation.scope}`),
|
|
3860
|
+
...resource.relation ? [
|
|
3861
|
+
` SQL relation: ${resource.relation.name}; connection: ${catalog.integrationAccountId}`,
|
|
3862
|
+
...resource.relation.columns.map((column) => ` ${column.name}: ${column.type}${column.nullable ? " (nullable)" : ""}`)
|
|
3863
|
+
] : []
|
|
3864
|
+
]),
|
|
3865
|
+
...catalog.warnings.map((warning) => `Warning: ${warning}`),
|
|
3866
|
+
...result.nextCursor ? [`More: --cursor ${result.nextCursor}`] : [],
|
|
3867
|
+
"Resource keys are not record refs. Use search or normal index to find a record for get."
|
|
3868
|
+
].join("\n");
|
|
3869
|
+
}
|
|
3850
3870
|
if (!result.entries.length) return "No authorized records found.";
|
|
3851
3871
|
const lines = [`Index: ${result.path}`];
|
|
3852
3872
|
for (const entry of result.entries) {
|
|
@@ -4051,7 +4071,7 @@ ${result.issuer}`
|
|
|
4051
4071
|
writeError(error, Boolean(options.json));
|
|
4052
4072
|
}
|
|
4053
4073
|
});
|
|
4054
|
-
program2.command("index [path]").description("Browse authorized integration records").option("--organization <id>", "Assert configured organization").option("--depth <depth>", "Inventory depth (default 3)").option("--limit <limit>", "Maximum entries (1-200)").option("--cursor <cursor>", "Opaque pagination cursor").option("-j, --json", "Output shared DTO JSON").action(async (path, options) => {
|
|
4074
|
+
program2.command("index [path]").description("Browse authorized integration records").option("--organization <id>", "Assert configured organization").option("--depth <depth>", "Inventory depth (default 3)").option("--resources", "Inspect resources at an account path instead of listing records").option("--limit <limit>", "Maximum entries or resources (1-200)").option("--cursor <cursor>", "Opaque pagination cursor").option("-j, --json", "Output shared DTO JSON").action(async (path, options) => {
|
|
4055
4075
|
try {
|
|
4056
4076
|
const result = await commands.index({ ...options, path });
|
|
4057
4077
|
writeResult(result, Boolean(options.json), renderIndex(result));
|