MCPcopy
hub / github.com/simstudioai/sim / task

Function task

apps/sim/lib/a2a/client.test.ts:51–73  ·  view source on GitHub ↗
(opts: {
  state?: TaskState
  statusMessage?: Message
  hasStatus?: boolean
  history?: Message[]
  artifacts?: Artifact[]
})

Source from the content-addressed store, hash-verified

49}
50
51function task(opts: {
52 state?: TaskState
53 statusMessage?: Message
54 hasStatus?: boolean
55 history?: Message[]
56 artifacts?: Artifact[]
57}): Task {
58 const hasStatus = opts.hasStatus ?? (opts.state !== undefined || opts.statusMessage !== undefined)
59 return {
60 id: 'task-1',
61 contextId: 'ctx-1',
62 status: hasStatus
63 ? {
64 state: opts.state ?? TaskState.TASK_STATE_UNSPECIFIED,
65 message: opts.statusMessage,
66 timestamp: undefined,
67 }
68 : undefined,
69 artifacts: opts.artifacts ?? [],
70 history: opts.history ?? [],
71 metadata: undefined,
72 }
73}
74
75describe('buildUserMessage', () => {
76 it('builds a text-only user message', () => {

Callers 15

client.test.tsFile · 0.85
settleWithConcurrencyFunction · 0.85
run-data-drain.tsFile · 0.85
table-backfill.tsFile · 0.85
lifecycle-email.tsFile · 0.85
table-update.tsFile · 0.85
table-import.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected