tines 0.0.91 → 0.0.92
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/dist/index.js +23 -29
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4183,15 +4183,12 @@ function parseTargetSpec(spec) {
|
|
|
4183
4183
|
}
|
|
4184
4184
|
|
|
4185
4185
|
// src/common.ts
|
|
4186
|
-
var DEFAULT_URL = "
|
|
4187
|
-
function withCommon(cmd
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
);
|
|
4193
|
-
}
|
|
4194
|
-
return cmd.option("--api-key <key>", "API key (or set TINES_API_KEY)").option("--json", "output the raw JSON response");
|
|
4186
|
+
var DEFAULT_URL = "https://tines.tbuckley.dev";
|
|
4187
|
+
function withCommon(cmd) {
|
|
4188
|
+
return cmd.option(
|
|
4189
|
+
"-u, --url <url>",
|
|
4190
|
+
`base URL of the Tines API (or set TINES_API_URL; default ${DEFAULT_URL})`
|
|
4191
|
+
).option("--api-key <key>", "API key (or set TINES_API_KEY)").option("--json", "output the raw JSON response");
|
|
4195
4192
|
}
|
|
4196
4193
|
function withList(cmd) {
|
|
4197
4194
|
return withCommon(
|
|
@@ -4417,13 +4414,14 @@ function register(program3) {
|
|
|
4417
4414
|
);
|
|
4418
4415
|
withCommon(
|
|
4419
4416
|
withScopeFlags(
|
|
4420
|
-
context.command("create").description("Create a context item scoped to a project, state, and/or issue").requiredOption("-k, --kind <kind>", "prompt, skill, or repo").requiredOption("-n, --name <name>", "item name (slug-like for skills; the dedup/override key)").option("-d, --description <text>", "one-liner shown in lists").option("--body <md>", "prompt body: inline Markdown or @file (escape a literal @ as @@)").option("--file <path>=@<local>", "skill file: workspace path = local file (repeatable)", collect, []).option("--url <url>", "repo: clone URL").option("--branch <branch>", "repo: branch to check out").option("--dir <dir>", "repo: checkout directory (defaults to the URL's basename)")
|
|
4421
|
-
)
|
|
4422
|
-
// --url is the repo pointer here; the API base comes from TINES_API_URL.
|
|
4423
|
-
{ baseUrlFlag: false }
|
|
4417
|
+
context.command("create").description("Create a context item scoped to a project, state, and/or issue").requiredOption("-k, --kind <kind>", "prompt, skill, or repo").requiredOption("-n, --name <name>", "item name (slug-like for skills; the dedup/override key)").option("-d, --description <text>", "one-liner shown in lists").option("--body <md>", "prompt body: inline Markdown or @file (escape a literal @ as @@)").option("--file <path>=@<local>", "skill file: workspace path = local file (repeatable)", collect, []).option("--repo-url <url>", "repo: clone URL").option("--branch <branch>", "repo: branch to check out").option("--dir <dir>", "repo: checkout directory (defaults to the URL's basename)")
|
|
4418
|
+
)
|
|
4424
4419
|
).action(
|
|
4425
4420
|
async (opts) => {
|
|
4426
|
-
|
|
4421
|
+
if (opts.kind === "repo" && opts.repoUrl === void 0) {
|
|
4422
|
+
die("--kind repo needs --repo-url <clone-url> (--url is the API base URL)");
|
|
4423
|
+
}
|
|
4424
|
+
const api = client(opts);
|
|
4427
4425
|
const scope = await resolveScopeFlags(api, opts);
|
|
4428
4426
|
const body = {
|
|
4429
4427
|
kind: opts.kind,
|
|
@@ -4434,7 +4432,7 @@ function register(program3) {
|
|
|
4434
4432
|
if (opts.body !== void 0) body.body = readBodyValue(opts.body);
|
|
4435
4433
|
if (opts.file.length > 0) body.files = opts.file.map(parseFileSpec);
|
|
4436
4434
|
if (opts.kind === "skill" && body.files === void 0) body.files = [];
|
|
4437
|
-
if (opts.
|
|
4435
|
+
if (opts.repoUrl !== void 0) body.repo_url = opts.repoUrl;
|
|
4438
4436
|
if (opts.branch !== void 0) body.repo_branch = opts.branch;
|
|
4439
4437
|
if (opts.dir !== void 0) body.repo_dir = opts.dir;
|
|
4440
4438
|
const item = await api.createContextItem(body);
|
|
@@ -4444,17 +4442,15 @@ function register(program3) {
|
|
|
4444
4442
|
);
|
|
4445
4443
|
withCommon(
|
|
4446
4444
|
withScopeFlags(
|
|
4447
|
-
context.command("edit <id>").description("Edit a context item: payload, name, description, or scope").option("-n, --name <name>", "rename the item").option("-d, --description <text>", "set the description").option("--body <md>", "prompt body: inline Markdown or @file (escape a literal @ as @@)").option("--file <path>=@<local>", "add or replace a skill file (repeatable)", collect, []).option("--remove-file <path>", "remove a skill file (repeatable)", collect, []).option("--url <url>", "repo: clone URL").option("--branch <branch>", "repo: branch (empty string clears it)").option("--dir <dir>", "repo: checkout directory (empty string restores the URL default)").option("--unset <dimension>", "drop a scope dimension: project, state, or issue (repeatable)", collect, []).option(
|
|
4445
|
+
context.command("edit <id>").description("Edit a context item: payload, name, description, or scope").option("-n, --name <name>", "rename the item").option("-d, --description <text>", "set the description").option("--body <md>", "prompt body: inline Markdown or @file (escape a literal @ as @@)").option("--file <path>=@<local>", "add or replace a skill file (repeatable)", collect, []).option("--remove-file <path>", "remove a skill file (repeatable)", collect, []).option("--repo-url <url>", "repo: clone URL").option("--branch <branch>", "repo: branch (empty string clears it)").option("--dir <dir>", "repo: checkout directory (empty string restores the URL default)").option("--unset <dimension>", "drop a scope dimension: project, state, or issue (repeatable)", collect, []).option(
|
|
4448
4446
|
"--expect-version <n>",
|
|
4449
4447
|
"fail (409) unless the item is still at this version",
|
|
4450
4448
|
(v) => Number.parseInt(v, 10)
|
|
4451
4449
|
)
|
|
4452
|
-
)
|
|
4453
|
-
// --url is the repo pointer here; the API base comes from TINES_API_URL.
|
|
4454
|
-
{ baseUrlFlag: false }
|
|
4450
|
+
)
|
|
4455
4451
|
).action(
|
|
4456
4452
|
async (id, opts) => {
|
|
4457
|
-
const api = client(
|
|
4453
|
+
const api = client(opts);
|
|
4458
4454
|
const body = {};
|
|
4459
4455
|
if (opts.expectVersion !== void 0) body.expected_version = opts.expectVersion;
|
|
4460
4456
|
if (opts.name !== void 0) body.name = opts.name;
|
|
@@ -4484,7 +4480,7 @@ function register(program3) {
|
|
|
4484
4480
|
}
|
|
4485
4481
|
body.files = [...files.entries()].map(([path2, content]) => ({ path: path2, content }));
|
|
4486
4482
|
}
|
|
4487
|
-
if (opts.
|
|
4483
|
+
if (opts.repoUrl !== void 0) body.repo_url = opts.repoUrl;
|
|
4488
4484
|
if (opts.branch !== void 0) body.repo_branch = opts.branch === "" ? null : opts.branch;
|
|
4489
4485
|
if (opts.dir !== void 0) body.repo_dir = opts.dir === "" ? null : opts.dir;
|
|
4490
4486
|
if (Object.keys(body).length === 0) {
|
|
@@ -5025,16 +5021,14 @@ files (v${artifact.current_version.version}):`);
|
|
|
5025
5021
|
artifactsCmd.command("attach <ref> <name>").description("Attach content to a named artifact slot (creates it, or appends the next version)").option("-f, --file <path>", "upload a file (MIME sniffed from the extension)").option(
|
|
5026
5022
|
"--folder <dir>",
|
|
5027
5023
|
"snapshot a directory tree as one version (collect locally, attach once; MIME per file sniffed)"
|
|
5028
|
-
).option("-t, --text <md|@file>", "inline text document: inline Markdown or @file").option("--
|
|
5029
|
-
// --url is the link payload here; the API base comes from TINES_API_URL.
|
|
5030
|
-
{ baseUrlFlag: false }
|
|
5024
|
+
).option("-t, --text <md|@file>", "inline text document: inline Markdown or @file").option("--link <url>", "link: the URL to attach").option("--pr <spec>", "PR reference: owner/repo#N or a GitHub PR URL").option("--content-type <mime>", "declared MIME type (with --file or --text)").option("--filename <name>", "display filename (with --text; defaults to <name>.md)").option("--title <title>", "display title (with --link)").option("-d, --description <text>", "artifact description, shown in lists and launch prompts")
|
|
5031
5025
|
).action(
|
|
5032
5026
|
async (ref, name2, opts) => {
|
|
5033
|
-
const api = client(
|
|
5034
|
-
const sources = [opts.file, opts.folder, opts.text, opts.
|
|
5027
|
+
const api = client(opts);
|
|
5028
|
+
const sources = [opts.file, opts.folder, opts.text, opts.link, opts.pr].filter((v) => v !== void 0);
|
|
5035
5029
|
if (sources.length !== 1) {
|
|
5036
5030
|
die(
|
|
5037
|
-
"pass exactly one content source: --file <path>, --folder <dir>, --text <md|@file>, --
|
|
5031
|
+
"pass exactly one content source: --file <path>, --folder <dir>, --text <md|@file>, --link <url>, or --pr <spec> (a link goes in --link; --url is the API base URL)"
|
|
5038
5032
|
);
|
|
5039
5033
|
}
|
|
5040
5034
|
const issue = await resolveIssue(api, ref);
|
|
@@ -5071,10 +5065,10 @@ files (v${artifact.current_version.version}):`);
|
|
|
5071
5065
|
...opts.contentType !== void 0 ? { content_type: opts.contentType } : {},
|
|
5072
5066
|
...opts.description !== void 0 ? { description: opts.description } : {}
|
|
5073
5067
|
});
|
|
5074
|
-
} else if (opts.
|
|
5068
|
+
} else if (opts.link !== void 0) {
|
|
5075
5069
|
artifact = await api.putArtifact(issue.id, name2, {
|
|
5076
5070
|
type: "link",
|
|
5077
|
-
url: opts.
|
|
5071
|
+
url: opts.link,
|
|
5078
5072
|
...opts.title !== void 0 ? { title: opts.title } : {},
|
|
5079
5073
|
...opts.description !== void 0 ? { description: opts.description } : {}
|
|
5080
5074
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tines",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.92",
|
|
4
4
|
"description": "CLI for Tines, an orchestration layer for AI agents",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "esbuild src/index.ts --bundle --platform=node --target=node20 --format=esm --banner:js=\"#!/usr/bin/env node\" --outfile=dist/index.js",
|
|
29
|
-
"start": "tsx src/index.ts",
|
|
29
|
+
"start": "TINES_API_URL=${TINES_API_URL:-http://localhost:5173} tsx src/index.ts",
|
|
30
30
|
"check": "tsc --noEmit",
|
|
31
31
|
"test": "vitest run"
|
|
32
32
|
}
|