hanoman 0.1.19 → 0.1.21

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.19",
3
- "sha": "070dac2",
4
- "builtAt": "2026-08-03T19:06:22.703Z"
2
+ "version": "0.1.21",
3
+ "sha": "562be62",
4
+ "builtAt": "2026-08-06T03:02:28.882Z"
5
5
  }
package/dist/cli.js CHANGED
@@ -63,6 +63,25 @@ var init_verify_scope = __esm({
63
63
  }
64
64
  });
65
65
 
66
+ // ../runner/src/code-style.ts
67
+ var CODE_STYLE_CLAUSE;
68
+ var init_code_style = __esm({
69
+ "../runner/src/code-style.ts"() {
70
+ "use strict";
71
+ CODE_STYLE_CLAUSE = [
72
+ "Gaya kode \u2014 berlaku setiap kali kamu menulis atau mengubah kode:",
73
+ "- Tulis kode yang rapi dan mengikuti idiom, penamaan, serta struktur kode di sekitarnya.",
74
+ " Kodemu harus terbaca seperti kode yang sudah ada di berkas itu, bukan seperti tempelan.",
75
+ "- Jangan menulis komentar yang cuma mengulang apa yang sudah dinyatakan kode.",
76
+ "- Komentar hanya untuk hal yang TIDAK terbaca dari kode: alasan/why sebuah keputusan,",
77
+ " trade-off yang diambil, workaround beserta rujukan SPEC/ADR-nya, atau invariant yang tak",
78
+ " kelihatan. Komentar semacam itu justru berharga \u2014 jangan ikut dibuang.",
79
+ "- Jangan menambahkan komentar pembatas seksi, header berhiasan, atau narasi langkah demi langkah.",
80
+ "- Jangan meninggalkan kode mati atau kode yang dikomentari. Hapus saja; riwayat git yang menyimpannya."
81
+ ].join("\n");
82
+ }
83
+ });
84
+
66
85
  // ../runner/src/goal-spec.ts
