@orkastery/cli 0.2.0
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 +21 -0
- package/README.md +87 -0
- package/adapters/README.md +22 -0
- package/adapters/claude-code/.claude-plugin/marketplace.json +15 -0
- package/adapters/claude-code/.claude-plugin/plugin.json +31 -0
- package/adapters/claude-code/README.md +102 -0
- package/adapters/claude-code/agents/ork-check.md +32 -0
- package/adapters/claude-code/agents/ork-go.md +32 -0
- package/adapters/claude-code/agents/ork-goal.md +33 -0
- package/adapters/claude-code/agents/ork-master.md +32 -0
- package/adapters/claude-code/agents/ork-plan.md +32 -0
- package/adapters/claude-code/agents/ork-ship.md +32 -0
- package/adapters/claude-code/commands/check.md +45 -0
- package/adapters/claude-code/commands/go.md +46 -0
- package/adapters/claude-code/commands/goal.md +54 -0
- package/adapters/claude-code/commands/master.md +42 -0
- package/adapters/claude-code/commands/ork.md +37 -0
- package/adapters/claude-code/commands/plan.md +47 -0
- package/adapters/claude-code/commands/ship.md +45 -0
- package/adapters/claude-code/hooks/hooks.json +17 -0
- package/adapters/claude-code/hooks/ork-guard.js +130 -0
- package/adapters/hermes/README.md +45 -0
- package/adapters/hermes/bin/ork-abrir-thread.sh +25 -0
- package/adapters/hermes/hermes.plugin.json +21 -0
- package/adapters/hermes/skills/orkastery-devmaster/SKILL.md +116 -0
- package/adapters/openclaw/README.md +63 -0
- package/adapters/openclaw/bin/ork-abrir-thread.sh +24 -0
- package/adapters/openclaw/openclaw.plugin.json +138 -0
- package/dist/adapters/claude-bg.js +308 -0
- package/dist/auditoria.js +848 -0
- package/dist/auditrun.js +976 -0
- package/dist/board.js +314 -0
- package/dist/canarios.js +271 -0
- package/dist/catalogo.js +124 -0
- package/dist/ciclos.js +156 -0
- package/dist/claims.js +226 -0
- package/dist/divida.js +374 -0
- package/dist/doctor.js +246 -0
- package/dist/evalrunner.js +458 -0
- package/dist/fix.js +450 -0
- package/dist/gates.js +92 -0
- package/dist/handoff.js +521 -0
- package/dist/hosts.js +331 -0
- package/dist/index.js +1910 -0
- package/dist/init.js +231 -0
- package/dist/leases.js +508 -0
- package/dist/ledger.js +138 -0
- package/dist/manifest.js +255 -0
- package/dist/master.js +453 -0
- package/dist/memoria.js +773 -0
- package/dist/modos.js +220 -0
- package/dist/orkmind.js +487 -0
- package/dist/orquestracao.js +559 -0
- package/dist/phase.js +572 -0
- package/dist/policies.js +176 -0
- package/dist/prompts.js +406 -0
- package/dist/ratelimit.js +179 -0
- package/dist/recall.js +252 -0
- package/dist/retry.js +917 -0
- package/dist/sandbox.js +94 -0
- package/dist/sessoes.js +104 -0
- package/dist/ship.js +551 -0
- package/dist/slug.js +100 -0
- package/dist/superficie.js +1347 -0
- package/dist/thread.js +333 -0
- package/dist/tokens.js +228 -0
- package/dist/types.js +20 -0
- package/dist/util.js +156 -0
- package/dist/verify.js +262 -0
- package/dist/worktree.js +576 -0
- package/dist/yaml.js +112 -0
- package/eval/README.md +85 -0
- package/eval/casos/check-quality.json +103 -0
- package/eval/casos/code-reviewer.json +102 -0
- package/eval/casos/decision-triage.json +103 -0
- package/eval/casos/go-implementation.json +103 -0
- package/eval/casos/goal-definition.json +103 -0
- package/eval/casos/master-metrics.json +103 -0
- package/eval/casos/narrative-guardian.json +163 -0
- package/eval/casos/orkastery-bootstrap.json +102 -0
- package/eval/casos/plan-specification.json +102 -0
- package/eval/casos/roadmap-keeper.json +103 -0
- package/eval/casos/scope-check-capability-map.json +83 -0
- package/eval/casos/security-auditor.json +102 -0
- package/eval/casos/ship-release.json +122 -0
- package/eval/casos/test-engineer.json +122 -0
- package/eval/casos/thread-state.json +82 -0
- package/eval/casos/thread-tracing.json +83 -0
- package/eval/casos/web-performance-auditor.json +102 -0
- package/eval/fixtures/b0-slug-e-modos/caso.json +56 -0
- package/eval/fixtures/b2-master-log/caso.json +91 -0
- package/eval/fixtures/fx-concurrency/caso.json +15 -0
- package/eval/fixtures/fx-hallucination/caso.json +12 -0
- package/eval/fixtures/fx-happy/caso.json +16 -0
- package/eval/fixtures/fx-schema-drift/caso.json +15 -0
- package/eval/fixtures/fx-stale-base/caso.json +12 -0
- package/eval/fixtures/fx-wiki-destroy/caso.json +16 -0
- package/eval/fixtures/superficie-de-rede/README.md +22 -0
- package/eval/fixtures/superficie-de-rede/api-express.js +30 -0
- package/eval/fixtures/superficie-de-rede/api_fastapi.py +17 -0
- package/eval/fixtures/superficie-de-rede/api_gin.go +18 -0
- package/package.json +56 -0
- package/references/README.md +25 -0
- package/references/code-review-axes.md +82 -0
- package/references/definition-of-done.md +74 -0
- package/references/performance-checklist.md +53 -0
- package/references/security-checklist.md +101 -0
- package/references/testing-patterns.md +51 -0
- package/skills/README.md +43 -0
- package/skills/core/orkastery-bootstrap/SKILL.md +89 -0
- package/skills/core/thread-state/SKILL.md +86 -0
- package/skills/governance/decision-triage/SKILL.md +65 -0
- package/skills/governance/narrative-guardian/SKILL.md +66 -0
- package/skills/governance/roadmap-keeper/SKILL.md +60 -0
- package/skills/governance/scope-check-capability-map/SKILL.md +61 -0
- package/skills/observability/thread-tracing/SKILL.md +63 -0
- package/skills/phases/check-quality/SKILL.md +87 -0
- package/skills/phases/go-implementation/SKILL.md +70 -0
- package/skills/phases/goal-definition/SKILL.md +69 -0
- package/skills/phases/master-metrics/SKILL.md +65 -0
- package/skills/phases/plan-specification/SKILL.md +67 -0
- package/skills/phases/ship-release/SKILL.md +68 -0
- package/skills/reviewers/code-reviewer/SKILL.md +61 -0
- package/skills/reviewers/security-auditor/SKILL.md +68 -0
- package/skills/reviewers/test-engineer/SKILL.md +66 -0
- package/skills/reviewers/web-performance-auditor/SKILL.md +63 -0
package/dist/sandbox.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sandbox deterministica para os canarios de `ork eval` (bloco B4).
|
|
4
|
+
*
|
|
5
|
+
* Um canario precisa exercitar o comportamento REAL do nucleo: git de verdade, worktree de
|
|
6
|
+
* verdade, lease de verdade. Fazer isso no repositorio do usuario seria inaceitavel, e
|
|
7
|
+
* simular git com dublê seria testar o dublê. A saida e um repositorio git temporario,
|
|
8
|
+
* criado, usado e apagado dentro da mesma execucao.
|
|
9
|
+
*
|
|
10
|
+
* Regras que esta sandbox respeita, e por isso ela pode rodar em `ork eval` na maquina de
|
|
11
|
+
* qualquer builder: nada de rede, nada de credencial, nada fora de um diretorio temporario,
|
|
12
|
+
* e limpeza garantida mesmo quando o canario falha.
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.gitDisponivel = gitDisponivel;
|
|
49
|
+
exports.dirTemporario = dirTemporario;
|
|
50
|
+
exports.commitar = commitar;
|
|
51
|
+
exports.sandboxGit = sandboxGit;
|
|
52
|
+
const fs = __importStar(require("node:fs"));
|
|
53
|
+
const os = __importStar(require("node:os"));
|
|
54
|
+
const path = __importStar(require("node:path"));
|
|
55
|
+
const init_1 = require("./init");
|
|
56
|
+
const manifest_1 = require("./manifest");
|
|
57
|
+
const util_1 = require("./util");
|
|
58
|
+
/** `git` existe nesta maquina? Sem ele os canarios saem `unavailable`, nunca `passing`. */
|
|
59
|
+
function gitDisponivel() {
|
|
60
|
+
return (0, util_1.noPath)('git') !== null;
|
|
61
|
+
}
|
|
62
|
+
/** Diretorio temporario com caminho real (o /tmp de linux e macOS usa symlink). */
|
|
63
|
+
function dirTemporario(nome) {
|
|
64
|
+
return fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), `ork-eval-${nome}-`)));
|
|
65
|
+
}
|
|
66
|
+
/** Commita um arquivo no repositorio informado e devolve o sha do commit. */
|
|
67
|
+
function commitar(dir, arquivo, conteudo, mensagem) {
|
|
68
|
+
const destino = path.join(dir, arquivo);
|
|
69
|
+
fs.mkdirSync(path.dirname(destino), { recursive: true });
|
|
70
|
+
fs.writeFileSync(destino, conteudo, 'utf8');
|
|
71
|
+
(0, util_1.exec)('git', ['add', '--', arquivo], dir);
|
|
72
|
+
(0, util_1.exec)('git', ['commit', '-m', mensagem], dir);
|
|
73
|
+
return (0, util_1.exec)('git', ['rev-parse', 'HEAD'], dir).stdout.trim();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Repositorio git temporario com manifesto gerado pelo proprio `ork init`.
|
|
77
|
+
*
|
|
78
|
+
* O manifesto vem do `init` de verdade e nao de um objeto escrito a mao: canario que monta o
|
|
79
|
+
* proprio manifesto testa o canario, nao o produto.
|
|
80
|
+
*/
|
|
81
|
+
function sandboxGit(nome, abbrev = 'evl') {
|
|
82
|
+
const dir = dirTemporario(nome);
|
|
83
|
+
(0, util_1.exec)('git', ['init', '-b', 'main'], dir);
|
|
84
|
+
(0, util_1.exec)('git', ['config', 'user.email', 'eval@orkastery.local'], dir);
|
|
85
|
+
(0, util_1.exec)('git', ['config', 'user.name', 'Canario do ork eval'], dir);
|
|
86
|
+
(0, util_1.exec)('git', ['config', 'commit.gpgsign', 'false'], dir);
|
|
87
|
+
commitar(dir, 'README.md', '# projeto do canario\n', 'inicial');
|
|
88
|
+
(0, init_1.init)(dir, { nome: 'canario', abbrev });
|
|
89
|
+
return {
|
|
90
|
+
dir,
|
|
91
|
+
carregado: (0, manifest_1.exigirManifesto)(dir),
|
|
92
|
+
limpar: () => fs.rmSync(dir, { recursive: true, force: true }),
|
|
93
|
+
};
|
|
94
|
+
}
|
package/dist/sessoes.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `ork sessions`: observabilidade real das sessoes despachadas.
|
|
4
|
+
*
|
|
5
|
+
* A fonte da verdade e o runtime (`claude agents --json`), nunca o `thread.json`.
|
|
6
|
+
* O `ork` cruza as duas visoes e denuncia divergencia em vez de repetir o self-report.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.tabelaDeSessoes = tabelaDeSessoes;
|
|
43
|
+
exports.logsDaSessao = logsDaSessao;
|
|
44
|
+
exports.pararSessao = pararSessao;
|
|
45
|
+
exports.comandoDeAttach = comandoDeAttach;
|
|
46
|
+
const adapter = __importStar(require("./adapters/claude-bg"));
|
|
47
|
+
const thread_1 = require("./thread");
|
|
48
|
+
const util_1 = require("./util");
|
|
49
|
+
/** Tabela das sessoes vivas, cruzada com as sessoes registradas nas threads. */
|
|
50
|
+
function tabelaDeSessoes(raiz, todas = false) {
|
|
51
|
+
const vivas = adapter.listarSessoes(raiz, todas);
|
|
52
|
+
const registradas = new Map();
|
|
53
|
+
for (const id of (0, thread_1.listarIds)(raiz)) {
|
|
54
|
+
const t = (0, thread_1.lerThread)(raiz, id);
|
|
55
|
+
for (const s of t.sessoes) {
|
|
56
|
+
registradas.set(s.sessionId, { thread: t.id, slug: s.slug, fase: s.fase });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const linhas = [];
|
|
60
|
+
const dados = vivas.map((s) => {
|
|
61
|
+
const reg = registradas.get(s.sessionId);
|
|
62
|
+
return [
|
|
63
|
+
(s.id ?? s.sessionId).slice(0, 8),
|
|
64
|
+
s.name ?? '(sem nome)',
|
|
65
|
+
s.kind ?? '?',
|
|
66
|
+
s.state ?? s.status ?? '?',
|
|
67
|
+
reg ? `${reg.thread}/${reg.fase}` : '(fora do ork)',
|
|
68
|
+
];
|
|
69
|
+
});
|
|
70
|
+
linhas.push(dados.length === 0
|
|
71
|
+
? 'Nenhuma sessao ativa sob a raiz do projeto.'
|
|
72
|
+
: (0, util_1.tabela)(['ID', 'NOME', 'TIPO', 'ESTADO', 'THREAD/FASE'], dados));
|
|
73
|
+
const idsVivos = new Set(vivas.map((s) => s.sessionId));
|
|
74
|
+
const sumidas = [...registradas.entries()].filter(([id]) => !idsVivos.has(id));
|
|
75
|
+
if (sumidas.length > 0) {
|
|
76
|
+
linhas.push('');
|
|
77
|
+
linhas.push('Sessoes registradas na thread que nao aparecem no runtime agora:');
|
|
78
|
+
for (const [id, reg] of sumidas) {
|
|
79
|
+
linhas.push(` ${id.slice(0, 8)} ${reg.slug} ${reg.thread}/${reg.fase}`);
|
|
80
|
+
}
|
|
81
|
+
linhas.push(' (use --all para incluir sessoes ja concluidas)');
|
|
82
|
+
}
|
|
83
|
+
return linhas.join('\n');
|
|
84
|
+
}
|
|
85
|
+
/** Logs de uma sessao pelo id curto, id completo ou nome. */
|
|
86
|
+
function logsDaSessao(chave, linhas) {
|
|
87
|
+
const r = adapter.logs(chave, linhas);
|
|
88
|
+
return { texto: r.texto, codigo: r.ok ? 0 : 1 };
|
|
89
|
+
}
|
|
90
|
+
/** Para uma sessao pelo id curto, id completo ou nome. */
|
|
91
|
+
function pararSessao(chave) {
|
|
92
|
+
const s = adapter.acharSessao(chave);
|
|
93
|
+
if (!s)
|
|
94
|
+
return { texto: `sessao "${chave}" nao encontrada no runtime`, codigo: 1 };
|
|
95
|
+
const r = adapter.parar(s.id ?? s.sessionId);
|
|
96
|
+
return { texto: r.texto || `sessao ${s.sessionId} parada`, codigo: r.ok ? 0 : 1 };
|
|
97
|
+
}
|
|
98
|
+
/** Comando de attach (precisa de TTY, entao o CLI imprime em vez de executar). */
|
|
99
|
+
function comandoDeAttach(chave) {
|
|
100
|
+
const s = adapter.acharSessao(chave);
|
|
101
|
+
if (!s)
|
|
102
|
+
return { texto: `sessao "${chave}" nao encontrada no runtime`, codigo: 1 };
|
|
103
|
+
return { texto: adapter.comandoAttach(s.sessionId), codigo: 0 };
|
|
104
|
+
}
|