gitsheets-axi 0.0.1
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/LICENSE +201 -0
- package/README.md +116 -0
- package/dist/bin/gitsheets-axi.d.ts +3 -0
- package/dist/bin/gitsheets-axi.d.ts.map +1 -0
- package/dist/bin/gitsheets-axi.js +4 -0
- package/dist/bin/gitsheets-axi.js.map +1 -0
- package/dist/src/cli.d.ts +3 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +105 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/commands/attachment.d.ts +4 -0
- package/dist/src/commands/attachment.d.ts.map +1 -0
- package/dist/src/commands/attachment.js +356 -0
- package/dist/src/commands/attachment.js.map +1 -0
- package/dist/src/commands/check.d.ts +4 -0
- package/dist/src/commands/check.d.ts.map +1 -0
- package/dist/src/commands/check.js +136 -0
- package/dist/src/commands/check.js.map +1 -0
- package/dist/src/commands/delete.d.ts +4 -0
- package/dist/src/commands/delete.d.ts.map +1 -0
- package/dist/src/commands/delete.js +132 -0
- package/dist/src/commands/delete.js.map +1 -0
- package/dist/src/commands/diff.d.ts +4 -0
- package/dist/src/commands/diff.d.ts.map +1 -0
- package/dist/src/commands/diff.js +139 -0
- package/dist/src/commands/diff.js.map +1 -0
- package/dist/src/commands/home.d.ts +3 -0
- package/dist/src/commands/home.d.ts.map +1 -0
- package/dist/src/commands/home.js +71 -0
- package/dist/src/commands/home.js.map +1 -0
- package/dist/src/commands/infer.d.ts +4 -0
- package/dist/src/commands/infer.d.ts.map +1 -0
- package/dist/src/commands/infer.js +214 -0
- package/dist/src/commands/infer.js.map +1 -0
- package/dist/src/commands/init.d.ts +4 -0
- package/dist/src/commands/init.d.ts.map +1 -0
- package/dist/src/commands/init.js +172 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/migrate-config.d.ts +4 -0
- package/dist/src/commands/migrate-config.d.ts.map +1 -0
- package/dist/src/commands/migrate-config.js +161 -0
- package/dist/src/commands/migrate-config.js.map +1 -0
- package/dist/src/commands/normalize.d.ts +4 -0
- package/dist/src/commands/normalize.d.ts.map +1 -0
- package/dist/src/commands/normalize.js +142 -0
- package/dist/src/commands/normalize.js.map +1 -0
- package/dist/src/commands/patch.d.ts +4 -0
- package/dist/src/commands/patch.d.ts.map +1 -0
- package/dist/src/commands/patch.js +172 -0
- package/dist/src/commands/patch.js.map +1 -0
- package/dist/src/commands/push.d.ts +4 -0
- package/dist/src/commands/push.d.ts.map +1 -0
- package/dist/src/commands/push.js +112 -0
- package/dist/src/commands/push.js.map +1 -0
- package/dist/src/commands/query.d.ts +4 -0
- package/dist/src/commands/query.d.ts.map +1 -0
- package/dist/src/commands/query.js +141 -0
- package/dist/src/commands/query.js.map +1 -0
- package/dist/src/commands/read.d.ts +4 -0
- package/dist/src/commands/read.d.ts.map +1 -0
- package/dist/src/commands/read.js +149 -0
- package/dist/src/commands/read.js.map +1 -0
- package/dist/src/commands/sheets.d.ts +4 -0
- package/dist/src/commands/sheets.d.ts.map +1 -0
- package/dist/src/commands/sheets.js +142 -0
- package/dist/src/commands/sheets.js.map +1 -0
- package/dist/src/commands/upsert.d.ts +4 -0
- package/dist/src/commands/upsert.d.ts.map +1 -0
- package/dist/src/commands/upsert.js +137 -0
- package/dist/src/commands/upsert.js.map +1 -0
- package/dist/src/context.d.ts +17 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +47 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +58 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/output/index.d.ts +3 -0
- package/dist/src/output/index.d.ts.map +1 -0
- package/dist/src/output/index.js +3 -0
- package/dist/src/output/index.js.map +1 -0
- package/dist/src/output/render.d.ts +28 -0
- package/dist/src/output/render.d.ts.map +1 -0
- package/dist/src/output/render.js +49 -0
- package/dist/src/output/render.js.map +1 -0
- package/dist/src/output/schema.d.ts +29 -0
- package/dist/src/output/schema.d.ts.map +1 -0
- package/dist/src/output/schema.js +51 -0
- package/dist/src/output/schema.js.map +1 -0
- package/dist/src/output/sheet-schema.d.ts +27 -0
- package/dist/src/output/sheet-schema.d.ts.map +1 -0
- package/dist/src/output/sheet-schema.js +114 -0
- package/dist/src/output/sheet-schema.js.map +1 -0
- package/dist/src/util/stdin.d.ts +7 -0
- package/dist/src/util/stdin.d.ts.map +1 -0
- package/dist/src/util/stdin.js +19 -0
- package/dist/src/util/stdin.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema builders for TOON table rendering. Each FieldDef projects from a
|
|
3
|
+
* source object (a gitsheets record or library response shape) onto a named
|
|
4
|
+
* column in the output table. Modeled after the gws-axi pattern.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* const schema = [
|
|
8
|
+
* field('slug'),
|
|
9
|
+
* truncated('title', 60),
|
|
10
|
+
* computed('size', (r) => Buffer.byteLength(String(r.body ?? ''), 'utf-8')),
|
|
11
|
+
* ];
|
|
12
|
+
* renderList('records', items, schema);
|
|
13
|
+
*/
|
|
14
|
+
export function field(name) {
|
|
15
|
+
return { name, extract: (item) => item[name] };
|
|
16
|
+
}
|
|
17
|
+
export function computed(name, fn) {
|
|
18
|
+
return { name, extract: fn };
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Truncate a string to `max` chars with ellipsis. Pass-through for non-strings.
|
|
22
|
+
*/
|
|
23
|
+
export function truncated(name, max, alias) {
|
|
24
|
+
return {
|
|
25
|
+
name: alias ?? name,
|
|
26
|
+
extract: (item) => {
|
|
27
|
+
const value = item[name];
|
|
28
|
+
if (typeof value !== 'string')
|
|
29
|
+
return value;
|
|
30
|
+
return value.length > max ? `${value.slice(0, max - 1)}…` : value;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Coerce a value to its display string. Empty for null/undefined; otherwise
|
|
36
|
+
* `String(value)`. Useful when a column might hold numbers, dates, or strings.
|
|
37
|
+
*/
|
|
38
|
+
export function display(name, alias) {
|
|
39
|
+
return {
|
|
40
|
+
name: alias ?? name,
|
|
41
|
+
extract: (item) => {
|
|
42
|
+
const value = item[name];
|
|
43
|
+
if (value === null || value === undefined)
|
|
44
|
+
return '';
|
|
45
|
+
if (value instanceof Date)
|
|
46
|
+
return value.toISOString();
|
|
47
|
+
return String(value);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/output/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,MAAM,UAAU,KAAK,CAAC,IAAY;IAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,QAAQ,CACtB,IAAY,EACZ,EAA8C;IAE9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,GAAW,EAAE,KAAc;IACjE,OAAO;QACL,IAAI,EAAE,KAAK,IAAI,IAAI;QACnB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,OAAO,KAAK,CAAC;YAC5C,OAAO,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QACpE,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,KAAc;IAClD,OAAO;QACL,IAAI,EAAE,KAAK,IAAI,IAAI;QACnB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,EAAE,CAAC;YACrD,IAAI,KAAK,YAAY,IAAI;gBAAE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;YACtD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Sheet, SheetConfig } from 'gitsheets';
|
|
2
|
+
import { type FieldDef } from './schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build the default TOON schema for `query` against a sheet. Introspects
|
|
5
|
+
* the sheet's path template + format config so:
|
|
6
|
+
* - TOML sheets show path-template fields plus a couple of scalar fields
|
|
7
|
+
* from the JSON Schema (whatever's named first).
|
|
8
|
+
* - Markdown/mdx sheets show path-template fields, `title` (denormalized
|
|
9
|
+
* from body's H1 once #169 lands; currently a frontmatter field), and
|
|
10
|
+
* `body_size` — never the body content.
|
|
11
|
+
*
|
|
12
|
+
* Capped at ~4 columns total to stay within the AXI "minimal default schema"
|
|
13
|
+
* budget. Consumers extend via `--fields`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function defaultSheetSchema(config: SheetConfig): FieldDef[];
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the field list for a list-rendering command, optionally extending
|
|
18
|
+
* the default schema with user-supplied `--fields a,b,c` entries.
|
|
19
|
+
*/
|
|
20
|
+
export declare function fieldsWithExtras(defaults: FieldDef[], extras: string[]): FieldDef[];
|
|
21
|
+
/**
|
|
22
|
+
* Count records in a sheet. Uses queryAll under the hood — fine for repos
|
|
23
|
+
* with thousands of records; cap-checking is the consumer's job if their
|
|
24
|
+
* corpus pushes higher.
|
|
25
|
+
*/
|
|
26
|
+
export declare function countRecords(sheet: Sheet): Promise<number>;
|
|
27
|
+
//# sourceMappingURL=sheet-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-schema.d.ts","sourceRoot":"","sources":["../../../src/output/sheet-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGpD,OAAO,EAA8B,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAcxE;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,EAAE,CAuClE;AAuBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAAE,EACpB,MAAM,EAAE,MAAM,EAAE,GACf,QAAQ,EAAE,CAUZ;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAGhE"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Template } from 'gitsheets';
|
|
2
|
+
import { computed, field, truncated } from './schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* Body-size column for content-typed sheets. Reports the configured body
|
|
5
|
+
* field's byte length so agents see at a glance which records are long.
|
|
6
|
+
*/
|
|
7
|
+
function bodySizeField(bodyField) {
|
|
8
|
+
return computed('body_size', (item) => {
|
|
9
|
+
const value = item[bodyField];
|
|
10
|
+
if (typeof value !== 'string')
|
|
11
|
+
return '';
|
|
12
|
+
return `${Buffer.byteLength(value, 'utf-8')}`;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build the default TOON schema for `query` against a sheet. Introspects
|
|
17
|
+
* the sheet's path template + format config so:
|
|
18
|
+
* - TOML sheets show path-template fields plus a couple of scalar fields
|
|
19
|
+
* from the JSON Schema (whatever's named first).
|
|
20
|
+
* - Markdown/mdx sheets show path-template fields, `title` (denormalized
|
|
21
|
+
* from body's H1 once #169 lands; currently a frontmatter field), and
|
|
22
|
+
* `body_size` — never the body content.
|
|
23
|
+
*
|
|
24
|
+
* Capped at ~4 columns total to stay within the AXI "minimal default schema"
|
|
25
|
+
* budget. Consumers extend via `--fields`.
|
|
26
|
+
*/
|
|
27
|
+
export function defaultSheetSchema(config) {
|
|
28
|
+
const template = Template.fromString(config.path);
|
|
29
|
+
const pathFields = template.getFieldNames();
|
|
30
|
+
const bodyField = config.format.body;
|
|
31
|
+
const fields = [];
|
|
32
|
+
const seen = new Set();
|
|
33
|
+
for (const name of pathFields) {
|
|
34
|
+
if (seen.has(name))
|
|
35
|
+
continue;
|
|
36
|
+
seen.add(name);
|
|
37
|
+
fields.push(field(name));
|
|
38
|
+
}
|
|
39
|
+
if (bodyField !== undefined) {
|
|
40
|
+
// Markdown/MDX: include `title` if the schema declares it, then body size.
|
|
41
|
+
if (!seen.has('title') && schemaHasProperty(config, 'title')) {
|
|
42
|
+
seen.add('title');
|
|
43
|
+
fields.push(truncated('title', 60));
|
|
44
|
+
}
|
|
45
|
+
if (!seen.has('body_size')) {
|
|
46
|
+
seen.add('body_size');
|
|
47
|
+
fields.push(bodySizeField(bodyField));
|
|
48
|
+
}
|
|
49
|
+
return fields.slice(0, 4);
|
|
50
|
+
}
|
|
51
|
+
// TOML: pad out with the first few non-template scalar properties from the
|
|
52
|
+
// JSON schema, capped at 4 total. Skips array/object properties — those
|
|
53
|
+
// don't tabulate well.
|
|
54
|
+
const props = schemaProperties(config);
|
|
55
|
+
for (const [name, prop] of props) {
|
|
56
|
+
if (fields.length >= 4)
|
|
57
|
+
break;
|
|
58
|
+
if (seen.has(name))
|
|
59
|
+
continue;
|
|
60
|
+
if (!isScalarSchema(prop))
|
|
61
|
+
continue;
|
|
62
|
+
seen.add(name);
|
|
63
|
+
fields.push(field(name));
|
|
64
|
+
}
|
|
65
|
+
return fields;
|
|
66
|
+
}
|
|
67
|
+
function schemaProperties(config) {
|
|
68
|
+
const schema = config.schema;
|
|
69
|
+
if (!schema || typeof schema !== 'object')
|
|
70
|
+
return [];
|
|
71
|
+
const props = schema['properties'];
|
|
72
|
+
if (!props || typeof props !== 'object')
|
|
73
|
+
return [];
|
|
74
|
+
return Object.entries(props);
|
|
75
|
+
}
|
|
76
|
+
function schemaHasProperty(config, name) {
|
|
77
|
+
return schemaProperties(config).some(([n]) => n === name);
|
|
78
|
+
}
|
|
79
|
+
function isScalarSchema(prop) {
|
|
80
|
+
if (!prop || typeof prop !== 'object')
|
|
81
|
+
return false;
|
|
82
|
+
const type = prop['type'];
|
|
83
|
+
if (type === 'string' || type === 'number' || type === 'integer' || type === 'boolean') {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Resolve the field list for a list-rendering command, optionally extending
|
|
90
|
+
* the default schema with user-supplied `--fields a,b,c` entries.
|
|
91
|
+
*/
|
|
92
|
+
export function fieldsWithExtras(defaults, extras) {
|
|
93
|
+
if (extras.length === 0)
|
|
94
|
+
return defaults;
|
|
95
|
+
const out = [...defaults];
|
|
96
|
+
const seen = new Set(out.map((f) => f.name));
|
|
97
|
+
for (const name of extras) {
|
|
98
|
+
if (seen.has(name))
|
|
99
|
+
continue;
|
|
100
|
+
seen.add(name);
|
|
101
|
+
out.push(field(name));
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Count records in a sheet. Uses queryAll under the hood — fine for repos
|
|
107
|
+
* with thousands of records; cap-checking is the consumer's job if their
|
|
108
|
+
* corpus pushes higher.
|
|
109
|
+
*/
|
|
110
|
+
export async function countRecords(sheet) {
|
|
111
|
+
const rows = await sheet.queryAll({}, { withBody: false });
|
|
112
|
+
return rows.length;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=sheet-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-schema.js","sourceRoot":"","sources":["../../../src/output/sheet-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAiB,MAAM,aAAa,CAAC;AAExE;;;GAGG;AACH,SAAS,aAAa,CAAC,SAAiB;IACtC,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;QACpC,MAAM,KAAK,GAAI,IAAgC,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAC;QACzC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAmB;IACpD,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;IAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACrC,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QAC7B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI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AAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAY;IAC7C,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read all of process.stdin to a string. Resolves to '' if stdin is a TTY
|
|
3
|
+
* (interactive — nothing to read) or when the GITSHEETS_AXI_NO_STDIN env is
|
|
4
|
+
* set (test-mode opt-out to avoid hangs in in-process test runners).
|
|
5
|
+
*/
|
|
6
|
+
export declare function readStdin(): Promise<string>;
|
|
7
|
+
//# sourceMappingURL=stdin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin.d.ts","sourceRoot":"","sources":["../../../src/util/stdin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAUjD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read all of process.stdin to a string. Resolves to '' if stdin is a TTY
|
|
3
|
+
* (interactive — nothing to read) or when the GITSHEETS_AXI_NO_STDIN env is
|
|
4
|
+
* set (test-mode opt-out to avoid hangs in in-process test runners).
|
|
5
|
+
*/
|
|
6
|
+
export async function readStdin() {
|
|
7
|
+
if (process.stdin.isTTY)
|
|
8
|
+
return '';
|
|
9
|
+
if (process.env['GITSHEETS_AXI_NO_STDIN'] === '1')
|
|
10
|
+
return '';
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
let data = '';
|
|
13
|
+
process.stdin.setEncoding('utf-8');
|
|
14
|
+
process.stdin.on('data', (chunk) => { data += chunk; });
|
|
15
|
+
process.stdin.on('end', () => resolve(data));
|
|
16
|
+
process.stdin.on('error', reject);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=stdin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin.js","sourceRoot":"","sources":["../../../src/util/stdin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACnC,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,KAAK,GAAG;QAAE,OAAO,EAAE,CAAC;IAC7D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gitsheets-axi",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Agent-facing CLI for gitsheets — token-efficient TOON output, idempotent mutations, self-installing session hooks.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"gitsheets-axi": "dist/bin/gitsheets-axi.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"LICENSE",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.build.json && chmod +x dist/bin/gitsheets-axi.js",
|
|
19
|
+
"test": "vitest run --passWithNoTests",
|
|
20
|
+
"test:watch": "vitest",
|
|
21
|
+
"type-check": "tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/JarvusInnovations/gitsheets.git",
|
|
26
|
+
"directory": "packages/gitsheets-axi"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/JarvusInnovations/gitsheets#readme",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/JarvusInnovations/gitsheets/issues"
|
|
31
|
+
},
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
|
+
"author": "Jarvus Innovations",
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"gitsheets",
|
|
39
|
+
"axi",
|
|
40
|
+
"agent",
|
|
41
|
+
"cli",
|
|
42
|
+
"toon",
|
|
43
|
+
"git"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@toon-format/toon": "^2.2.0",
|
|
47
|
+
"axi-sdk-js": "^0.1.6",
|
|
48
|
+
"gitsheets": "*"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^25.8.0",
|
|
52
|
+
"typescript": "^6.0.3",
|
|
53
|
+
"vitest": "^4.1.6"
|
|
54
|
+
}
|
|
55
|
+
}
|