67
86
  var init_goal_spec = __esm({
68
87
  "../runner/src/goal-spec.ts"() {
@@ -77,6 +96,7 @@ var init_prompt = __esm({
77
96
  "use strict";
78
97
  init_reverse_standard();
79
98
  init_verify_scope();
99
+ init_code_style();
80
100
  init_goal_spec();
81
101
  ESCALATION_CONTRACT = [
82
102
  "REKOMENDASI ESKALASI (wajib, terbaca mesin). Di bagian akhir dokumen audit, tulis bagian",
@@ -4281,6 +4301,24 @@ var init_enums = __esm({
4281
4301
  }
4282
4302
  });
4283
4303
 
4304
+ // ../shared/src/spec-source.ts
4305
+ function payloadShapeFor(source) {
4306
+ return source === "qa" ? "qa" : source === "goal" ? "goal" : "brief";
4307
+ }
4308
+ function shapeOfPayload(payload) {
4309
+ const p = payload ?? {};
4310
+ return "severity" in p ? "qa" : "goal" in p ? "goal" : "brief";
4311
+ }
4312
+ function payloadMatchesSource(source, payload) {
4313
+ return shapeOfPayload(payload) === payloadShapeFor(source);
4314
+ }
4315
+ var init_spec_source = __esm({
4316
+ "../shared/src/spec-source.ts"() {
4317
+ "use strict";
4318
+ init_enums();
4319
+ }
4320
+ });
4321
+
4284
4322
  // ../shared/src/agent-engine.ts
4285
4323
  var zAgentEngine;
4286
4324
  var init_agent_engine = __esm({
@@ -4418,7 +4456,7 @@ var init_auto_merge = __esm({
4418
4456
  });
4419
4457
 
4420
4458
  // ../shared/src/entities.ts
4421
- var zProject, zBriefPayload, zQaPayload, zGoalPayload, zSpecBlocker, zSpec, NOTIFY_SOUNDS, zCodex, CODEX_DEFAULTS, zSourceCommon, zScheduler, SCHEDULER_DEFAULTS, zGoal, GOAL_DEFAULTS, zConflict, CONFLICT_DEFAULTS, CHANGELOG_ENGINE_DEFAULTS, zLeadEngine, zLead, LEAD_DEFAULTS, zSetting, zNotification, zDocFile, zDeviceTokenView;
4459
+ var zProject, zBriefPayload, zQaPayload, zGoalPayload, zSpecBlocker, zSourceChange, zSpec, NOTIFY_SOUNDS, zCodex, CODEX_DEFAULTS, zSourceCommon, zScheduler, SCHEDULER_DEFAULTS, zGoal, GOAL_DEFAULTS, zConflict, CONFLICT_DEFAULTS, CHANGELOG_ENGINE_DEFAULTS, zLeadEngine, zLead, LEAD_DEFAULTS, zSetting, zNotification, zDocFile, zDeviceTokenView;
4422
4460
  var init_entities = __esm({
4423
4461
  "../shared/src/entities.ts"() {
4424
4462
  "use strict";
@@ -4468,6 +4506,13 @@ var init_entities = __esm({
4468
4506
  id: external_exports.string(),
4469
4507
  reason: external_exports.enum(["missing", "unfinished", "unmerged"])
4470
4508
  });
4509
+ zSourceChange = external_exports.object({
4510
+ at: external_exports.string(),
4511
+ from: external_exports.string(),
4512
+ to: external_exports.string(),
4513
+ by: external_exports.string(),
4514
+ payload: external_exports.unknown().optional()
4515
+ });
4471
4516
  zSpec = external_exports.object({
4472
4517
  id: external_exports.string(),
4473
4518
  projectId: external_exports.string(),
@@ -4495,7 +4540,11 @@ var init_entities = __esm({
4495
4540
  blockedBy: external_exports.array(zSpecBlocker).default([]),
4496
4541
  // SPEC-486 · ADR-0103 · override kebijakan auto-merge item ini; null = warisi project.
4497
4542
  // `.nullable().default(null)` menjaga respons/klien versi lama tetap parse.
4498
- autoMerge: zAutoMerge.nullable().default(null)
4543
+ autoMerge: zAutoMerge.nullable().default(null),
4544
+ // SPEC-546 · ADR-0109 · jejak konversi type. `.default([])` menjaga respons/klien versi lama
4545
+ // tetap parse; kolom DB-nya `Json?` sehingga baris yang belum pernah dikonversi mengirim
4546
+ // `null` — pemakai UI menulis `spec.sourceHistory ?? []`, cermin `blockedBy`.
4547
+ sourceHistory: external_exports.array(zSourceChange).default([])
4499
4548
  });
4500
4549
  NOTIFY_SOUNDS = [
4501
4550
  "off",
@@ -4937,7 +4986,7 @@ var init_prd_status = __esm({
4937
4986
  });
4938
4987
 
4939
4988
  // ../shared/src/dto.ts
4940
- var zIssueDeviceToken, zSessionResult, zSessionHistory, zCreateProject, zProjectId, zRenameProject, zUpdateProject, zCreateSpec, zPatchSpec, zIntegrate, zSessionSummary, zProjectView, zSchedulerQueueItem, zSchedulerSourceView, zSchedulerSessionView, zSchedulerQueueCounts, zSchedulerState, zLeadDecisionView, zLeadFlowView, zLeadAnswer, zLeadProjectStatus, zLeadStatusView, zFlow, zPrdBrief, zPrdDoc, zBreakdownItem, zBreakdownDoc, zBatchCreateSpec, zEscalationTarget, zEscalationPrefill, zAuditEscalation, zAuditEscalationView, zTerminalSession, zDocFileContent, zDocIndexCat, zDocIndex, HOST_RE, USER_RE, zCreateVps, zPatchVps, zLogin, zSignup, zChangePassword, zVpsCheck, zMarkNa, zMarkNaBulk, zAttest, zRemediate, UPDATE_RESTART_EXIT, zUpdateApplyBody, zTicketView, zTicketAttachmentView, zTicketDetail, zTicketEditInput, zHelpInfo, zPublicTicketStatus;
4989
+ var zIssueDeviceToken, zSessionResult, zSessionHistory, zCreateProject, zProjectId, zRenameProject, zUpdateProject, zCreateSpec, zPatchSpec, zChangeSpecSource, zIntegrate, zSessionSummary, zProjectView, zSchedulerQueueItem, zSchedulerSourceView, zSchedulerSessionView, zSchedulerQueueCounts, zSchedulerState, zLeadDecisionView, zLeadFlowView, zLeadAnswer, zLeadProjectStatus, zLeadStatusView, zFlow, zPrdBrief, zPrdDoc, zBreakdownItem, zBreakdownDoc, zBatchCreateSpec, zEscalationTarget, zEscalationPrefill, zAuditEscalation, zAuditEscalationView, zTerminalSession, zDocFileContent, zDocIndexCat, zDocIndex, HOST_RE, USER_RE, zCreateVps, zPatchVps, zLogin, zSignup, zChangePassword, zVpsCheck, zMarkNa, zMarkNaBulk, zAttest, zRemediate, UPDATE_RESTART_EXIT, zUpdateApplyBody, zTicketView, zTicketAttachmentView, zTicketDetail, zTicketEditInput, zHelpInfo, zPublicTicketStatus;
4941
4990
  var init_dto = __esm({
4942
4991
  "../shared/src/dto.ts"() {
4943
4992
  "use strict";
@@ -4947,6 +4996,7 @@ var init_dto = __esm({
4947
4996
  init_auto_merge();
4948
4997
  init_prd_status();
4949
4998
  init_enums();
4999
+ init_spec_source();
4950
5000
  zIssueDeviceToken = external_exports.object({ name: external_exports.string().min(1) });
4951
5001
  zSessionResult = external_exports.object({
4952
5002
  id: external_exports.string(),
@@ -5014,9 +5064,7 @@ var init_dto = __esm({
5014
5064
  // SPEC-447 · ADR-0093 · divalidasi server (id ada / satu project / bukan diri sendiri / non-siklus).
5015
5065
  dependsOn: external_exports.array(external_exports.string()).optional()
5016
5066
  }).superRefine((o, ctx) => {
5017
- const shape = "severity" in o.payload ? "qa" : "goal" in o.payload ? "goal" : "brief";
5018
- const want = o.source === "qa" ? "qa" : o.source === "goal" ? "goal" : "brief";
5019
- if (shape !== want)
5067
+ if (!payloadMatchesSource(o.source, o.payload))
5020
5068
  ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["payload"], message: "bentuk payload tak cocok dengan source" });
5021
5069
  });
5022
5070
  zPatchSpec = external_exports.object({
@@ -5037,6 +5085,13 @@ var init_dto = __esm({
5037
5085
  // apa yang terjadi SESUDAH kerja, bukan konten yang sedang dikerjakan sesi hidup.
5038
5086
  autoMerge: zAutoMerge.nullable().optional()
5039
5087
  });
5088
+ zChangeSpecSource = external_exports.object({
5089
+ source: zSpecSource,
5090
+ payload: external_exports.union([zBriefPayload, zQaPayload, zGoalPayload]).optional()
5091
+ }).superRefine((o, ctx) => {
5092
+ if (o.payload !== void 0 && !payloadMatchesSource(o.source, o.payload))
5093
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["payload"], message: "bentuk payload tak cocok dengan source" });
5094
+ });
5040
5095
  zIntegrate = external_exports.object({
5041
5096
  op: external_exports.enum(["merge", "rebase"]),
5042
5097
  target: external_exports.string().regex(/^(local|origin):.+/)
@@ -5434,6 +5489,8 @@ var init_api = __esm({
5434
5489
  // SPEC-340 · ADR-0076 · rekomendasi tindak lanjut audit (turunan blok json dokumen audit).
5435
5490
  specEscalation: (id) => `${API}/specs/${id}/escalation`,
5436
5491
  specIntegrate: (id) => `${API}/specs/${id}/integrate`,
5492
+ // SPEC-546 · ADR-0109 · ubah type/source item in-place (operasi khusus, bukan field PATCH).
5493
+ specSource: (id) => `${API}/specs/${id}/source`,
5437
5494
  specReview: (id) => `${API}/specs/${id}/review`,
5438
5495
  specReviewFile: (id, path) => `${API}/specs/${id}/review/${path}`,
5439
5496
  settings: `${API}/settings`,
@@ -5989,6 +6046,14 @@ var init_webhook = __esm({
5989
6046
  label: "Stage backlog berpindah",
5990
6047
  changed: ["stage"],
5991
6048
  when: "Stage berpindah \u2014 baik oleh fase sesi yang tercatat (otomatis) maupun revert manual operator. Menggantikan spec.updated untuk perubahan itu."
6049
+ }, {
6050
+ // SPEC-546 · ADR-0109 · konversi type item. Pola yang sama dengan stage_changed: peristiwa
6051
+ // turunan MENGGANTIKAN spec.updated, supaya penerima bisa bereaksi pada "type berpindah"
6052
+ // tanpa mendiff dua amplop.
6053
+ type: "spec.source_changed",
6054
+ label: "Type backlog berpindah",
6055
+ changed: ["source"],
6056
+ when: "Type/source item backlog dikonversi lewat POST /specs/:id/source (mis. brief \u2192 qa). Menggantikan spec.updated untuk perubahan itu."
5992
6057
  }],
5993
6058
  sample: {
5994
6059
  id: "SPEC-481",
@@ -6945,6 +7010,7 @@ var init_src = __esm({
6945
7010
  "../shared/src/index.ts"() {
6946
7011
  "use strict";
6947
7012
  init_enums();
7013
+ init_spec_source();
6948
7014
  init_agent_engine();
6949
7015
  init_entities();
6950
7016
  init_agent();
@@ -6974,6 +7040,7 @@ var init_custom_agents = __esm({
6974
7040
  "../runner/src/custom-agents.ts"() {
6975
7041
  "use strict";
6976
7042
  init_src();
7043
+ init_code_style();
6977
7044
  }
6978
7045
  });
6979
7046
 
@@ -7056,6 +7123,7 @@ var init_src2 = __esm({
7056
7123
  init_agent_cli();
7057
7124
  init_custom_agents();
7058
7125
  init_verify_scope();
7126
+ init_code_style();
7059
7127
  init_paths();
7060
7128
  init_telegram_operator();
7061
7129
  }