Files
archie/.okf/codebase/internal/nats/client.md
T
sam 7c34bdae5a okf: scaffold knowledge bundle and MCP server config
Adds a harvested .okf/ knowledge bundle (codebase concepts + starter
architecture/services/rules scaffolding) and .mcp.json pointing at the
shared okf MCP service (http://localhost:8765/archie-core/), which
serves multiple projects' bundles from a single process.
2026-07-22 04:36:50 +10:00

937 B

description, resource, tags, timestamp, title, type
description resource tags timestamp title type
Source module internal/nats/client.go (176 lines). internal/nats/client.go
go
source
2026-07-21T18:36:22Z client.go Module

Module client.go

Path: internal/nats/client.go
Lines: 176

Snippet Preview

package nats

import (
	"context"
	"encoding/json"
	"fmt"
	"log/slog"
	"strings"
	"time"

	"github.com/nats-io/nats.go"
	"github.com/nats-io/nats.go/jetstream"
)

const (
	streamName   = "ARCHIE_TASKS"
	consumerName = "archie-daemon"
	msgPrefix    = "archie:" // for Nats-Msg-Id dedup
	dedupWindow  = 2 * time.Minute
	pollTimeout  = 2 * time.Second
)

// TaskMessage is the NATS payload for a discovered issue.
type TaskMessage struct {
	Owner  string `json:"owner"`
	Repo   string `json:"repo"`
	Number int    `json:"number"`
	Title  string `json:"title"`
	Body   string `json:"body"`
	Labels string `json:"labels"` // comma-separated