@secondlayer/sentinel 0.4.0 → 0.5.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/README.md +2 -1
- package/dist/cli.js +790 -26
- package/dist/index.js +73 -1
- package/dist/mcp.js +591 -18
- package/dist/sentinel-client.d.ts +447 -2
- package/package.json +1 -1
|
@@ -32,14 +32,20 @@ export type Claim = {
|
|
|
32
32
|
} | null;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
+
/** A run's status. `queued`: waiting for a slot (the worker runs a bounded number of plans at once). */
|
|
36
|
+
export type RunStatus = "queued" | "running" | "done" | "error";
|
|
35
37
|
export type RunSummary = {
|
|
36
38
|
id: string;
|
|
37
39
|
kind: string;
|
|
38
|
-
status:
|
|
40
|
+
status: RunStatus;
|
|
39
41
|
startedAt: string;
|
|
40
42
|
finishedAt: string | null;
|
|
41
43
|
events: RunEvent[];
|
|
42
44
|
};
|
|
45
|
+
/** Not finished yet: running, or queued to run. */
|
|
46
|
+
export declare const runInProgress: (status: string) => boolean;
|
|
47
|
+
/** Where an unfinished run is: `queued`, else its latest progress event (`starting` before the first). */
|
|
48
|
+
export declare function runPhase(run: RunSummary): string;
|
|
43
49
|
export type Finding = {
|
|
44
50
|
title: string;
|
|
45
51
|
headline?: string;
|
|
@@ -73,7 +79,7 @@ export type PlanView = {
|
|
|
73
79
|
access?: "verified" | "claimed";
|
|
74
80
|
id: string;
|
|
75
81
|
contractId: string;
|
|
76
|
-
status:
|
|
82
|
+
status: RunStatus;
|
|
77
83
|
report?: {
|
|
78
84
|
findings?: Finding[];
|
|
79
85
|
plan?: {
|
|
@@ -366,6 +372,263 @@ export type StartedRun = {
|
|
|
366
372
|
planId: string;
|
|
367
373
|
existing?: boolean;
|
|
368
374
|
};
|
|
375
|
+
/** One contract of a repo import preview: where it sits in the repo, what it calls, whether it is worth
|
|
376
|
+
* monitoring (`suggested`, with `why` not), and where it stands for you. */
|
|
377
|
+
export type ImportContract = {
|
|
378
|
+
name: string;
|
|
379
|
+
path: string;
|
|
380
|
+
/** The plan key of exactly these bytes: `github:<owner>/<repo>@<sha>:<path>`. */
|
|
381
|
+
key: string;
|
|
382
|
+
clarityVersion: number;
|
|
383
|
+
/** Contracts of the repo it calls: they deploy before it. */
|
|
384
|
+
deps: string[];
|
|
385
|
+
/** Contracts it calls by full principal outside the repo. */
|
|
386
|
+
external: string[];
|
|
387
|
+
suggested: boolean;
|
|
388
|
+
why?: "test" | "mock" | "deployed" | "trait-only";
|
|
389
|
+
/** `in-project`: already in one of your projects. `planned`: a recent plan is reused, free. `new`: a paid plan. */
|
|
390
|
+
state: "in-project" | "planned" | "new";
|
|
391
|
+
planId?: string;
|
|
392
|
+
projectId?: string;
|
|
393
|
+
};
|
|
394
|
+
/** `POST /projects/import/preview`: a public Clarinet repo's contracts at a pinned commit. Writes and charges
|
|
395
|
+
* nothing; import with its `commit`. */
|
|
396
|
+
export type ImportPreview = {
|
|
397
|
+
kind: "repo";
|
|
398
|
+
owner: string;
|
|
399
|
+
repo: string;
|
|
400
|
+
ref: string;
|
|
401
|
+
commit: string;
|
|
402
|
+
/** The folder of the Clarinet project (`""` = the repo root). */
|
|
403
|
+
root: string;
|
|
404
|
+
manifests: string[];
|
|
405
|
+
requirements: string[];
|
|
406
|
+
/** The contracts call each other in a loop: listed in manifest order instead of deploy order. */
|
|
407
|
+
cycle: boolean;
|
|
408
|
+
/** In deploy order. */
|
|
409
|
+
contracts: ImportContract[];
|
|
410
|
+
skipped: {
|
|
411
|
+
path: string;
|
|
412
|
+
reason: string;
|
|
413
|
+
}[];
|
|
414
|
+
/** Files whose code is live on mainnet, one entry per deployer. `checked` is false while that can't be told. */
|
|
415
|
+
mainnetMatch: {
|
|
416
|
+
checked: boolean;
|
|
417
|
+
deployers: {
|
|
418
|
+
deployer: string;
|
|
419
|
+
files: {
|
|
420
|
+
name: string;
|
|
421
|
+
contractId: string;
|
|
422
|
+
kind: "exact" | "partial";
|
|
423
|
+
}[];
|
|
424
|
+
}[];
|
|
425
|
+
};
|
|
426
|
+
maxContracts: number;
|
|
427
|
+
/** Plans the worker runs at once; past this, an import's plans wait their turn as `queued`. */
|
|
428
|
+
runsAtOnce: number;
|
|
429
|
+
/** The suggested contracts' new plans. USD micros; null when billing isn't linked (free daily limit). */
|
|
430
|
+
cost: {
|
|
431
|
+
plans: number;
|
|
432
|
+
runUsdMicros: number | null;
|
|
433
|
+
usdMicros: number | null;
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
export type ImportInput = {
|
|
437
|
+
url: string;
|
|
438
|
+
/** The `commit` the preview returned: the import plans exactly that code. */
|
|
439
|
+
commit: string;
|
|
440
|
+
/** Contract names from the preview. */
|
|
441
|
+
contracts: string[];
|
|
442
|
+
/** One of your project ids, or `"new"` (the default: a project named after the repo). */
|
|
443
|
+
project?: string;
|
|
444
|
+
};
|
|
445
|
+
/** `POST /projects/import`: a plan per contract (`status: "kept"` for one already in the project, `queued`
|
|
446
|
+
* for one waiting its turn behind `runsAtOnce` others). */
|
|
447
|
+
export type ImportResult = {
|
|
448
|
+
projectId: string | null;
|
|
449
|
+
commit: string;
|
|
450
|
+
plans: {
|
|
451
|
+
name: string;
|
|
452
|
+
contractId: string;
|
|
453
|
+
planId: string | null;
|
|
454
|
+
status: RunStatus | "kept";
|
|
455
|
+
cached: boolean;
|
|
456
|
+
}[];
|
|
457
|
+
/** Only when the spend guard turned plans away mid-way. */
|
|
458
|
+
notStarted?: {
|
|
459
|
+
name: string;
|
|
460
|
+
contractId: string;
|
|
461
|
+
error: string;
|
|
462
|
+
}[];
|
|
463
|
+
};
|
|
464
|
+
/** `added`: the account claimed it (it has a plan). `found`: a contract of the same protocol found in a member's code. */
|
|
465
|
+
export type ProjectContract = {
|
|
466
|
+
contractId: string;
|
|
467
|
+
planId: string | null;
|
|
468
|
+
origin: "added" | "found";
|
|
469
|
+
role: string | null;
|
|
470
|
+
temporary: boolean;
|
|
471
|
+
[field: string]: unknown;
|
|
472
|
+
};
|
|
473
|
+
export type Project = {
|
|
474
|
+
id: string;
|
|
475
|
+
name: string;
|
|
476
|
+
createdAt: string;
|
|
477
|
+
contracts: ProjectContract[];
|
|
478
|
+
/** Monitoring across the contracts the account claimed in it. */
|
|
479
|
+
status: "live" | "starting" | "armed" | "partial" | "off";
|
|
480
|
+
findings: number;
|
|
481
|
+
alerts7d: number;
|
|
482
|
+
suggestions: number;
|
|
483
|
+
[field: string]: unknown;
|
|
484
|
+
};
|
|
485
|
+
/** A project that looks like part of another. Never merged without the account: accept or dismiss it. */
|
|
486
|
+
export type MergeSuggestion = {
|
|
487
|
+
from: string;
|
|
488
|
+
into: string;
|
|
489
|
+
evidence: {
|
|
490
|
+
kind: string;
|
|
491
|
+
from: string;
|
|
492
|
+
to: string;
|
|
493
|
+
fns?: string[];
|
|
494
|
+
repo?: string;
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
/** `GET /projects/:id/overview`: the project, each claimed contract's plan and (with `watches`) its watches. */
|
|
498
|
+
export type ProjectOverview = {
|
|
499
|
+
project: Project;
|
|
500
|
+
plans: Record<string, PlanView>;
|
|
501
|
+
planErrors: Record<string, string>;
|
|
502
|
+
watches?: Record<string, WatchesView | null>;
|
|
503
|
+
};
|
|
504
|
+
/** Where a contract about to be added would go: the project it fits and why. Writes nothing. */
|
|
505
|
+
export type ProjectPreview = {
|
|
506
|
+
kind?: "deployed" | "prelaunch";
|
|
507
|
+
contractId: string;
|
|
508
|
+
/** The contracts it calls (a deployed one only). */
|
|
509
|
+
calls: string[];
|
|
510
|
+
suggestion: {
|
|
511
|
+
/** One of the account's project ids, or "new". */
|
|
512
|
+
project: string;
|
|
513
|
+
kind: "already" | "called-by" | "calls" | "same-deployer" | "none";
|
|
514
|
+
/** The contract of that project the link runs through. */
|
|
515
|
+
with: string | null;
|
|
516
|
+
};
|
|
517
|
+
[field: string]: unknown;
|
|
518
|
+
};
|
|
519
|
+
/** What a project-wide save did on one contract. */
|
|
520
|
+
export type ProjectMemberResult = {
|
|
521
|
+
contractId: string;
|
|
522
|
+
planId: string;
|
|
523
|
+
result: "saved" | "remembered" | "on" | "off" | "unchanged" | "skipped" | "error";
|
|
524
|
+
error?: string;
|
|
525
|
+
/** A new webhook's signing secret, shown once; each contract signs with its own. */
|
|
526
|
+
signingSecret?: string;
|
|
527
|
+
};
|
|
528
|
+
/** A project's watches as one list: every row names the member plan to write through. */
|
|
529
|
+
export type ProjectWatchesView = {
|
|
530
|
+
contracts: {
|
|
531
|
+
contractId: string;
|
|
532
|
+
planId: string;
|
|
533
|
+
[field: string]: unknown;
|
|
534
|
+
}[];
|
|
535
|
+
intents: (IntentWatch<unknown> & {
|
|
536
|
+
[field: string]: unknown;
|
|
537
|
+
})[];
|
|
538
|
+
counts: {
|
|
539
|
+
on: number;
|
|
540
|
+
total: number;
|
|
541
|
+
};
|
|
542
|
+
locked: number;
|
|
543
|
+
[field: string]: unknown;
|
|
544
|
+
};
|
|
545
|
+
/** One intent watch's activity, as the web app draws it: points, the history page, counts. */
|
|
546
|
+
export type WatchActivity = {
|
|
547
|
+
window: 7 | 90;
|
|
548
|
+
asset: string | null;
|
|
549
|
+
unit: Units | null;
|
|
550
|
+
counts: {
|
|
551
|
+
total: number;
|
|
552
|
+
over: number;
|
|
553
|
+
};
|
|
554
|
+
events: {
|
|
555
|
+
t: string;
|
|
556
|
+
block: number | null;
|
|
557
|
+
txId: string;
|
|
558
|
+
fn: string | null;
|
|
559
|
+
value: string | null;
|
|
560
|
+
caller: string | null;
|
|
561
|
+
result: string | null;
|
|
562
|
+
[field: string]: unknown;
|
|
563
|
+
}[];
|
|
564
|
+
nextCursor: string | null;
|
|
565
|
+
history: "collecting" | "ready" | "failed";
|
|
566
|
+
[field: string]: unknown;
|
|
567
|
+
};
|
|
568
|
+
export type ActivityOptions = {
|
|
569
|
+
window?: 7 | 90;
|
|
570
|
+
/** `over`: only what crossed a rule's line. */
|
|
571
|
+
filter?: "over" | "all";
|
|
572
|
+
cursor?: string | null;
|
|
573
|
+
/** Money out: which asset. */
|
|
574
|
+
asset?: string;
|
|
575
|
+
};
|
|
576
|
+
/** A public fn: what it does and the intent watch covering it (null: nothing watches it). */
|
|
577
|
+
export type PlanFunction = {
|
|
578
|
+
fn: string;
|
|
579
|
+
consequence: string | null;
|
|
580
|
+
description: string | null;
|
|
581
|
+
intentId: string | null;
|
|
582
|
+
};
|
|
583
|
+
/** One alert as email and Slack render it, and the webhook body. */
|
|
584
|
+
export type AlertPreview = {
|
|
585
|
+
message: {
|
|
586
|
+
subject: string;
|
|
587
|
+
text: string;
|
|
588
|
+
slack: unknown;
|
|
589
|
+
};
|
|
590
|
+
payload: Record<string, unknown>;
|
|
591
|
+
};
|
|
592
|
+
/** Where a pre-launch plan's branch is now. `free`: monitoring is on, so an update costs nothing. */
|
|
593
|
+
export type LatestCommit = {
|
|
594
|
+
status: "unsupported";
|
|
595
|
+
} | {
|
|
596
|
+
status: "current";
|
|
597
|
+
ref: string;
|
|
598
|
+
commit: string;
|
|
599
|
+
free: boolean;
|
|
600
|
+
} | {
|
|
601
|
+
status: "gone";
|
|
602
|
+
ref: string;
|
|
603
|
+
head: string;
|
|
604
|
+
free: boolean;
|
|
605
|
+
} | {
|
|
606
|
+
status: "behind";
|
|
607
|
+
ref: string;
|
|
608
|
+
commit: string;
|
|
609
|
+
head: string;
|
|
610
|
+
ahead: number;
|
|
611
|
+
mode: "carried" | "focused" | "full";
|
|
612
|
+
affected: string[];
|
|
613
|
+
changed: string[];
|
|
614
|
+
free: boolean;
|
|
615
|
+
};
|
|
616
|
+
export type AckReason = "accepted" | "fixed" | "disagree";
|
|
617
|
+
export type AckEvent = {
|
|
618
|
+
action: "acknowledge" | "change" | "reopen" | "returned";
|
|
619
|
+
title: string;
|
|
620
|
+
reason: AckReason | null;
|
|
621
|
+
note: string | null;
|
|
622
|
+
by: string | null;
|
|
623
|
+
at: string;
|
|
624
|
+
};
|
|
625
|
+
export type FindingNote = {
|
|
626
|
+
id: string;
|
|
627
|
+
body: string;
|
|
628
|
+
by: string | null;
|
|
629
|
+
system: boolean;
|
|
630
|
+
at: string;
|
|
631
|
+
};
|
|
369
632
|
export type ClientOptions = {
|
|
370
633
|
baseUrl?: string;
|
|
371
634
|
token: string;
|
|
@@ -399,6 +662,11 @@ export declare function createClient(opts: ClientOptions): {
|
|
|
399
662
|
status: string;
|
|
400
663
|
cached: boolean;
|
|
401
664
|
}>;
|
|
665
|
+
/** A public Clarinet repo's contracts, what each would cost and where each stands. Writes and charges nothing. */
|
|
666
|
+
previewImport: (url: string) => Promise<ImportPreview>;
|
|
667
|
+
/** Plan the named contracts of a previewed repo into one project, at the preview's commit. One paid plan
|
|
668
|
+
* per new contract (a recent plan is reused free); all refused before any starts when the balance is short. */
|
|
669
|
+
importRepo: (input: ImportInput) => Promise<ImportResult>;
|
|
402
670
|
billing: () => Promise<BillingView>;
|
|
403
671
|
watches: (planId: string) => Promise<WatchesView>;
|
|
404
672
|
/** Set a new rule for a watch. Applies now. */
|
|
@@ -445,6 +713,183 @@ export declare function createClient(opts: ClientOptions): {
|
|
|
445
713
|
stopMonitoring: (planId: string) => Promise<{
|
|
446
714
|
ok: boolean;
|
|
447
715
|
}>;
|
|
716
|
+
/** One intent watch's activity (an intent id from `watches`): what it saw and what crossed its rules. */
|
|
717
|
+
watchActivity: (planId: string, intentId: string, opts?: ActivityOptions) => Promise<WatchActivity>;
|
|
718
|
+
/** Every public fn, what it does and the watch covering it. */
|
|
719
|
+
functions: (planId: string) => Promise<PlanFunction[]>;
|
|
720
|
+
/** What a watch on a fn nobody watches yet would have seen; `collected: false` until its history is read. */
|
|
721
|
+
functionActivity: (planId: string, fn: string) => Promise<{
|
|
722
|
+
collected: false;
|
|
723
|
+
} | {
|
|
724
|
+
collected: true;
|
|
725
|
+
activity: WatchActivity;
|
|
726
|
+
}>;
|
|
727
|
+
/** A sample alert as email, Slack and the webhook get it. `example` picks the kind, else the loudest watch. */
|
|
728
|
+
alertPreview: (planId: string, example?: "money_out" | "finding") => Promise<AlertPreview>;
|
|
729
|
+
/** One asset's Money out limit, in base units. */
|
|
730
|
+
threshold: (planId: string, asset: string) => Promise<{
|
|
731
|
+
asset: string;
|
|
732
|
+
threshold: Threshold;
|
|
733
|
+
}>;
|
|
734
|
+
/** Set (or confirm) one asset's Money out limit, in base units (a digit string). Live at once. */
|
|
735
|
+
setThreshold: (planId: string, asset: string, amount: string) => Promise<{
|
|
736
|
+
asset: string;
|
|
737
|
+
threshold: Threshold;
|
|
738
|
+
}>;
|
|
739
|
+
/** Forget the failed history reads of this plan's watches and read again in the background. */
|
|
740
|
+
retryHistory: (planId: string) => Promise<{
|
|
741
|
+
ok: true;
|
|
742
|
+
}>;
|
|
743
|
+
readAlert: (alertId: string) => Promise<{
|
|
744
|
+
ok: true;
|
|
745
|
+
}>;
|
|
746
|
+
readAllAlerts: () => Promise<{
|
|
747
|
+
ok: true;
|
|
748
|
+
count: number;
|
|
749
|
+
}>;
|
|
750
|
+
/** Ask a question about Sentinel; answered from its public docs. */
|
|
751
|
+
ask: (q: string) => Promise<{
|
|
752
|
+
question: string;
|
|
753
|
+
answered: boolean;
|
|
754
|
+
answer: string;
|
|
755
|
+
sources: string[];
|
|
756
|
+
cached: boolean;
|
|
757
|
+
}>;
|
|
758
|
+
/** Label a finding for the team (`title` guards against acting on a finding that moved). Changes no verdict. */
|
|
759
|
+
acknowledge: (planId: string, finding: number, title: string, reason: AckReason, note?: string | null) => Promise<{
|
|
760
|
+
ok: true;
|
|
761
|
+
watchId?: string;
|
|
762
|
+
}>;
|
|
763
|
+
reopen: (planId: string, finding: number, title: string) => Promise<{
|
|
764
|
+
ok: true;
|
|
765
|
+
}>;
|
|
766
|
+
/** Every acknowledgement change on the contract (verified owners). */
|
|
767
|
+
ackHistory: (planId: string) => Promise<AckEvent[]>;
|
|
768
|
+
/** Your notes on one finding (verified owners). */
|
|
769
|
+
notes: (planId: string, finding: number) => Promise<FindingNote[]>;
|
|
770
|
+
addNote: (planId: string, finding: number, title: string, body: string) => Promise<{
|
|
771
|
+
note: FindingNote;
|
|
772
|
+
}>;
|
|
773
|
+
/** Run your own Clarinet test files against the plan's contract in the sandbox. */
|
|
774
|
+
tests: (planId: string, files: {
|
|
775
|
+
path: string;
|
|
776
|
+
content: string;
|
|
777
|
+
}[]) => Promise<StartedRun>;
|
|
778
|
+
/** Free compile check of an invariant harness. Starts nothing. */
|
|
779
|
+
fuzzCheck: (planId: string, harness: string) => Promise<{
|
|
780
|
+
ok: boolean;
|
|
781
|
+
message?: string;
|
|
782
|
+
}>;
|
|
783
|
+
/** Fuzz the contract against your Clarity invariants in the sandbox. */
|
|
784
|
+
fuzz: (planId: string, invariants: string) => Promise<StartedRun>;
|
|
785
|
+
/** Whether a pre-launch plan's branch moved on, and what an update would review. */
|
|
786
|
+
latestCommit: (planId: string) => Promise<LatestCommit>;
|
|
787
|
+
/** Plan the branch's latest commit, or `commit` (40-hex). Free while monitoring is on, else priced as a plan. */
|
|
788
|
+
updatePlan: (planId: string, commit?: string) => Promise<{
|
|
789
|
+
planId: string;
|
|
790
|
+
status: string;
|
|
791
|
+
mode?: string;
|
|
792
|
+
existing?: boolean;
|
|
793
|
+
}>;
|
|
794
|
+
/** A plan waiting on undeployed dependencies: plan it on its own when they deploy (or not). */
|
|
795
|
+
setAutoPlan: (planId: string, auto: boolean) => Promise<{
|
|
796
|
+
auto: boolean;
|
|
797
|
+
}>;
|
|
798
|
+
/** Link code for one dependency the plan waits on (a file or repo link), or clear it with null. */
|
|
799
|
+
setLink: (planId: string, dependency: string, url: string | null) => Promise<{
|
|
800
|
+
links: {
|
|
801
|
+
id: string;
|
|
802
|
+
[field: string]: unknown;
|
|
803
|
+
}[];
|
|
804
|
+
}>;
|
|
805
|
+
/** Plan now with the linked code. Spends balance like a new plan. */
|
|
806
|
+
planLinked: (planId: string) => Promise<{
|
|
807
|
+
planId: string;
|
|
808
|
+
status: string;
|
|
809
|
+
}>;
|
|
810
|
+
/** Your own name for the contract; an empty one clears it. */
|
|
811
|
+
renameContract: (planId: string, name: string) => Promise<{
|
|
812
|
+
name: string | null;
|
|
813
|
+
}>;
|
|
814
|
+
/** Take the contract off your account: monitoring, alerts and claim. `confirm` is its contract name, typed. */
|
|
815
|
+
removeContract: (planId: string, confirm: string) => Promise<{
|
|
816
|
+
removed: true;
|
|
817
|
+
monitoringOff: boolean;
|
|
818
|
+
}>;
|
|
819
|
+
projects: () => Promise<{
|
|
820
|
+
projects: Project[];
|
|
821
|
+
suggestions: MergeSuggestion[];
|
|
822
|
+
}>;
|
|
823
|
+
project: (projectId: string) => Promise<Project>;
|
|
824
|
+
/** The project with each claimed contract's plan and, with `watches`, its watches, in one read. */
|
|
825
|
+
projectOverview: (projectId: string, opts?: {
|
|
826
|
+
watches?: boolean;
|
|
827
|
+
}) => Promise<ProjectOverview>;
|
|
828
|
+
renameProject: (projectId: string, name: string) => Promise<{
|
|
829
|
+
name: string;
|
|
830
|
+
}>;
|
|
831
|
+
/** Remove every contract you claimed in it, and the project. `confirm` is the project's name, typed. */
|
|
832
|
+
removeProject: (projectId: string, confirm: string) => Promise<{
|
|
833
|
+
removed: true;
|
|
834
|
+
contracts: number;
|
|
835
|
+
}>;
|
|
836
|
+
/** Accept (move `from`'s contracts into `into`) or dismiss a merge suggestion from `projects`. */
|
|
837
|
+
answerMergeSuggestion: (from: string, into: string, accept: boolean) => Promise<{
|
|
838
|
+
ok: true;
|
|
839
|
+
accepted: boolean;
|
|
840
|
+
}>;
|
|
841
|
+
/** Merge a project into another of yours: every contract moves; monitoring and verification stay. */
|
|
842
|
+
mergeProject: (projectId: string, into: string) => Promise<{
|
|
843
|
+
merged: true;
|
|
844
|
+
into: string;
|
|
845
|
+
contracts: number;
|
|
846
|
+
}>;
|
|
847
|
+
/** Move one contract to another of your projects, or a new one named after it (`"new"`). */
|
|
848
|
+
moveProjectContract: (projectId: string, contractId: string, into: string) => Promise<{
|
|
849
|
+
moved: true;
|
|
850
|
+
projectId: string;
|
|
851
|
+
projectRemoved: boolean;
|
|
852
|
+
}>;
|
|
853
|
+
/** A contract you claimed goes the way removeContract takes it (`confirm`: its contract name, typed); a
|
|
854
|
+
* found one just leaves the project. */
|
|
855
|
+
removeProjectContract: (projectId: string, contractId: string, confirm?: string) => Promise<{
|
|
856
|
+
removed: true;
|
|
857
|
+
projectRemoved: boolean;
|
|
858
|
+
monitoringOff: boolean;
|
|
859
|
+
}>;
|
|
860
|
+
/** Where a contract (a deployed id or a GitHub/Gist `.clar` link) would go. Writes nothing. */
|
|
861
|
+
previewProjectContract: (projectId: string, contractId: string) => Promise<ProjectPreview>;
|
|
862
|
+
/** Claim a contract and start its plan into this project, another (`project`) or a new one (`"new"`). Spends
|
|
863
|
+
* balance like a new plan. */
|
|
864
|
+
addProjectContract: (projectId: string, contractId: string, opts?: {
|
|
865
|
+
project?: string;
|
|
866
|
+
temporary?: boolean;
|
|
867
|
+
}) => Promise<{
|
|
868
|
+
planId: string;
|
|
869
|
+
status: string;
|
|
870
|
+
cached: boolean;
|
|
871
|
+
projectId: string;
|
|
872
|
+
}>;
|
|
873
|
+
/** Where the project's alerts go, set on each contract you claimed in it. An omitted URL clears it. */
|
|
874
|
+
setProjectDestinations: (projectId: string, dest: {
|
|
875
|
+
email?: boolean;
|
|
876
|
+
slackUrl?: string;
|
|
877
|
+
webhookUrl?: string;
|
|
878
|
+
}) => Promise<{
|
|
879
|
+
contracts: ProjectMemberResult[];
|
|
880
|
+
}>;
|
|
881
|
+
/** Monitoring on or off for every contract you claimed in the project. */
|
|
882
|
+
setProjectMonitoring: (projectId: string, on: boolean) => Promise<{
|
|
883
|
+
contracts: ProjectMemberResult[];
|
|
884
|
+
status: Project["status"];
|
|
885
|
+
}>;
|
|
886
|
+
/** The project's watches as one list; each row names the member plan the watch tools write through. */
|
|
887
|
+
projectWatches: (projectId: string) => Promise<ProjectWatchesView>;
|
|
888
|
+
/** One member's activity of an intent (`contract`: the member, default the first that holds it). */
|
|
889
|
+
projectActivity: (projectId: string, intentId: string, opts?: ActivityOptions & {
|
|
890
|
+
contract?: string;
|
|
891
|
+
fn?: string;
|
|
892
|
+
}) => Promise<WatchActivity>;
|
|
448
893
|
};
|
|
449
894
|
export type SentinelClient = ReturnType<typeof createClient>;
|
|
450
895
|
/** A mute end `hours` out, a minute inside the 7-day limit so clock skew can't tip it over. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secondlayer/sentinel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Sentinel from a terminal or an agent: the CLI, an MCP server and a client for your Stacks contract monitoring.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://runsentinel.app/docs",
|