oasis_test 0.1.86 → 0.1.87
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 +73 -32
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -141611,7 +141611,8 @@ async function fetchAppBotIdentity(slug6, opts = {}, deps = {}) {
|
|
|
141611
141611
|
const body = await resp.json().catch(() => ({}));
|
|
141612
141612
|
const id = body["id"];
|
|
141613
141613
|
if (id === void 0 || id === null) return null;
|
|
141614
|
-
|
|
141614
|
+
const actualLogin = typeof body["login"] === "string" && body["login"] ? body["login"] : login;
|
|
141615
|
+
return { login: actualLogin, email: `${String(id)}+${actualLogin}@users.noreply.github.com` };
|
|
141615
141616
|
} catch {
|
|
141616
141617
|
return null;
|
|
141617
141618
|
}
|
|
@@ -141681,7 +141682,8 @@ var init_github = __esm({
|
|
|
141681
141682
|
{ key: "app_installation_id", description: "App \u5728\u8BE5\u7EC4\u7EC7/\u8D26\u53F7\u4E0B\u7684\u5B89\u88C5 ID", secret: false, required: false },
|
|
141682
141683
|
{ key: "app_token_expires_at", description: "installation token \u7684\u7EDD\u5BF9\u8FC7\u671F\u65F6\u523B\uFF08epoch ms\uFF09", secret: false, required: false },
|
|
141683
141684
|
{ key: "app_slug", description: "App \u7684 slug\u2014\u2014bot \u8EAB\u4EFD\u663E\u793A\u4E3A <slug>[bot]", secret: false, required: false },
|
|
141684
|
-
{ key: "app_bot_email", description: "bot \u8D26\u53F7\u7684 noreply \u90AE\u7BB1\uFF08commit \u7F72\u540D\u9760\u5B83\u94FE\u63A5\u5230 bot\uFF09", secret: false, required: false }
|
|
141685
|
+
{ key: "app_bot_email", description: "bot \u8D26\u53F7\u7684 noreply \u90AE\u7BB1\uFF08commit \u7F72\u540D\u9760\u5B83\u94FE\u63A5\u5230 bot\uFF09", secret: false, required: false },
|
|
141686
|
+
{ key: "app_bot_name", description: "bot \u8D26\u53F7\u7684 login\uFF08commit \u7F72\u540D\u7528\u5B83\uFF0C\u4E0E PR \u4F5C\u8005\u9010\u5B57\u4E00\u81F4\uFF09", secret: false, required: false }
|
|
141685
141687
|
]
|
|
141686
141688
|
};
|
|
141687
141689
|
/** wrapper 在 agent PATH 上冒名的命令——必须与真实 CLI 同名,否则遮蔽不生效。 */
|
|
@@ -141700,7 +141702,9 @@ var init_github = __esm({
|
|
|
141700
141702
|
{ key: "app_slug", from: "GITHUB_APP_SLUG", required: false },
|
|
141701
141703
|
// bot 的 noreply 邮箱:commit 署名靠**邮箱**链接到账号(name 只是自由文本)。
|
|
141702
141704
|
// 公开信息,非密钥。
|
|
141703
|
-
{ key: "app_bot_email", from: "GITHUB_APP_BOT_EMAIL", required: false }
|
|
141705
|
+
{ key: "app_bot_email", from: "GITHUB_APP_BOT_EMAIL", required: false },
|
|
141706
|
+
// bot 的 login:commit 署名的 name 用它,才能和 PR 作者显示成同一个身份。
|
|
141707
|
+
{ key: "app_bot_name", from: "GITHUB_APP_BOT_NAME", required: false }
|
|
141704
141708
|
];
|
|
141705
141709
|
/**
|
|
141706
141710
|
* 续期材料——**只在 server 侧读**。私钥留在这边铸 token,节点只拿铸出来的那一小时。
|
|
@@ -141825,9 +141829,11 @@ var init_github = __esm({
|
|
|
141825
141829
|
const appSlug = credentials["app_slug"];
|
|
141826
141830
|
if (appSlug) sessionEnv.set("GH_APP_SLUG", appSlug);
|
|
141827
141831
|
const botEmail = credentials["app_bot_email"] ?? "";
|
|
141828
|
-
|
|
141832
|
+
const botName = credentials["app_bot_name"] ?? "";
|
|
141833
|
+
const signName = botName || name;
|
|
141834
|
+
sessionEnv.set("GIT_AUTHOR_NAME", signName);
|
|
141829
141835
|
sessionEnv.set("GIT_AUTHOR_EMAIL", botEmail);
|
|
141830
|
-
sessionEnv.set("GIT_COMMITTER_NAME",
|
|
141836
|
+
sessionEnv.set("GIT_COMMITTER_NAME", signName);
|
|
141831
141837
|
sessionEnv.set("GIT_COMMITTER_EMAIL", botEmail);
|
|
141832
141838
|
sessionEnv.set("EMAIL", botEmail);
|
|
141833
141839
|
sessionEnv.set("GIT_CONFIG_COUNT", "1");
|
|
@@ -149852,7 +149858,10 @@ async function startOasisServer(opts) {
|
|
|
149852
149858
|
}
|
|
149853
149859
|
if (pending.slug) {
|
|
149854
149860
|
const bot = await fetchAppBotIdentity(pending.slug, { token: minted.token });
|
|
149855
|
-
if (bot)
|
|
149861
|
+
if (bot) {
|
|
149862
|
+
await put("GITHUB_APP_BOT_EMAIL", bot.email, false);
|
|
149863
|
+
await put("GITHUB_APP_BOT_NAME", bot.login, false);
|
|
149864
|
+
}
|
|
149856
149865
|
}
|
|
149857
149866
|
pending.done = true;
|
|
149858
149867
|
delete pending.privateKeyPem;
|
|
@@ -150887,6 +150896,7 @@ var init_memory_trace_store = __esm({
|
|
|
150887
150896
|
startedAt: run.startedAt,
|
|
150888
150897
|
effectiveModel: run.effectiveModel,
|
|
150889
150898
|
runtimeKind: run.runtimeKind,
|
|
150899
|
+
runtimeInstanceId: run.runtimeInstanceId ?? null,
|
|
150890
150900
|
usage: structuredClone(run.usage)
|
|
150891
150901
|
}));
|
|
150892
150902
|
}
|
|
@@ -163324,6 +163334,8 @@ function buildOrganizationUsageSummary(input) {
|
|
|
163324
163334
|
const runtimeRunCounts = /* @__PURE__ */ new Map();
|
|
163325
163335
|
const runtimeModels = /* @__PURE__ */ new Map();
|
|
163326
163336
|
const runtimeEmployees = /* @__PURE__ */ new Map();
|
|
163337
|
+
const runtimeInstanceKind = /* @__PURE__ */ new Map();
|
|
163338
|
+
const runtimeHostnames = input.runtimeHostnames ?? /* @__PURE__ */ new Map();
|
|
163327
163339
|
for (const run of input.runs) {
|
|
163328
163340
|
const usage = usageOf(run);
|
|
163329
163341
|
if (!usage) {
|
|
@@ -163379,18 +163391,19 @@ function buildOrganizationUsageSummary(input) {
|
|
|
163379
163391
|
empWoMap.set(rowId, empWoUsage);
|
|
163380
163392
|
}
|
|
163381
163393
|
addUsage(empWoUsage.usage, usage);
|
|
163382
|
-
const
|
|
163383
|
-
let rtUsage = runtimeTotals.get(
|
|
163394
|
+
const rtKey = run.runtimeInstanceId ?? `__unregistered__:${run.runtimeKind}`;
|
|
163395
|
+
let rtUsage = runtimeTotals.get(rtKey);
|
|
163384
163396
|
if (!rtUsage) {
|
|
163385
163397
|
rtUsage = emptyUsage();
|
|
163386
|
-
runtimeTotals.set(
|
|
163398
|
+
runtimeTotals.set(rtKey, rtUsage);
|
|
163399
|
+
runtimeInstanceKind.set(rtKey, run.runtimeKind);
|
|
163387
163400
|
}
|
|
163388
163401
|
addUsage(rtUsage, usage);
|
|
163389
|
-
runtimeRunCounts.set(
|
|
163390
|
-
let modelMap = runtimeModels.get(
|
|
163402
|
+
runtimeRunCounts.set(rtKey, (runtimeRunCounts.get(rtKey) ?? 0) + 1);
|
|
163403
|
+
let modelMap = runtimeModels.get(rtKey);
|
|
163391
163404
|
if (!modelMap) {
|
|
163392
163405
|
modelMap = /* @__PURE__ */ new Map();
|
|
163393
|
-
runtimeModels.set(
|
|
163406
|
+
runtimeModels.set(rtKey, modelMap);
|
|
163394
163407
|
}
|
|
163395
163408
|
let modelUsage = modelMap.get(run.effectiveModel);
|
|
163396
163409
|
if (!modelUsage) {
|
|
@@ -163398,10 +163411,10 @@ function buildOrganizationUsageSummary(input) {
|
|
|
163398
163411
|
modelMap.set(run.effectiveModel, modelUsage);
|
|
163399
163412
|
}
|
|
163400
163413
|
addUsage(modelUsage, usage);
|
|
163401
|
-
let rtEmpMap = runtimeEmployees.get(
|
|
163414
|
+
let rtEmpMap = runtimeEmployees.get(rtKey);
|
|
163402
163415
|
if (!rtEmpMap) {
|
|
163403
163416
|
rtEmpMap = /* @__PURE__ */ new Map();
|
|
163404
|
-
runtimeEmployees.set(
|
|
163417
|
+
runtimeEmployees.set(rtKey, rtEmpMap);
|
|
163405
163418
|
}
|
|
163406
163419
|
let rtEmpUsage = rtEmpMap.get(run.actorId);
|
|
163407
163420
|
if (!rtEmpUsage) {
|
|
@@ -163453,9 +163466,17 @@ function buildOrganizationUsageSummary(input) {
|
|
|
163453
163466
|
(e) => e.share,
|
|
163454
163467
|
(e, s2) => ({ ...e, share: s2 })
|
|
163455
163468
|
);
|
|
163469
|
+
function resolveHostname(rtKey, kind) {
|
|
163470
|
+
const h = runtimeHostnames.get(rtKey);
|
|
163471
|
+
if (h) return h;
|
|
163472
|
+
const parts = rtKey.split(":");
|
|
163473
|
+
if (parts.length >= 3 && parts[0] === "runtime") return parts[1];
|
|
163474
|
+
return kind;
|
|
163475
|
+
}
|
|
163456
163476
|
const runtimeRows = normalizeShares(
|
|
163457
|
-
[...runtimeTotals].map(([
|
|
163458
|
-
const
|
|
163477
|
+
[...runtimeTotals].map(([rtKey, usage]) => {
|
|
163478
|
+
const kind = runtimeInstanceKind.get(rtKey) ?? "unknown";
|
|
163479
|
+
const modelMap = runtimeModels.get(rtKey) ?? /* @__PURE__ */ new Map();
|
|
163459
163480
|
const models = normalizeShares(
|
|
163460
163481
|
[...modelMap].map(([model, modelUsage]) => ({
|
|
163461
163482
|
model,
|
|
@@ -163465,7 +163486,7 @@ function buildOrganizationUsageSummary(input) {
|
|
|
163465
163486
|
(m2) => m2.share,
|
|
163466
163487
|
(m2, s2) => ({ ...m2, share: s2 })
|
|
163467
163488
|
);
|
|
163468
|
-
const empMap = runtimeEmployees.get(
|
|
163489
|
+
const empMap = runtimeEmployees.get(rtKey);
|
|
163469
163490
|
const employees = normalizeShares(
|
|
163470
163491
|
empMap ? [...empMap].map(([actorId, empUsage]) => ({
|
|
163471
163492
|
actorId,
|
|
@@ -163476,10 +163497,12 @@ function buildOrganizationUsageSummary(input) {
|
|
|
163476
163497
|
(e, s2) => ({ ...e, share: s2 })
|
|
163477
163498
|
);
|
|
163478
163499
|
return {
|
|
163479
|
-
|
|
163500
|
+
runtimeInstanceId: rtKey,
|
|
163501
|
+
hostname: resolveHostname(rtKey, kind),
|
|
163502
|
+
runtimeKind: kind,
|
|
163480
163503
|
usage,
|
|
163481
163504
|
share: total.tokens > 0 ? usage.tokens / total.tokens : 0,
|
|
163482
|
-
runCount: runtimeRunCounts.get(
|
|
163505
|
+
runCount: runtimeRunCounts.get(rtKey) ?? 0,
|
|
163483
163506
|
models,
|
|
163484
163507
|
employees
|
|
163485
163508
|
};
|
|
@@ -163744,10 +163767,17 @@ function collabDomain(opts) {
|
|
|
163744
163767
|
return { status: 400, body: { error: { code: "bad_request", message: "timeZone \u65E0\u6548" } } };
|
|
163745
163768
|
}
|
|
163746
163769
|
const { kernel } = await resolveCtx(req.auth.companyId);
|
|
163747
|
-
const runs = await
|
|
163770
|
+
const [runs, runtimeRecords] = await Promise.all([
|
|
163771
|
+
opts.trace.listUsageRuns({ from, to }),
|
|
163772
|
+
opts.listRuntimes ? opts.listRuntimes().catch(() => []) : Promise.resolve([])
|
|
163773
|
+
]);
|
|
163774
|
+
const runtimeHostnames = /* @__PURE__ */ new Map();
|
|
163775
|
+
for (const rt of runtimeRecords) {
|
|
163776
|
+
if (rt.id && rt.hostname) runtimeHostnames.set(rt.id, rt.hostname);
|
|
163777
|
+
}
|
|
163748
163778
|
return {
|
|
163749
163779
|
status: 200,
|
|
163750
|
-
body: buildOrganizationUsageSummary({ model: kernel.model, runs, bucketKind: bucket, timeZone })
|
|
163780
|
+
body: buildOrganizationUsageSummary({ model: kernel.model, runs, bucketKind: bucket, timeZone, runtimeHostnames })
|
|
163751
163781
|
};
|
|
163752
163782
|
});
|
|
163753
163783
|
router.get("/api/workorders", async (req) => {
|
|
@@ -177239,7 +177269,7 @@ var init_postgres_trace = __esm({
|
|
|
177239
177269
|
}
|
|
177240
177270
|
async listUsageRuns(filter) {
|
|
177241
177271
|
const r = await this.pool.query(
|
|
177242
|
-
`SELECT actor_id, artifact_id, started_at, effective_model, runtime_kind, usage
|
|
177272
|
+
`SELECT actor_id, artifact_id, started_at, effective_model, runtime_kind, runtime_instance_id, usage
|
|
177243
177273
|
FROM ${this.s}.agent_runs
|
|
177244
177274
|
WHERE jsonb_typeof(usage) = 'object' AND started_at >= $1 AND started_at <= $2
|
|
177245
177275
|
ORDER BY started_at`,
|
|
@@ -177251,6 +177281,7 @@ var init_postgres_trace = __esm({
|
|
|
177251
177281
|
startedAt: row.started_at,
|
|
177252
177282
|
effectiveModel: row.effective_model ?? null,
|
|
177253
177283
|
runtimeKind: row.runtime_kind ?? "shell",
|
|
177284
|
+
runtimeInstanceId: row.runtime_instance_id ?? null,
|
|
177254
177285
|
usage: row.usage
|
|
177255
177286
|
}));
|
|
177256
177287
|
}
|
|
@@ -180404,6 +180435,8 @@ async function startServe(opts) {
|
|
|
180404
180435
|
trace: trace.service,
|
|
180405
180436
|
registry: registryStore,
|
|
180406
180437
|
artifacts: artifactStateStore,
|
|
180438
|
+
// 组织汇总用——从 node_runtimes 取 hostname,解析运行时实例标签(kind @ hostname)
|
|
180439
|
+
listRuntimes: (nodeId) => nodeStore.listRuntimes(nodeId),
|
|
180407
180440
|
dispatchJournal: () => journalRing.slice(-200),
|
|
180408
180441
|
// 诊断 92ac8f18-83e5fde6 §④ D-2:按**请求公司**取其 dispatcher 的 queued/backoff 信号。
|
|
180409
180442
|
// CO-302 每家公司各有一套 dispatcher(dispatchers 以 companyId 为键)——固定读默认公司会让
|
|
@@ -182957,7 +182990,7 @@ var COMMAND_DECLS = {
|
|
|
182957
182990
|
// —— 版本机(§5) ——
|
|
182958
182991
|
spawn: {
|
|
182959
182992
|
usage: "oasis spawn <artifactId> --type <t> [--title <\u77ED\u540D>] [--brief <\u89C4\u683C>] [--input <\u4E0A\u6E38id>[,<id>\u2026]] [--owner <actorId>] [--workspace ws] [--persistence temp|persistent] [--parts-file <json>] [--<\u5B57\u6BB5> <\u503C>] [--set-json <json>]",
|
|
182960
|
-
description: "\u521B\u5EFA\u65B0\u4EA7\u7269\u8282\u70B9\uFF08\xA75 \u7248\u672C\u673A\uFF09\u3002--<\u5B57\u6BB5> <\u503C> \u662F\u8BE5\u7C7B\u578B\u52A8\u6001\u58F0\u660E\u7684\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF08\u7528 oasis artifact-types show <type> \u67E5\u770B\uFF09\u3002",
|
|
182993
|
+
description: "\u521B\u5EFA\u65B0\u4EA7\u7269\u8282\u70B9\uFF08\xA75 \u7248\u672C\u673A\uFF09\u3002--<\u5B57\u6BB5> <\u503C> \u662F\u8BE5\u7C7B\u578B\u52A8\u6001\u58F0\u660E\u7684\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF08\u7528 oasis artifact-types show <type|\u8BE5\u4EA7\u7269 id> \u67E5\u770B\uFF09\u3002",
|
|
182961
182994
|
positional: [
|
|
182962
182995
|
{ name: "<artifactId>", required: true, desc: "\u4EA7\u7269 id" }
|
|
182963
182996
|
],
|
|
@@ -183510,9 +183543,9 @@ var COMMAND_DECLS = {
|
|
|
183510
183543
|
},
|
|
183511
183544
|
// —— 类型管理 ——
|
|
183512
183545
|
"artifact-types": {
|
|
183513
|
-
usage: "oasis artifact-types [list | search <q> | show <type> | add ... | edit ... | deprecate ... | delete ... | add-field ... | edit-field ... | drop-field ...]",
|
|
183514
|
-
description: "\u7BA1\u7406 artifact \u7C7B\u578B\u6CE8\u518C\u8868\u3002\u5B50\u547D\u4EE4\uFF1Alist\uFF08\u5217\u51FA\u5168\u90E8\uFF09\u3001search\uFF08\u641C\u7D22\uFF09\u3001show\uFF08\u770B\u8BE6\u60C5\u542B\u81EA\u5B9A\u4E49\u5B57\u6BB5\u8868\uFF09\u3001add/edit/deprecate/delete\uFF08\u7C7B\u578B CRUD\uFF09\u3001add-field/edit-field/drop-field\uFF08\u5B57\u6BB5\u7BA1\u7406\uFF09\u3002",
|
|
183515
|
-
examples: ["oasis artifact-types list", "oasis artifact-types show dev"]
|
|
183546
|
+
usage: "oasis artifact-types [list | search <q> | show <type|artifactId> | add ... | edit ... | deprecate ... | delete ... | add-field ... | edit-field ... | drop-field ...]",
|
|
183547
|
+
description: "\u7BA1\u7406 artifact \u7C7B\u578B\u6CE8\u518C\u8868\u3002\u5B50\u547D\u4EE4\uFF1Alist\uFF08\u5217\u51FA\u5168\u90E8\uFF09\u3001search\uFF08\u641C\u7D22\uFF09\u3001show\uFF08\u770B\u8BE6\u60C5\u542B\u81EA\u5B9A\u4E49\u5B57\u6BB5\u8868\uFF1B**\u76F4\u63A5\u5582\u4EA7\u7269 id \u4E5F\u884C**\uFF0C\u81EA\u52A8\u89E3\u6790\u6210\u5B83\u7684\u7C7B\u578B\uFF09\u3001add/edit/deprecate/delete\uFF08\u7C7B\u578B CRUD\uFF09\u3001add-field/edit-field/drop-field\uFF08\u5B57\u6BB5\u7BA1\u7406\uFF09\u3002",
|
|
183548
|
+
examples: ["oasis artifact-types list", "oasis artifact-types show dev", "oasis artifact-types show artifact:brief:abc-123"]
|
|
183516
183549
|
},
|
|
183517
183550
|
// —— 工单 ——
|
|
183518
183551
|
"create-workorder": {
|
|
@@ -183724,7 +183757,7 @@ var COMMAND_DECLS = {
|
|
|
183724
183757
|
},
|
|
183725
183758
|
edit: {
|
|
183726
183759
|
usage: "oasis edit <id> [--title \u2026] [--brief \u2026] [--<\u5B57\u6BB5> <\u503C>] [--set-json <json>] [--clear <\u5B57\u6BB5,\u2026>]",
|
|
183727
|
-
description: "\u4FEE\u6539\u4EA7\u7269\u5C5E\u6027\uFF08\xA75 \u6682\u5B58\u6001\u2014\u2014OASIS_STAGE=1 \u4E0B\u751F\u6548\uFF09\u3002--<\u5B57\u6BB5> <\u503C> \u662F\u8BE5\u7C7B\u578B\u52A8\u6001\u58F0\u660E\u7684\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF08\u7528 oasis
|
|
183760
|
+
description: "\u4FEE\u6539\u4EA7\u7269\u5C5E\u6027\uFF08\xA75 \u6682\u5B58\u6001\u2014\u2014OASIS_STAGE=1 \u4E0B\u751F\u6548\uFF09\u3002--<\u5B57\u6BB5> <\u503C> \u662F\u8BE5\u7C7B\u578B\u52A8\u6001\u58F0\u660E\u7684\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF08\u7528 oasis artifact-types show <\u8BE5\u4EA7\u7269 id> \u67E5\u770B\uFF09\u3002set-json / clear \u7684\u6392\u9664\u4E0E\u4E13\u9879\u5904\u7406\u89C1 fieldsFromFlags\u3002",
|
|
183728
183761
|
positional: [
|
|
183729
183762
|
{ name: "<id>", required: true, desc: "\u4EA7\u7269 id" }
|
|
183730
183763
|
],
|
|
@@ -183858,7 +183891,7 @@ var USAGE = `oasis \u2014\u2014 artifact-centric \u534F\u4F5C\u5185\u6838 CLI\uF
|
|
|
183858
183891
|
\u7248\u672C\u673A\uFF08\xA75\uFF09
|
|
183859
183892
|
spawn <artifactId> --type <t> [--title <\u77ED\u540D>] [--brief <\u89C4\u683C>] [--input <\u4E0A\u6E38id>[,<id>\u2026]] [--owner <actorId>] [--workspace ws] [--persistence temp|persistent] [--parts-file <json>] [--<\u5B57\u6BB5> <\u503C>] [--set-json <json>]
|
|
183860
183893
|
# --parts-file\uFF1Aconvergent \u5E76\u884C\u5206\u89E3\u7684\u90E8\u4EF6\u6E05\u5355 JSON [{name, spec?, deps?}]\uFF08Stage 3\uFF0C\u7CFB\u7EDF\u6309\u90E8\u4EF6\u6D3E N \u8DEF\uFF09
|
|
183861
|
-
# --<\u5B57\u6BB5> <\u503C>\uFF1A\u8BE5\u7C7B\u578B\u3010\u52A8\u6001\u58F0\u660E\u3011\u7684\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF08\u4E0D\u662F\u56FA\u5B9A\u6E05\u5355\uFF09\u2014\u2014\u7528 "oasis artifact-types show <type>" \u770B\u53EF\u586B\u5B57\u6BB5\uFF1Bstring[]/\u6279\u91CF\u7528 --set-json\uFF1B\u7F3A\u5FC5\u586B\u4F1A\u62A5\u9519\u5217\u51FA
|
|
183894
|
+
# --<\u5B57\u6BB5> <\u503C>\uFF1A\u8BE5\u7C7B\u578B\u3010\u52A8\u6001\u58F0\u660E\u3011\u7684\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF08\u4E0D\u662F\u56FA\u5B9A\u6E05\u5355\uFF09\u2014\u2014\u7528 "oasis artifact-types show <type|\u8BE5\u4EA7\u7269 id>" \u770B\u53EF\u586B\u5B57\u6BB5\uFF1Bstring[]/\u6279\u91CF\u7528 --set-json\uFF1B\u7F3A\u5FC5\u586B\u4F1A\u62A5\u9519\u5217\u51FA
|
|
183862
183895
|
propose <artifactId> [--file <path> | --from-dir <path> | --git-commit <sha>] --reason <text> [--base <revisionId|none>] [--part <name>] [--rebase-of <revisionId>] [--checkpoint --continue]
|
|
183863
183896
|
# --file \u5355\u6587\u4EF6\uFF1B--from-dir \u9012\u5F52\u6574\u76EE\u5F55\u4E3A\u591A\u6587\u4EF6 revision\uFF08\u88C5\u7BB1\u5355\uFF0C\u8DE8\u7248\u672C\u53BB\u91CD\uFF0CF1\uFF09\u3002
|
|
183864
183897
|
# \u4EE3\u7801\u8282\u70B9\u53EF\u3010\u7701\u7565\u5168\u90E8\u5185\u5BB9\u53C2\u6570\u3011\uFF0C\u4EC5 --reason\uFF1A\u5148\u628A\u6539\u52A8 push \u5230\u5DE5\u5355 feat \u5206\u652F\uFF0C\u7CFB\u7EDF\u81EA\u52A8\u4ECE git \u6536\u96C6\uFF08\u672C\u4F53\u5728 git\uFF09\u3002
|
|
@@ -183914,7 +183947,7 @@ var USAGE = `oasis \u2014\u2014 artifact-centric \u534F\u4F5C\u5185\u6838 CLI\uF
|
|
|
183914
183947
|
log <artifactId> # \u8BE5\u4EA7\u7269\u7684**\u64CD\u4F5C\u65E5\u5FD7**\uFF1A\u5DF2\u53D1\u751F\u7684\u5185\u6838\u4E8B\u5B9E\uFF08spawn/propose/merge/conclude\u2026\uFF09\uFF0C\u4ECE oplog \u8BFB
|
|
183915
183948
|
session-log <runId|artifactId> [--n 20] # \u67D0 agent **\u4F1A\u8BDD\u7684\u8FD0\u884C\u65F6\u8F93\u51FA**\uFF08\u65C1\u8D26\uFF0C\u975E\u5185\u6838\u4E8B\u5B9E\uFF09\uFF1A\u6700\u65B0 N \u6761\u4E8B\u4EF6 + "\u8DDD\u4E0A\u6B21\u4E8B\u4EF6 X \u5206\u949F"\uFF08>10min\u2248\u5361\uFF09+ \u5728\u98DE tool_use\u2014\u2014\u5224"\u60F3 vs \u5361"\u3002\u6CE8\u610F\u2260 log\uFF1Alog \u770B\u4EA7\u7269\u7ECF\u5386\u4E86\u4EC0\u4E48\uFF0Csession-log \u770B agent \u6B64\u523B\u5728\u8BF4/\u5E72\u4EC0\u4E48
|
|
183916
183949
|
artifact-types [list | search <q>] # \u770B/\u68C0\u7D22\u5DF2\u6CE8\u518C\u7C7B\u578B\uFF08\u7528\u9014/owner/\u72B6\u6001\uFF09\u2014\u2014\u7ED9\u4EBA\u548C agent \u9009 type
|
|
183917
|
-
artifact-types show <type>
|
|
183950
|
+
artifact-types show <type|artifactId> # \u770B\u5355\u7C7B\u578B\u8BE6\u60C5\uFF1A\u542B\u3010\u81EA\u5B9A\u4E49\u5B57\u6BB5\u8868\u3011(\u540D/\u7C7B\u578B/\u5FC5\u586B/\u8BF4\u660E)\u2014\u2014spawn/edit \u524D\u67E5\u80FD\u586B\u5565\u3002**\u76F4\u63A5\u5582\u4EA7\u7269 id \u4E5F\u884C**\uFF0C\u81EA\u52A8\u89E3\u6790\u6210\u5B83\u7684\u7C7B\u578B
|
|
183918
183951
|
artifact-types add <name> (--content-type <t> --owner-role <r> | --file <json>) [--description \u2026] # \u65B0\u589E\uFF08--file \u6536\u5B8C\u6574 ArtifactTypeDef\uFF1Atriggers/reviews/grounding/budget/acl/mirror\u2026\uFF09
|
|
183919
183952
|
artifact-types edit <name> [--file <json>] [--description \u2026] [--owner-role \u2026] [--content-type \u2026] # \u6539\u7C7B\u578B\u914D\u7F6E\uFF08name \u4E0D\u53EF\u6539\uFF1BcontentType \u6709\u5B58\u91CF\u5373\u62E6\uFF1B--file \u6536\u5B8C\u6574 patch\u3002\u6539\u5B57\u6BB5\u7528 *-field\uFF09
|
|
183920
183953
|
artifact-types add-field <type> <\u5B57\u6BB5> --type <string|string[]|number|boolean> [--required true] [--description \u2026] # \u7ED9\u7C7B\u578B\u3010\u58F0\u660E\u3011\u4E00\u4E2A\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF08\u6539 schema\u3001\u5F71\u54CD\u8BE5 type \u6240\u6709\u8282\u70B9\u7684\u672A\u6765\u5199\u5165\uFF09
|
|
@@ -184571,7 +184604,7 @@ async function runCli(argv, println = console.log) {
|
|
|
184571
184604
|
const fields = fieldsFromFlags(ownFlagsFromDecl("edit"));
|
|
184572
184605
|
return {
|
|
184573
184606
|
action: "edit",
|
|
184574
|
-
artifactId: needPos(positional, 0, "oasis edit <id> [--title \u2026] [--brief \u2026] [--<\u5B57\u6BB5> <\u503C>] [--set-json <json>] [--clear <\u5B57\u6BB5,\u2026>]\uFF08--<\u5B57\u6BB5> \u662F\u8BE5\u7C7B\u578B\u52A8\u6001\u58F0\u660E\u7684\uFF0C\u7528 oasis
|
|
184607
|
+
artifactId: needPos(positional, 0, "oasis edit <id> [--title \u2026] [--brief \u2026] [--<\u5B57\u6BB5> <\u503C>] [--set-json <json>] [--clear <\u5B57\u6BB5,\u2026>]\uFF08--<\u5B57\u6BB5> \u662F\u8BE5\u7C7B\u578B\u52A8\u6001\u58F0\u660E\u7684\uFF0C\u7528 oasis artifact-types show <\u8BE5\u4EA7\u7269 id> \u770B\u53EF\u586B\u5B57\u6BB5\uFF09"),
|
|
184575
184608
|
...flags.get("title") !== void 0 ? { title: flags.get("title") } : {},
|
|
184576
184609
|
...flags.get("brief") !== void 0 ? { description: flags.get("brief") } : {},
|
|
184577
184610
|
...fields !== void 0 ? { fields } : {}
|
|
@@ -185989,13 +186022,21 @@ ${res.warning}`);
|
|
|
185989
186022
|
break;
|
|
185990
186023
|
}
|
|
185991
186024
|
if (sub === "show") {
|
|
185992
|
-
const
|
|
186025
|
+
const ref2 = needPos(positional, 1, "oasis artifact-types show <type|artifactId>");
|
|
186026
|
+
let name = ref2;
|
|
186027
|
+
let resolvedFrom;
|
|
186028
|
+
if (ref2.startsWith("artifact:")) {
|
|
186029
|
+
const v2 = await api.view("show", ref2);
|
|
186030
|
+
name = v2.artifact.type;
|
|
186031
|
+
resolvedFrom = ref2;
|
|
186032
|
+
}
|
|
185993
186033
|
const { items } = await api.request("GET", "/api/artifact-types");
|
|
185994
186034
|
const t = items.find((x2) => x2.name === name);
|
|
185995
186035
|
if (!t) {
|
|
185996
186036
|
println(`\uFF08\u65E0\u6B64\u7C7B\u578B: ${name}\uFF09`);
|
|
185997
186037
|
break;
|
|
185998
186038
|
}
|
|
186039
|
+
if (resolvedFrom) println(`${resolvedFrom} \u7684\u7C7B\u578B\u662F ${name}\uFF1A`);
|
|
185999
186040
|
println(`${t.name}${t.status === "deprecated" ? " [\u5DF2\u5F03\u7528]" : ""} (${t.contentType}, owner=${t.ownerRole})${t.description ? ` \u2014\u2014 ${t.description}` : ""}`);
|
|
186000
186041
|
const fds = t.fieldDefs ?? [];
|
|
186001
186042
|
println(fds.length === 0 ? " \u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF1A\u65E0" : " \u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF1A");
|
|
@@ -186133,7 +186174,7 @@ function syncRuntimeAssets(candidateRoots, binDir) {
|
|
|
186133
186174
|
}
|
|
186134
186175
|
|
|
186135
186176
|
// src/index.ts
|
|
186136
|
-
var PKG_VERSION = true ? "0.1.
|
|
186177
|
+
var PKG_VERSION = true ? "0.1.87" : "dev";
|
|
186137
186178
|
var OASIS_DIR = path29.join(os9.homedir(), ".oasis");
|
|
186138
186179
|
var CONFIG_FILE = path29.join(OASIS_DIR, "node-config.json");
|
|
186139
186180
|
var PID_FILE = path29.join(OASIS_DIR, "node.pid");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oasis_test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.87",
|
|
4
4
|
"description": "Oasis node daemon + CLI — background daemon, auto-start, full server CLI",
|
|
5
5
|
"bin": {
|
|
6
6
|
"oasis": "./dist/index.js"
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"node": ">=20"
|
|
27
27
|
},
|
|
28
28
|
"oasisRelease": {
|
|
29
|
-
"sourceHead": "
|
|
29
|
+
"sourceHead": "f529e39d68297fc8219978cde48c3441e56764a7"
|
|
30
30
|
}
|
|
31
31
|
}
|