@xano/cli 1.0.4 → 1.0.5
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 +107 -4
- package/dist/base-command.d.ts +27 -0
- package/dist/base-command.js +124 -1
- package/dist/commands/auth/index.d.ts +45 -1
- package/dist/commands/auth/index.js +197 -29
- package/dist/commands/function/run/index.d.ts +40 -0
- package/dist/commands/function/run/index.js +244 -0
- package/dist/commands/knowledge/{pull → get}/index.d.ts +6 -2
- package/dist/commands/knowledge/get/index.js +126 -0
- package/dist/commands/knowledge/{push → list}/index.d.ts +6 -8
- package/dist/commands/knowledge/list/index.js +135 -0
- package/dist/commands/sandbox/pull/index.js +12 -2
- package/dist/commands/sandbox/push/index.d.ts +1 -1
- package/dist/commands/sandbox/push/index.js +19 -14
- package/dist/commands/sandbox/reset/index.js +12 -0
- package/dist/commands/static_host/build/create/index.d.ts +9 -1
- package/dist/commands/static_host/build/create/index.js +54 -4
- package/dist/commands/static_host/build/delete/index.d.ts +19 -0
- package/dist/commands/static_host/build/delete/index.js +114 -0
- package/dist/commands/static_host/build/get/index.d.ts +1 -1
- package/dist/commands/static_host/build/get/index.js +16 -10
- package/dist/commands/static_host/build/pull/index.d.ts +52 -0
- package/dist/commands/static_host/build/pull/index.js +300 -0
- package/dist/commands/static_host/build/push/index.d.ts +23 -0
- package/dist/commands/static_host/build/push/index.js +228 -0
- package/dist/commands/static_host/create/index.d.ts +17 -0
- package/dist/commands/static_host/create/index.js +86 -0
- package/dist/commands/static_host/deploy/index.d.ts +18 -0
- package/dist/commands/static_host/deploy/index.js +105 -0
- package/dist/commands/static_host/edit/index.d.ts +23 -0
- package/dist/commands/static_host/edit/index.js +151 -0
- package/dist/commands/static_host/get/index.d.ts +18 -0
- package/dist/commands/static_host/get/index.js +94 -0
- package/dist/commands/static_host/migrate/index.d.ts +44 -0
- package/dist/commands/static_host/migrate/index.js +205 -0
- package/dist/commands/tenant/snapshot/create/index.d.ts +17 -0
- package/dist/commands/tenant/snapshot/create/index.js +78 -0
- package/dist/commands/tenant/snapshot/delete/index.d.ts +19 -0
- package/dist/commands/tenant/snapshot/delete/index.js +102 -0
- package/dist/commands/tenant/snapshot/list/index.d.ts +16 -0
- package/dist/commands/tenant/snapshot/list/index.js +96 -0
- package/dist/commands/tenant/snapshot/swap/index.d.ts +19 -0
- package/dist/commands/tenant/snapshot/swap/index.js +103 -0
- package/dist/commands/tenant/unit_test/run/index.d.ts +1 -0
- package/dist/commands/tenant/unit_test/run/index.js +7 -0
- package/dist/commands/tenant/unit_test/run_all/index.js +7 -3
- package/dist/commands/unit_test/run/index.d.ts +1 -0
- package/dist/commands/unit_test/run/index.js +8 -0
- package/dist/commands/unit_test/run_all/index.js +7 -3
- package/dist/commands/workspace/pull/index.js +13 -2
- package/dist/commands/workspace/push/index.d.ts +1 -1
- package/dist/commands/workspace/push/index.js +15 -5
- package/dist/utils/function-input.d.ts +77 -0
- package/dist/utils/function-input.js +148 -0
- package/dist/utils/knowledge-sync.d.ts +84 -79
- package/dist/utils/knowledge-sync.js +376 -323
- package/dist/utils/multidoc-push.d.ts +30 -18
- package/dist/utils/multidoc-push.js +284 -148
- package/dist/utils/reference-checker.js +2 -2
- package/dist/utils/static-host-files.d.ts +21 -0
- package/dist/utils/static-host-files.js +41 -0
- package/oclif.manifest.json +4574 -3045
- package/package.json +7 -1
- package/dist/commands/knowledge/pull/index.js +0 -86
- package/dist/commands/knowledge/push/index.js +0 -126
|
@@ -1,108 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export declare const KNOWLEDGE_DIR = "knowledge";
|
|
2
|
+
export type KnowledgeType = 'agents.md' | 'doc' | 'skill';
|
|
3
|
+
/** A reference file attached to a skill (knowledge_file). */
|
|
4
|
+
export interface KnowledgeFile {
|
|
5
|
+
content: string;
|
|
6
|
+
/** Path relative to the skill's `references/` folder, POSIX-separated. */
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/** A workspace-scoped knowledge object as exchanged with the API. */
|
|
10
|
+
export interface KnowledgeObject {
|
|
11
|
+
content: string;
|
|
8
12
|
description?: string;
|
|
9
13
|
enabled?: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
files?: KnowledgeFile[];
|
|
15
|
+
guid?: string;
|
|
16
|
+
knowledge_type: KnowledgeType;
|
|
12
17
|
mode?: string;
|
|
13
18
|
name: string;
|
|
14
|
-
references?: string[];
|
|
15
19
|
scope?: string;
|
|
16
|
-
tag?: string[];
|
|
17
20
|
}
|
|
18
|
-
/** A
|
|
19
|
-
export interface
|
|
20
|
-
content: string;
|
|
21
|
+
/** A locally-collected object that also remembers its primary file on disk (for GUID writeback). */
|
|
22
|
+
export interface LocalKnowledgeObject extends KnowledgeObject {
|
|
21
23
|
filePath: string;
|
|
22
|
-
name: string;
|
|
23
24
|
}
|
|
24
|
-
export interface
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
export interface KnowledgePushBody {
|
|
26
|
+
branch?: string;
|
|
27
|
+
delete?: boolean;
|
|
28
|
+
dry_run?: boolean;
|
|
29
|
+
force?: boolean;
|
|
30
|
+
items: KnowledgeObject[];
|
|
31
|
+
}
|
|
32
|
+
export interface KnowledgePushResult {
|
|
33
|
+
deleted?: number;
|
|
34
|
+
guid_map?: Array<{
|
|
35
|
+
guid: string;
|
|
36
|
+
name: string;
|
|
34
37
|
}>;
|
|
38
|
+
imported?: number;
|
|
39
|
+
operations?: KnowledgeDryRunOperation[];
|
|
40
|
+
summary?: Record<string, KnowledgeDryRunSummary>;
|
|
35
41
|
}
|
|
36
|
-
export interface
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
force: boolean;
|
|
41
|
-
include?: string[];
|
|
42
|
-
sync: boolean;
|
|
43
|
-
verbose: boolean;
|
|
42
|
+
export interface KnowledgeDryRunOperation {
|
|
43
|
+
action: string;
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
44
46
|
}
|
|
45
|
-
export interface
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
verboseFetch: (url: string, options: RequestInit, verbose: boolean, authToken?: string) => Promise<Response>;
|
|
51
|
-
workspaceId: string;
|
|
47
|
+
export interface KnowledgeDryRunSummary {
|
|
48
|
+
created: number;
|
|
49
|
+
deleted: number;
|
|
50
|
+
unchanged: number;
|
|
51
|
+
updated: number;
|
|
52
52
|
}
|
|
53
|
-
export interface
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
inputDir: string;
|
|
53
|
+
export interface KnowledgeDryRunResult {
|
|
54
|
+
operations: KnowledgeDryRunOperation[];
|
|
55
|
+
summary: Record<string, KnowledgeDryRunSummary>;
|
|
57
56
|
}
|
|
58
|
-
|
|
57
|
+
type VerboseFetch = (url: string, options: RequestInit, verbose: boolean, authToken?: string) => Promise<Response>;
|
|
59
58
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Returns null when valid, otherwise a human-readable reason.
|
|
59
|
+
* Build a primary `.md` file body: YAML frontmatter (built from the object's
|
|
60
|
+
* structured fields) followed by the markdown content.
|
|
63
61
|
*/
|
|
64
|
-
export declare function
|
|
62
|
+
export declare function buildPrimaryContent(obj: KnowledgeObject): string;
|
|
65
63
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* Returns null when the name is unsafe.
|
|
64
|
+
* Split a primary `.md` file into its frontmatter fields and markdown body.
|
|
65
|
+
* Returns `{meta: {}, body: <raw>}` when there is no leading `---` block.
|
|
69
66
|
*/
|
|
70
|
-
export declare function
|
|
67
|
+
export declare function parsePrimaryContent(raw: string): {
|
|
68
|
+
body: string;
|
|
69
|
+
meta: Record<string, unknown>;
|
|
70
|
+
};
|
|
71
|
+
/** Read just `guid`/`name` from frontmatter (used by GUID matching). */
|
|
72
|
+
export declare function parseFrontmatter(content: string): {
|
|
73
|
+
guid?: string;
|
|
74
|
+
name?: string;
|
|
75
|
+
};
|
|
71
76
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
77
|
+
* Write knowledge objects under `<outputDir>/knowledge/`, building frontmatter
|
|
78
|
+
* and laying out skill reference files under `<skill>/references/`.
|
|
79
|
+
* Returns the number of files written (primaries + references).
|
|
74
80
|
*/
|
|
75
|
-
export declare function
|
|
81
|
+
export declare function writeKnowledge(objects: KnowledgeObject[], outputDir: string): number;
|
|
76
82
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
83
|
+
* Walk `<inputDir>/knowledge/`, reconstructing structured knowledge objects from
|
|
84
|
+
* primary `.md` files (frontmatter → fields, body → content) and attaching each
|
|
85
|
+
* skill's `references/` files. Include/exclude globs are matched against
|
|
86
|
+
* `knowledge/<path>` (relative to inputDir), consistent with multidoc filtering.
|
|
87
|
+
* Returns `[]` when the directory is absent.
|
|
79
88
|
*/
|
|
80
|
-
export declare function
|
|
89
|
+
export declare function collectKnowledgeObjects(inputDir: string, include?: string[], exclude?: string[]): LocalKnowledgeObject[];
|
|
90
|
+
/** Strip the local-only `filePath` before sending objects to the API. */
|
|
91
|
+
export declare function toPushItems(objects: LocalKnowledgeObject[]): KnowledgeObject[];
|
|
81
92
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
93
|
+
* GET workspace knowledge objects (with content). Returns `[]` on 404 (instance
|
|
94
|
+
* without the feature) or any network error, so pull degrades gracefully.
|
|
84
95
|
*/
|
|
85
|
-
export declare function
|
|
96
|
+
export declare function fetchKnowledge(baseUrl: string, branch: string, accessToken: string, verboseFetch: VerboseFetch, verbose: boolean): Promise<KnowledgeObject[]>;
|
|
86
97
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
98
|
+
* POST knowledge objects to the workspace. Throws on non-2xx. When `body.dry_run`
|
|
99
|
+
* is set the result may carry `operations`/`summary` instead of `imported`.
|
|
89
100
|
*/
|
|
90
|
-
export declare function
|
|
91
|
-
export declare function renderKnowledgePreview(plan: KnowledgePlan, opts: {
|
|
92
|
-
cliVersion: string;
|
|
93
|
-
instanceOrigin: string;
|
|
94
|
-
label: string;
|
|
95
|
-
partial: boolean;
|
|
96
|
-
willDelete: boolean;
|
|
97
|
-
}, log: (msg: string) => void): void;
|
|
101
|
+
export declare function pushKnowledge(url: string, accessToken: string, verboseFetch: VerboseFetch, verbose: boolean, body: KnowledgePushBody): Promise<KnowledgePushResult>;
|
|
98
102
|
/**
|
|
99
|
-
*
|
|
103
|
+
* Compute a dry-run-style preview by diffing local objects against server
|
|
104
|
+
* objects (match by `guid`, then `name`). Used when the server doesn't honor
|
|
105
|
+
* the `dry_run` flag.
|
|
100
106
|
*/
|
|
101
|
-
export declare function
|
|
107
|
+
export declare function knowledgePreview(local: KnowledgeObject[], server: KnowledgeObject[], willDelete: boolean): KnowledgeDryRunResult;
|
|
102
108
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* Mirrors the UX of `workspace push` (partial by default, --sync for full,
|
|
106
|
-
* --delete to remove remote-only items, --dry-run / --force).
|
|
109
|
+
* Set or update `guid:` in a primary `.md` file's YAML frontmatter.
|
|
110
|
+
* Returns true if the file was modified.
|
|
107
111
|
*/
|
|
108
|
-
export declare function
|
|
112
|
+
export declare function syncGuidToFrontmatter(filePath: string, guid: string): boolean;
|
|
113
|
+
export {};
|