refactor(workflow): delete the bootstrap smoke-test workflow and its intake kind

This commit is contained in:
sam committed 2026-10-04 23:41:52 +11:00
1 parent 71b00907c5
commit 9b0a4c75ae
9 files changed
+19 -57

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@
# database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
# skills_dir = "~/.local/share/archie/skills" # SKILL.md search path; defaults under work_dir when unset
# workflow_routing_file = "~/.local/share/archie/workflow-routing.yaml" # kind->workflow rebinding (bug/feature/bootstrap)
# workflow_routing_file = "~/.local/share/archie/workflow-routing.yaml" # kind->workflow rebinding (bug/feature)
# workflow_labels_file = "~/.local/share/archie/workflow-labels.yaml" # arbitrary forge label -> workflow (EDA playbook slice 2)
# playbook_dirs = ["~/.local/share/archie/workflows"] # list of dirs of *.yaml binding files, merged with the two above (slice 3); a key bound twice across sources is a load failure
+2 -2
View File
@@ -360,10 +360,10 @@ type Config struct {
// override built-ins, and Kits mount it read-only.
SkillsDir string `toml:"skills_dir" yaml:"skills_dir"`
// WorkflowRoutingFile is an optional path to a YAML file rebinding which
// registered workflow an intake Kind (bug/feature/bootstrap) prefers.
// registered workflow an intake Kind (bug/feature) prefers.
WorkflowRoutingFile string `toml:"workflow_routing_file" yaml:"workflow_routing_file"`
// WorkflowLabelsFile is an optional path to a YAML file binding forge issue
// labels outside the closed bug/feature/bootstrap kind set to registered
// labels outside the closed bug/feature kind set to registered
// workflows (e.g. A label already owned by the kind set, or a duplicate
// binding, is a load failure per the design doc's collision rule.
WorkflowLabelsFile string `toml:"workflow_labels_file" yaml:"workflow_labels_file"`
+1 -1
View File
@@ -62,7 +62,7 @@ type Playbook struct {
// existing workintake label/kind vocabulary -- no second label-matching
// mechanism is invented here.
type Trigger struct {
// Kind is the routing kind (bug/feature/bootstrap); empty matches the
// Kind is the routing kind (bug/feature); empty matches the
// default (unlabelled) flow.
Kind workintake.Kind
// Labels is the closed label set this trigger matches; an empty set
+1 -1
View File
@@ -250,7 +250,7 @@ func sortedInputNames(inputs map[string]task.InputSpec) []string {
func legacyBuiltinWorkflows() Registry {
return Registry{
"bootstrap": Bootstrap(), "implement": Implement(), "tdd": TDD(),
"implement": Implement(), "tdd": TDD(),
"feasibility": Feasibility(), "triage": Triage(), "remediate": Remediate(),
"pr-review": PRReview(),
}
+3 -4
View File
@@ -20,9 +20,8 @@ type KindWorkflows map[workintake.Kind]string
// defaultKindWorkflows maps each intake kind to its default workflow.
var defaultKindWorkflows = KindWorkflows{
workintake.KindBug: "tdd",
workintake.KindFeature: "feasibility",
workintake.KindBootstrap: "bootstrap",
workintake.KindBug: "tdd",
workintake.KindFeature: "feasibility",
}
// activeKindWorkflows overrides defaultKindWorkflows. Set once at startup by
@@ -206,7 +205,7 @@ func MergeLabelWorkflows(base, extra LabelWorkflows) (LabelWorkflows, error) {
func workflowForLabels(reg Registry, labels string) (Workflow, bool) {
// Arbitrary-label bindings first: a playbook-declared label is an
// explicit, load-time-error-checked signal, so it wins over the kind
// defaults (which cover only bug/feature/bootstrap).
// defaults (which cover only bug/feature).
if lb := activeLabelWorkflows; lb != nil {
for _, label := range workintake.SplitLabels(labels) {
name, ok := lb[label]
-32
View File
@@ -3,9 +3,6 @@ package workflow
import (
"context"
"fmt"
"os"
"path/filepath"
"time"
"github.com/samcharles93/archie-core/internal/domain/workflow/task"
"github.com/samcharles93/archie-core/internal/events"
@@ -261,32 +258,3 @@ func commitIssueReference(verb string, task *Task) string {
}
return fmt.Sprintf("\n\n%s #%d", verb, task.IssueNumber)
}
// Bootstrap is the deterministic no-LLM workflow that proves the
// plumbing: it adds a marker file and opens a PR referencing the issue.
// It stays registered as a diagnostics workflow (label a test issue and
// you exercise invites, clone, push, and PR mechanics end to end).
func Bootstrap() Workflow {
return Workflow{
Name: "bootstrap",
Stages: []Stage{
StagePrepareWorktree(),
{Name: "apply", Run: func(ctx context.Context, tc *TaskContext) error {
dir := filepath.Join(tc.Dir, ".archie")
if err := os.MkdirAll(dir, 0o755); err != nil {
return err
}
content := fmt.Sprintf("# archie bootstrap\n\n%s\nTime: %s\n\nThis file proves the archie pipeline (queue → worktree → push → PR) works for this repository.\n",
taskPromptBlock(tc.Task), time.Now().UTC().Format(time.RFC3339))
return os.WriteFile(filepath.Join(dir, "bootstrap.md"), []byte(content), 0o644)
}},
StageCommitPush(func(tc *TaskContext) string {
return "chore: archie bootstrap marker" + commitIssueReference("Refs", tc.Task)
}),
StageDiffCap(),
StageOpenPR(func(tc *TaskContext) string {
return "Deterministic bootstrap PR from archie's plumbing walk-through."
}),
},
}
}
+10 -14
View File
@@ -9,10 +9,9 @@ import (
// Task subjects. Each encodes the routing kind so a multi-daemon deployment
// can filter by the work it wants.
const (
SubjectTaskBug = "archie.task.bug"
SubjectTaskFeature = "archie.task.feature"
SubjectTaskBootstrap = "archie.task.bootstrap"
SubjectTaskDefault = "archie.task.default"
SubjectTaskBug = "archie.task.bug"
SubjectTaskFeature = "archie.task.feature"
SubjectTaskDefault = "archie.task.default"
// SubjectTaskWildcard matches every task subject.
SubjectTaskWildcard = "archie.task.>"
@@ -29,9 +28,8 @@ var ErrUnknownKind = errors.New("workintake: unknown task kind")
type Kind string
const (
KindBug Kind = "bug"
KindFeature Kind = "feature"
KindBootstrap Kind = "bootstrap"
KindBug Kind = "bug"
KindFeature Kind = "feature"
// KindDefault routes issues carrying no recognised label.
KindDefault Kind = "default"
@@ -40,17 +38,15 @@ const (
// labelKinds maps a forge issue label to its routing kind. This is the one
// place the label vocabulary is defined.
var labelKinds = map[string]Kind{
"bug": KindBug,
"feature": KindFeature,
"bootstrap": KindBootstrap,
"bug": KindBug,
"feature": KindFeature,
}
// kindSubjects is the closed set of routable kinds.
var kindSubjects = map[Kind]string{
KindBug: SubjectTaskBug,
KindFeature: SubjectTaskFeature,
KindBootstrap: SubjectTaskBootstrap,
KindDefault: SubjectTaskDefault,
KindBug: SubjectTaskBug,
KindFeature: SubjectTaskFeature,
KindDefault: SubjectTaskDefault,
}
// Validate reports whether the kind is routable. The zero kind is accepted
+1 -1
View File
@@ -18,7 +18,7 @@ Defaulting to \`null\`.`),null)}function zS(e){return LS(e)&&!Number.isNaN(e)&&e
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=qE(c),u=e+1<n.length?qE(n[e+1]):null;if(l&&u&&JE(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=qE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>GE(e)),rows:r.map(e=>e.map(e=>GE(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:GE(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:GE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function qE(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function JE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var YE={class:`[overflow-wrap:anywhere]`},XE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},ZE={class:`font-mono text-[0.85em]`},QE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},$E={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},eD={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},tD={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},nD={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},rD={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},iD={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},aD={key:8,class:`mb-2.5 last:mb-0`},oD=M({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=G(()=>KE(t.text));return(e,t)=>(L(),R(`div`,YE,[(L(!0),R(I,null,P(n.value,(e,t)=>(L(),R(I,{key:t},[e.kind===`pre`?(L(),R(`pre`,XE,[B(`code`,ZE,D(e.code),1)])):e.kind===`table`?(L(),R(`table`,QE,[B(`thead`,null,[B(`tr`,null,[(L(!0),R(I,null,P(e.head,(e,t)=>(L(),R(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[V(UE,{inline:e},null,8,[`inline`])]))),128))])]),B(`tbody`,null,[(L(!0),R(I,null,P(e.rows,(e,t)=>(L(),R(`tr`,{key:t},[(L(!0),R(I,null,P(e,(e,t)=>(L(),R(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[V(UE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(L(),R(`blockquote`,$E,[V(UE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(L(),R(`h1`,eD,[V(UE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(L(),R(`h2`,tD,[V(UE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(L(),R(`h3`,nD,[V(UE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(L(),R(`ul`,rD,[(L(!0),R(I,null,P(e.items,(e,t)=>(L(),R(`li`,{key:t},[V(UE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(L(),R(`ol`,iD,[(L(!0),R(I,null,P(e.items,(e,t)=>(L(),R(`li`,{key:t},[V(UE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(L(),R(`p`,aD,[V(UE,{inline:e.inline},null,8,[`inline`])])):U(``,!0)],64))),128))]))}}),sD={class:`truncate`},cD=M({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=pa(`RouterLink`);return L(),z(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:A(()=>[V(k(yd),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),B(`span`,sD,D(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),lD={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},uD={class:`font-semibold text-foreground`},dD={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},fD=M({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=G(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=G(()=>t.tool.parameters||t.tool.Parameters||``),i=G(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=G(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(L(),z(cD,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(L(),R(`div`,lD,[V(k(of),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),B(`span`,uD,D(n.value),1),r.value?(L(),R(`code`,dD,D(r.value),1)):U(``,!0),B(`span`,{class:E(k(K)(`text-fg-muted`,i.value&&`text-danger`))},D(a.value),3)]))}}),pD={key:0,class:`mb-2 grid gap-0.5 text-xs`},mD={key:1,class:`mb-2 flex flex-wrap gap-1.5`},hD={key:3,class:`whitespace-pre-wrap`},gD=M({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(L(),R(`div`,{class:E([`flex`,e.assistant?`justify-start`:`justify-end`])},[B(`div`,{class:E(k(K)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(L(),R(`div`,pD,[(L(!0),R(I,null,P(e.tools,(t,n)=>(L(),z(fD,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):U(``,!0),e.media.length?(L(),R(`div`,mD,[(L(!0),R(I,null,P(e.media,(e,t)=>(L(),z(IE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):U(``,!0),e.assistant?(L(),z(oD,{key:2,text:e.text},null,8,[`text`])):(L(),R(`div`,hD,D(e.text),1)),F(t.$slots,`default`)],2)],2))}}),_D={class:`w-full self-center justify-self-center py-6 text-center`},vD={class:`grid gap-2`},yD=[`onClick`],bD=M({__name:`ChatEmptyState`,emits:[`proLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>HM?`${n.slice(0,HM).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var WM=[`title`],GM=M({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>gM(n.event)),a=G(()=>UM(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=G(()=>n.event.at?wj(n.event.at):`—`);return(e,t)=>(L(),z(k(BM),{class:E(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[uu(cu(o,[`prevent`]),[`enter`]),uu(cu(o,[`prevent`]),[`space`])]},{default:A(()=>[V(k(Q),{class:`font-medium`},{default:A(()=>[H(D(n.event.kind||n.event.type||`event`),1)]),_:1}),V(k(Q),{class:`font-mono`},{default:A(()=>[H(D(i.value>0?`#${i.value}`:`—`),1)]),_:1}),V(k(Q),{class:`w-[55%] max-w-0`},{default:A(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},D(a.value.text),9,WM)]),_:1}),V(k(Q),null,{default:A(()=>[H(D(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),KM=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function qM(e){return(Number(e?.task_id)||0)>0}function JM(e,t){return t===`tasks`?qM(e):t!==`system`||!qM(e)}function YM(e,t){return e.filter(e=>JM(e,t))}function XM(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function ZM(e,t){return`${e}:${t??0}`}function QM(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=ZM(UM(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var $M={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},eN={class:`max-h-[28rem] overflow-y-auto`},tN=[`aria-expanded`,`aria-label`,`onClick`],nN=[`title`],rN=M({__name:`LiveActivityCard`,setup(e){let t=UD(),{activity:n,streamKind:r,streamState:i}=id(DA()),a=O(`all`),o=G(()=>YM(n.value,a.value)),s=G(()=>XM(o.value.length,a.value)),c=nn(new Set),l=G(()=>QM(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return UM(e.representative)}function p(e){return e.representative.at?wj(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(L(),z(k(_j),null,{default:A(()=>[V(k(Sj),null,{default:A(()=>[V(k(Cj),null,{default:A(()=>[...t[1]||=[H(`Live activity`,-1)]]),_:1}),V(k(vj),{class:`flex items-center gap-2`},{default:A(()=>[V(k(IM),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:k(KM)},null,8,[`modelValue`,`options`]),V(k(mj),{variant:k(r)},{default:A(()=>[H(D(k(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),V(k(yj),null,{default:A(()=>[B(`div`,$M,[B(`div`,eN,[V(k(RM),null,{default:A(()=>[V(k(VM),{class:`sticky top-0 z-10 bg-card`},{default:A(()=>[V(k(BM),null,{default:A(()=>[V(k($),null,{default:A(()=>[...t[2]||=[H(`Event`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[3]||=[H(`Task`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[4]||=[H(`Detail`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[5]||=[H(`When`,-1)]]),_:1})]),_:1})]),_:1}),V(k(zM),null,{default:A(()=>[o.value.length?U(``,!0):(L(),z(k(BM),{key:0},{default:A(()=>[V(k(Q),{colspan:`4`},{default:A(()=>[V(k(oj),null,{default:A(()=>[V(k(lj),null,{default:A(()=>[V(k(fj),null,{default:A(()=>[H(D(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(L(!0),R(I,{key:1},P(l.value,e=>(L(),R(I,{key:e.key},[e.count===1?(L(),z(GM,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(L(),R(I,{key:1},[V(k(BM),{class:E(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[uu(cu(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),uu(cu(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:A(()=>[V(k(Q),{class:`font-medium`},{default:A(()=>[B(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:cu(t=>u(e.key),[`stop`])},[d(e)?(L(),z(k(Cd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(L(),z(k(wd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),H(` `+D(e.label)+` `,1),V(k(mj),{variant:`idle`},{default:A(()=>[H(`×`+D(e.count),1)]),_:2},1024)],8,tN)]),_:2},1024),V(k(Q),{class:`font-mono`},{default:A(()=>[H(D(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),V(k(Q),{class:`w-[55%] max-w-0`},{default:A(()=>[B(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},D(f(e).text),9,nN)]),_:2},1024),V(k(Q),null,{default:A(()=>[H(D(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(L(!0),R(I,{key:0},P(e.events,(t,n)=>(L(),z(GM,{key:`${e.key}:${n}`,event:t,onOpen: Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function bP(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function xP(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function SP(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function CP(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var wP=O([]),TP=O([]),EP=O(!0),DP=O(null),OP=O(null),kP=O(!1),AP=O(null);async function jP(){try{let e=await q.eventTypes();EP.value=e.enabled!==!1,wP.value=e.event_types||[],TP.value=e.proposals||[],DP.value=null}catch(e){DP.value=e.message||String(e)}}function MP(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function NP(e){AP.value=null,OP.value=e}function PP(e){let t=HP.value.find(t=>String(t.id)===e.sample_id);NP({mode:`proposal`,id:null,source:e.source,name:``,rule:MP(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function FP(e=``){NP({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function IP(e){NP({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:MP(e.rule),headersText:``,body:``,exampleHeaders:{}})}function LP(){OP.value=null}async function RP(){let e=OP.value;if(e){kP.value=!0;try{if(e.mode===`edit`&&e.id)await q.eventTypeUpdate(e.id,{name:e.name,rule:CP(e.rule)});else{let t=e.mode===`paste`?yP(e.headersText):e.exampleHeaders;await q.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:CP(e.rule),example:{headers:t,body:e.body}})}OP.value=null,await jP()}catch(e){AP.value=e.message||String(e)}finally{kP.value=!1}}}var zP=O(null);async function BP(){let e=zP.value;if(zP.value=null,e)try{await q.eventTypeDelete(e.id),await jP()}catch(e){DP.value=e.message||String(e)}}var VP=100,HP=O([]),UP=O(!0),WP=O(null),GP=O(!0),KP=O(null);async function qP(){try{let e=await q.captures(VP);UP.value=e.enabled!==!1,HP.value=e.captures||[],WP.value=null}catch(e){WP.value=e.message||String(e)}finally{GP.value=!1}}function JP(e){let t=HP.value.find(t=>t.id===e);return t&&(KP.value=t),!!t}function YP(){HP.value.length&&(KP.value=HP.value[0])}function XP(){OA(`captures`,()=>{qP(),jP()})}var ZP=`archie.theme`,QP=`archie.density`,$P=`archie.motion`,eF=`archie.tooltips`;function tF(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function nF(e,t){try{localStorage.setItem(e,t)}catch{}}function rF(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var iF=rd(`appearance`,()=>{let e=O(tF(ZP,[`system`,`dark`,`light`],`dark`)),t=O(tF(QP,[`comfortable`,`compact`],`comfortable`)),n=O(tF($P,[`system`,`reduced`],`system`)),r=O(tF(eF,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=rF(e.value)}function o(t){e.value=t,a(),nF(ZP,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,nF(QP,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,nF($P,e)}function l(e){r.value=e,nF(eF,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),aF=M({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=yg(n,t),{tooltipsEnabled:i}=id(iF());return(e,t)=>(L(),z(k(pw),W({"data-slot":`tooltip`},k(r),{disabled:n.disabled||!k(i)}),{default:A(t=>[F(e.$slots,`default`,Ce(Es(t)))]),_:3},16,[`disabled`]))}}),oF=M({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=yg(Nw(n,`class`),r);return(e,t)=>(L(),z(k(_w),null,{default:A( Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function bP(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function xP(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function SP(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function CP(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var wP=O([]),TP=O([]),EP=O(!0),DP=O(null),OP=O(null),kP=O(!1),AP=O(null);async function jP(){try{let e=await q.eventTypes();EP.value=e.enabled!==!1,wP.value=e.event_types||[],TP.value=e.proposals||[],DP.value=null}catch(e){DP.value=e.message||String(e)}}function MP(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function NP(e){AP.value=null,OP.value=e}function PP(e){let t=HP.value.find(t=>String(t.id)===e.sample_id);NP({mode:`proposal`,id:null,source:e.source,name:``,rule:MP(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function FP(e=``){NP({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function IP(e){NP({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:MP(e.rule),headersText:``,body:``,exampleHeaders:{}})}function LP(){OP.value=null}async function RP(){let e=OP.value;if(e){kP.value=!0;try{if(e.mode===`edit`&&e.id)await q.eventTypeUpdate(e.id,{name:e.name,rule:CP(e.rule)});else{let t=e.mode===`paste`?yP(e.headersText):e.exampleHeaders;await q.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:CP(e.rule),example:{headers:t,body:e.body}})}OP.value=null,await jP()}catch(e){AP.value=e.message||String(e)}finally{kP.value=!1}}}var zP=O(null);async function BP(){let e=zP.value;if(zP.value=null,e)try{await q.eventTypeDelete(e.id),await jP()}catch(e){DP.value=e.message||String(e)}}var VP=100,HP=O([]),UP=O(!0),WP=O(null),GP=O(!0),KP=O(null);async function qP(){try{let e=await q.captures(VP);UP.value=e.enabled!==!1,HP.value=e.captures||[],WP.value=null}catch(e){WP.value=e.message||String(e)}finally{GP.value=!1}}function JP(e){let t=HP.value.find(t=>t.id===e);return t&&(KP.value=t),!!t}function YP(){HP.value.length&&(KP.value=HP.value[0])}function XP(){OA(`captures`,()=>{qP(),jP()})}var ZP=`archie.theme`,QP=`archie.density`,$P=`archie.motion`,eF=`archie.tooltips`;function tF(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function nF(e,t){try{localStorage.setItem(e,t)}catch{}}function rF(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var iF=rd(`appearance`,()=>{let e=O(tF(ZP,[`system`,`dark`,`light`],`dark`)),t=O(tF(QP,[`comfortable`,`compact`],`comfortable`)),n=O(tF($P,[`system`,`reduced`],`system`)),r=O(tF(eF,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=rF(e.value)}function o(t){e.value=t,a(),nF(ZP,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,nF(QP,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,nF($P,e)}function l(e){r.value=e,nF(eF,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),aF=M({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=yg(n,t),{tooltipsEnabled:i}=id(iF());return(e,t)=>(L(),z(k(pw),W({"data-slot":`tooltip`},k(r),{disabled:n.disabled||!k(i)}),{default:A(t=>[F(e.$slots,`default`,Ce(Es(t)))]),_:3},16,[`disabled`]))}}),oF=M({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=yg(Nw(n,`class`),r);return(e,t)=>(L(),z(k(_w),null,{default:A( Line truncated
`)}};dJ.defaultYaml={explicit:!1,version:`1.2`},dJ.defaultTags={"!!":`tag:yaml.org,2002:`};function fJ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function pJ(e){let t=new Set;return iJ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function mJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function hJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=pJ(e);let a=mJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Xq(t.node)||Qq(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function gJ(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=gJ(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=gJ(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=gJ(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=gJ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function _J(e,t,n){if(Array.isArray(e))return e.map((e,t)=>_J(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!eJ(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var vJ=class{constructor(e){Object.defineProperty(this,Gq,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!qq(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=_J(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?gJ(i,{"":o},``,o):o}},yJ=class extends vJ{constructor(e){super(zq),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],iJ(e,{Node:(e,t)=>{(Kq(t)||eJ(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(_J(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=bJ(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(fJ(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function bJ(e,t,n){if(Kq(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Qq(t)){let r=0;for(let i of t.items){let t=bJ(e,i,n);t>r&&(r=t)}return r}if(Yq(t)){let r=bJ(e,t.key,n),i=bJ(e,t.value,n);return Math.max(r,i)}return 1}var xJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,SJ=class extends vJ{constructor(e){super(Uq),this.value=e}toJSON(e,t){return t?.keep?this.value:_J(this.value,e,t)}toString(){return String(this.value)}};SJ.BLOCK_FOLDED=`BLOCK_FOLDED`,SJ.BLOCK_LITERAL=`BLOCK_LITERAL`,SJ.PLAIN=`PLAIN`,SJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,SJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var CJ=`tag:yaml.org,2002:`;function wJ(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function TJ(e,t,n){if(qq(e)&&(e=e.contents),$q(e))return e;if(Yq(e)){let t=n.schema[Vq].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new yJ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=CJ+t.slice(2));let l=wJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new SJ(e);return c&&(c.node=t),t Line truncated
`)?AJ(n,t):n.includes(`
`)?`
-1
View File
@@ -1,7 +1,6 @@
/** Naming and numbers shared by the workflow tables. */
const WORKFLOW_LABELS: Record<string, string> = {
bootstrap: "Bootstrap",
implement: "Implement",
tdd: "TDD",
feasibility: "Feasibility check",